Webアプリケーションの非表示コマンド・ハンドラーの例
Example 1
* This is an example of VLF.WEB hidden command.
* It is executed on the web server.
* It can coded in RDML or RDMLX format.
* Regardless of whether it is RDML or RDMLX it needs to use the
* VF* series of built-in functions to communicate with the Framework
* manager.
Function Options(*DIRECT)
* Get the current instance list entry
Use Builtin(VF) With_Args(GETCURRENTINSTANCE)
* Get AKEY3 because it contains the employee number
Use Builtin(VF_GET) With_Args(AKEY3) To_Get(#EmpNo)
* Issue a message showing the employee number retrieved
Execute Subroutine(Showmsg) With_Parms('Employeee number selected is' #Empno)
* Make the message always be displayed in the web browser
Use Builtin(VF_SET) With_Args(AVSHOWMESSAGES TRUE)
* Finished
Return
* Simple subroutine to issue a message onto program message queue
Subroutine Name(ShowMSG) Parms((#MSGDTA *RECEIVED) (#TEMP1 *RECEIVED))
Define Field(#Msgdta) Type(*char) Length(132)
Define Field(#Temp1) Type(*char) Length(132)
Use Builtin(BCONCAT) With_Args(#MSGDTA #TEMP1) To_Get(#MSGDTA)
Message Msgid(DCM9899) Msgf(DC@M01) Msgdta(#MsgDta)
Endroutine
Example 2
* =======================================================
* Description ...: Instance level Hidden Command Handler
*
* =======================================================
FUNCTION OPTIONS(*DIRECT)
* Simple Field and Group Definitions
* =======================================================
DEFINE FIELD(#REVSD) REFFLD(#VF_ELBOOL)
DEF_COND NAME(*REVSD) COND('#REVSD *EQ TRUE')
* Get the Employee number of the current instance
* and the revered flag.
USE BUILTIN(VF) WITH_ARGS(GETCURRENTINSTANCE)
USE BUILTIN(VF_GET) WITH_ARGS(AKEY1) TO_GET(#EMPNO)
* Get the Name state from the clipboard
USE BUILTIN(VF_RESTOREAVALUE) WITH_ARGS(*BLANKS PNCAFLT REVERSED #EMPNO) TO_GET(#REVSD)
USE BUILTIN(VF_TRACEAVALUE) WITH_ARGS('Employee name is surname first? ' #REVSD)
* Fetch information from the main file to fill in the
* header fields on the form
FETCH FIELDS(#SURNAME #GIVENAME) FROM_FILE(PSLMST) WITH_KEY(#EMPNO)
* Put the names together in the reverse order
IF COND(*REVSD)
* Put the names together Given name first
CHANGE FIELD(#UF_VISID2) TO(#GIVENAME)
USE BUILTIN(BCONCAT) WITH_ARGS(#UF_VISID2 #SURNAME) TO_GET(#UF_VISID2)
* Set the reversed flag
CHANGE FIELD(#REVSD) TO(FALSE)
USE BUILTIN(VF_TRACEAVALUE) WITH_ARGS('Employee name has been reversed. Name is now ' #UF_VISID2)
ELSE
* Put the names together Surname first
CHANGE FIELD(#UF_VISID2) TO(#SURNAME)
USE BUILTIN(BCONCAT) WITH_ARGS(#UF_VISID2 #GIVENAME) TO_GET(#UF_VISID2)
* Set the reversed flag
CHANGE FIELD(#REVSD) TO(TRUE)
USE BUILTIN(VF_TRACEAVALUE) WITH_ARGS('Employee name is now surname first. Name is now ' #UF_VISID2)
ENDIF
* Update the name (Visual ID 2) to the instance list
USE BUILTIN(VF) WITH_ARGS(BEGINLISTUPDATE)
* Set up the list entry details
USE BUILTIN(VF_SET) WITH_ARGS(VISUALID1 #EMPNO VISUALID2 #UF_VISID2 AKEY1 #EMPNO)
USE BUILTIN(VF_TRACEAVALUE) WITH_ARGS('Employee name is surname first? ' #REVSD)
* Add instance details to the instance list
USE BUILTIN(VF) WITH_ARGS(ADDTOLIST)
* Instance list updating is now complete
USE BUILTIN(VF) WITH_ARGS(ENDLISTUPDATE)
* Remember which way the name is presented
USE BUILTIN(VF_SAVEAVALUE) WITH_ARGS(#REVSD PNCAFLT REVERSED #EMPNO)