&ACCESS RVP
&COMMENT Example on user messages
DEF msg_demo_vLoulli( )

DECL INT ANSWER, OFFSET
DECL STATE_T STATE
DECL MSG_T EMPTY_MSG

;---------------------Acknowledgement-Message----------
;The programm is stopped until this message is acknowledged over the softkeys. 

EMPTY_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
$MSG_T=EMPTY_MSG
$MSG_T.KEY[]="DEMO1: Acknowledgement%1" ;%1 will be replaced by $MSG_T.PARAM[]
$MSG_T.PARAM[]="-Message"
$MSG_T.PARAM_TYP=#VALUE
$MSG_T.TYP=#QUIT
WAIT SEC 0.2 ;mandatory to solve a bug with unreleased status messages
$MSG_T.VALID=TRUE
WHILE  $MSG_T.VALID
  WAIT SEC 0.05
ENDWHILE

;---------------------Status-Message----------
;This message should disappear after it is released.

EMPTY_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
$MSG_T=EMPTY_MSG
$MSG_T.KEY[]="DEMO2: Status-Message"
$MSG_T.TYP=#STATE
WAIT SEC 0.2 ;mandatory to solve a bug with unreleased status messages
$MSG_T.VALID=TRUE
WAIT SEC 4 ;the status-message should disappear after this delay
$MSG_T.RELEASE=TRUE
WAIT SEC 0.5 ;mandatory to help reducing a bug with unreleased status messages

;-------------------Dialog-Query----------------
;This message allows user reply over the softkeys.

EMPTY_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
$MSG_T=EMPTY_MSG
$MSG_T.KEY[]="DEMO3: DIALOG-Message, Please choose one of the below options:"
$MSG_T.DLG_FORMAT[]="A|B|C"
$MSG_T.TYP=#DIALOG
WAIT SEC 0.2 ;mandatory to solve a bug with unreleased status messages
$MSG_T.VALID=TRUE
WHILE ($MSG_T.VALID==TRUE) 
  WAIT SEC 0.05
ENDWHILE
ANSWER=$MSG_T.ANSWER

;---------------------Notification-Message----------
;This message is displayed until it is acknowledged but the programm is not stopped.

EMPTY_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
$MSG_T=EMPTY_MSG
OFFSET=0
;SWRITE converts ANSWER to a string and represents also an alternative to using $MSG_T.PARAM[]
SWRITE($MSG_T.KEY[],STATE,OFFSET,"DEMO4: Notification, The previously chosen option was number: %d",ANSWER) 
$MSG_T.TYP=#NOTIFY
WAIT SEC 0.2 ;mandatory to solve a bug with unreleased status messages
$MSG_T.VALID=TRUE

END