Visual LANSA form S_236FB
* ===================================================================
*
* Component : S_236FB
* Type : Form
* Ancestor : PRIM_FORM (Primitive Form)
*
* Description : VL form invoked by a VB program
*
* Disclaimer : The following material is supplied as sample material
* only. No warranty concerning this material or its use
* in any way whatsoever is expressed or implied.
*
* ===================================================================
Begin_Com Role(*EXTENDS #PRIM_FORM) Height(315) Layoutmanager(#SPLM_1) Left(407) Top(191) Width(445)
Define_Com Class(#PRIM_SPLM) Name(#SPLM_1) Dividerstyle(Gap)
Define_Com Class(#PRIM_PANL) Name(#PANL_1) Displayposition(1) Height(234) Layoutmanager(#FWLM_1) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) Visualstyle(#VS_NOREAD) Width(437)
Define_Com Class(#PRIM_PANL) Name(#PANL_2) Displayposition(2) Layoutmanager(#FWLM_2) Left(0) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(238) Width(437)
Define_Com Class(#PRIM_SPLI) Name(#SPLI_1) Manage(#PANL_1) Parent(#SPLM_1) Weight(1)
Define_Com Class(#PRIM_SPLI) Name(#SPLI_2) Manage(#PANL_2) Parent(#SPLM_1)
Define_Com Class(#PRIM_FWLM) Name(#FWLM_1) Direction(TopToBottom)
Define_Com Class(#EMPNO.Visual) Name(#EMPNO) Displayposition(1) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(1) Width(209)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_1) Manage(#EMPNO) Parent(#FWLM_1)
Define_Com Class(#SURNAME.Visual) Name(#SURNAME) Displayposition(2) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(2) Top(29) Width(324)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_2) Manage(#SURNAME) Parent(#FWLM_1)
Define_Com Class(#GIVENAME.Visual) Name(#GIVENAME) Displayposition(3) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(3) Top(58) Width(324)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_3) Manage(#GIVENAME) Parent(#FWLM_1)
Define_Com Class(#ADDRESS1.Visual) Name(#ADDRESS1) Displayposition(4) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(4) Top(87) Width(363)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_4) Manage(#ADDRESS1) Parent(#FWLM_1)
Define_Com Class(#ADDRESS2.Visual) Name(#ADDRESS2) Displayposition(5) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(5) Top(116) Width(363)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_5) Manage(#ADDRESS2) Parent(#FWLM_1)
Define_Com Class(#ADDRESS3.Visual) Name(#ADDRESS3) Displayposition(6) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(6) Top(145) Width(363)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_6) Manage(#ADDRESS3) Parent(#FWLM_1)
Define_Com Class(#SALARY.Visual) Name(#SALARY) Displayposition(7) Height(19) Parent(#PANL_1) Tabposition(7) Top(174) Visualstyle(#VS_NORM) Width(278)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_7) Manage(#SALARY) Parent(#FWLM_1)
Define_Com Class(#PRIM_FWLM) Name(#FWLM_2) Direction(RightToLeft) Flowoperation(Decrease) Flowoperationver(Center) Itemsperdivision(2)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_CANCEL) Caption('Cancel') Displayposition(1) Left(336) Parent(#PANL_2) Tabposition(1) Top(0) Width(82)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_UPDATE) Caption('Update') Displayposition(2) Left(240) Parent(#PANL_2) Tabposition(2) Top(0) Width(86)
Define_Com Class(#PRIM_STBR) Name(#STBR_1) Displayposition(3) Height(24) Left(0) Messageposition(1) Parent(#PANL_2) Tabposition(3) Tabstop(False) Top(26) Width(437)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_8) Manage(#STBR_1) Parent(#FWLM_2)
Define_Com Class(#STD_TEXT.Visual) Name(#STD_TEXT) Caption('Comment') Displayposition(8) Height(19) Labeltype(Caption) Parent(#PANL_1) Tabposition(8) Top(203) Visualstyle(#VS_NORM) Width(400)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_9) Manage(#STD_TEXT) Parent(#FWLM_1)
* Path for received/sent .csv files
Define Field(#S_236PATH) Type(*CHAR) Length(255)
* File name without path
Define Field(#S_236FILE) Type(*CHAR) Length(20)
* File with full path for received or sent .csv file
Define Field(#S_236FILP) Type(*CHAR) Length(255)
* Field Name, type and value fields for exchange list)
Define Field(#S_236NAM) Type(*CHAR) Length(10) Label('Field Name')
Define Field(#S_236NAM1) Reffld(#S_236NAM)
Define Field(#S_236TYP) Type(*CHAR) Length(1) Label('Field Type')
Define Field(#S_236VAL) Type(*CHAR) Length(245) Label('Field Value')
*
* Numeric value to be exchanged
Define Field(#S_236VALN) Type(*DEC) Length(24) Decimals(9)
* Integer part of number (15 digit limitation of CHECKNUMERIC in Visual LANSA)
Define Field(#S_236INT) Type(*DEC) Length(15) Decimals(0)
* Decimal part of number)
Define Field(#S_236DEC) Type(*DEC) Length(9) Decimals(9)
*
* List to keep exchanged fields and values
Def_List Name(#S_LSTEXCH) Fields(#S_236NAM #S_236TYP #S_236VAL) Type(*WORKING) Entrys(500)
Evtroutine Handling(#com_owner.Initialize)
Set Com(#com_owner) Caption(*component_desc)
* convert the .csv file that the VB program passed into fields
Execute Subroutine(GETVALUES) With_Parms(*TEMP_DIR S_236FB_I.CSV)
*
Fetch Fields(*ALL *EXCLUDING #SALARY) From_File(PSLMST) With_Key(#EMPNO)
If_Status Is_Not(*OKAY)
Message Msgtxt('Employee not found')
Set Com(#phbn_update) Enabled(false)
Endif
Endroutine
Evtroutine Handling(#PHBN_UPDATE.Click)
Update Fields(#SALARY) In_File(PSLMST)
If_Status Is(*OKAY)
* convert the values to be sent back into a returned .csv file
Execute Subroutine(PUT_VALUES) With_Parms(*TEMP_DIR S_236FB_O.CSV)
* return to caller
Invoke Method(#Com_Owner.CloseForm)
Return
Endif
Endroutine
Evtroutine Handling(#PHBN_CANCEL.Click)
* return to caller
Invoke Method(#Com_Owner.CloseForm)
Return
Endroutine
*
* Get Exchanged values from .CSV file
*
Subroutine Name(GETVALUES) Parms(#S_236PATH #S_236FILE)
* Builds the .csv file name with full path)
Use Builtin(TCONCAT) With_Args(#S_236PATH #S_236FILE) To_Get(#S_236FILP)
* Retrieve field names, types and values into a list
Use Builtin(TRANSFORM_FILE) With_Args(#S_LSTEXCH #S_236FILP A) To_Get(#S_RETCDA2)
* If return code not EF, return 0 and return to caller)
If Cond('#S_RETCDA2 *NE ''EF''')
Message Msgtxt('Unable to transform file')
Return
Endif
* Select fields, validate them and post them to exch.list
* Get EMPNO
Execute Subroutine(GET_VALUE) With_Parms('EMPNO')
Change Field(#EMPNO) To(#S_236VAL)
* Get SALARY
Execute Subroutine(GET_VALUE) With_Parms('SALARY')
Change Field(#SALARY) To(#S_236VALN)
* Get Comment
Execute Subroutine(GET_VALUE) With_Parms('STD_TEXT')
Change Field(#STD_TEXT) To(#S_236VAL)
Endroutine
*
* Retrieve a single exchanged value from the working list
*
Subroutine Name(GET_VALUE) Parms(#S_236NAM1)
Change Field(#S_236NAM #S_236VAL #S_236VALN) To(*NULL)
Loc_Entry In_List(#S_LSTEXCH) Where('#S_236NAM *EQ #S_236NAM1')
If_Status Is(*OKAY)
If Cond('#S_236TYP *EQ N')
* Convert alpha field to number -
Use Builtin(CHECKNUMERIC) With_Args(#S_236VAL) To_Get(#S_236INT #S_236DEC #S_RETCDA1)
If Cond('#S_RETCDA1 *EQ Y')
Change Field(#S_236VALN) To('#S_236INT + #S_236DEC')
Endif
Endif
Endif
Endroutine
*
* Put exchanged values onto an exchange .CSV file
*
Subroutine Name(PUT_VALUES) Parms(#S_236PATH #S_236FILE)
* Builds the .csv file name with full path)
Use Builtin(TCONCAT) With_Args(#S_236PATH #S_236FILE) To_Get(#S_236FILP)
Clr_List Named(#S_LSTEXCH)
Change Field(#S_236VAL) To(#EMPNO)
Execute Subroutine(PUT_VALUE) With_Parms('EMPNO' 'A')
Change Field(#S_236VALN) To(#SALARY)
Execute Subroutine(PUT_VALUE) With_Parms('SALARY' 'N')
Change Field(#S_236VAL) To(#STD_TEXT)
Execute Subroutine(PUT_VALUE) With_Parms('STD_TEXT' 'A')
* Builds the .csv file name with full path)
Use Builtin(TCONCAT) With_Args(#S_236PATH #S_236FILE) To_Get(#S_236FILP)
Use Builtin(TRANSFORM_LIST) With_Args(#S_LSTEXCH #S_236FILP A) To_Get(#S_RETCDA2)
If Cond('#S_retcda2 *ne ''OK''')
Message Msgtxt('Unable to create flat file')
Endif
Endroutine
*
* Put a single exchanged value on the working list
*
Subroutine Name(PUT_VALUE) Parms(#S_236NAM #S_236TYP)
Define Field(#S_236TMP) Type(*CHAR) Length(31)
If Cond('#S_236TYP *eq N')
Use Builtin(NUMERIC_STRING) With_Args(#S_236VALN) To_Get(#S_236TMP)
Change Field(#S_236VAL) To(#S_236TMP)
Endif
Add_Entry To_List(#S_LSTEXCH)
Endroutine
End_Com
* ===================================================================
*
* Component : S_236FB
* Type : Form
* Ancestor : PRIM_FORM (Primitive Form)
*
* Description : VL form invoked by a VB program
*
* Disclaimer : The following material is supplied as sample material
* only. No warranty concerning this material or its use
* in any way whatsoever is expressed or implied.
*
* ===================================================================
Begin_Com Role(*EXTENDS #PRIM_FORM) Height(315) Layoutmanager(#SPLM_1) Left(407) Top(191) Width(445)
Define_Com Class(#PRIM_SPLM) Name(#SPLM_1) Dividerstyle(Gap)
Define_Com Class(#PRIM_PANL) Name(#PANL_1) Displayposition(1) Height(234) Layoutmanager(#FWLM_1) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) Visualstyle(#VS_NOREAD) Width(437)
Define_Com Class(#PRIM_PANL) Name(#PANL_2) Displayposition(2) Layoutmanager(#FWLM_2) Left(0) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(238) Width(437)
Define_Com Class(#PRIM_SPLI) Name(#SPLI_1) Manage(#PANL_1) Parent(#SPLM_1) Weight(1)
Define_Com Class(#PRIM_SPLI) Name(#SPLI_2) Manage(#PANL_2) Parent(#SPLM_1)
Define_Com Class(#PRIM_FWLM) Name(#FWLM_1) Direction(TopToBottom)
Define_Com Class(#EMPNO.Visual) Name(#EMPNO) Displayposition(1) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(1) Width(209)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_1) Manage(#EMPNO) Parent(#FWLM_1)
Define_Com Class(#SURNAME.Visual) Name(#SURNAME) Displayposition(2) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(2) Top(29) Width(324)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_2) Manage(#SURNAME) Parent(#FWLM_1)
Define_Com Class(#GIVENAME.Visual) Name(#GIVENAME) Displayposition(3) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(3) Top(58) Width(324)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_3) Manage(#GIVENAME) Parent(#FWLM_1)
Define_Com Class(#ADDRESS1.Visual) Name(#ADDRESS1) Displayposition(4) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(4) Top(87) Width(363)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_4) Manage(#ADDRESS1) Parent(#FWLM_1)
Define_Com Class(#ADDRESS2.Visual) Name(#ADDRESS2) Displayposition(5) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(5) Top(116) Width(363)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_5) Manage(#ADDRESS2) Parent(#FWLM_1)
Define_Com Class(#ADDRESS3.Visual) Name(#ADDRESS3) Displayposition(6) Height(19) Parent(#PANL_1) Readonly(True) Tabposition(6) Top(145) Width(363)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_6) Manage(#ADDRESS3) Parent(#FWLM_1)
Define_Com Class(#SALARY.Visual) Name(#SALARY) Displayposition(7) Height(19) Parent(#PANL_1) Tabposition(7) Top(174) Visualstyle(#VS_NORM) Width(278)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_7) Manage(#SALARY) Parent(#FWLM_1)
Define_Com Class(#PRIM_FWLM) Name(#FWLM_2) Direction(RightToLeft) Flowoperation(Decrease) Flowoperationver(Center) Itemsperdivision(2)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_CANCEL) Caption('Cancel') Displayposition(1) Left(336) Parent(#PANL_2) Tabposition(1) Top(0) Width(82)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_UPDATE) Caption('Update') Displayposition(2) Left(240) Parent(#PANL_2) Tabposition(2) Top(0) Width(86)
Define_Com Class(#PRIM_STBR) Name(#STBR_1) Displayposition(3) Height(24) Left(0) Messageposition(1) Parent(#PANL_2) Tabposition(3) Tabstop(False) Top(26) Width(437)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_8) Manage(#STBR_1) Parent(#FWLM_2)
Define_Com Class(#STD_TEXT.Visual) Name(#STD_TEXT) Caption('Comment') Displayposition(8) Height(19) Labeltype(Caption) Parent(#PANL_1) Tabposition(8) Top(203) Visualstyle(#VS_NORM) Width(400)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_9) Manage(#STD_TEXT) Parent(#FWLM_1)
* Path for received/sent .csv files
Define Field(#S_236PATH) Type(*CHAR) Length(255)
* File name without path
Define Field(#S_236FILE) Type(*CHAR) Length(20)
* File with full path for received or sent .csv file
Define Field(#S_236FILP) Type(*CHAR) Length(255)
* Field Name, type and value fields for exchange list)
Define Field(#S_236NAM) Type(*CHAR) Length(10) Label('Field Name')
Define Field(#S_236NAM1) Reffld(#S_236NAM)
Define Field(#S_236TYP) Type(*CHAR) Length(1) Label('Field Type')
Define Field(#S_236VAL) Type(*CHAR) Length(245) Label('Field Value')
*
* Numeric value to be exchanged
Define Field(#S_236VALN) Type(*DEC) Length(24) Decimals(9)
* Integer part of number (15 digit limitation of CHECKNUMERIC in Visual LANSA)
Define Field(#S_236INT) Type(*DEC) Length(15) Decimals(0)
* Decimal part of number)
Define Field(#S_236DEC) Type(*DEC) Length(9) Decimals(9)
*
* List to keep exchanged fields and values
Def_List Name(#S_LSTEXCH) Fields(#S_236NAM #S_236TYP #S_236VAL) Type(*WORKING) Entrys(500)
Evtroutine Handling(#com_owner.Initialize)
Set Com(#com_owner) Caption(*component_desc)
* convert the .csv file that the VB program passed into fields
Execute Subroutine(GETVALUES) With_Parms(*TEMP_DIR S_236FB_I.CSV)
*
Fetch Fields(*ALL *EXCLUDING #SALARY) From_File(PSLMST) With_Key(#EMPNO)
If_Status Is_Not(*OKAY)
Message Msgtxt('Employee not found')
Set Com(#phbn_update) Enabled(false)
Endif
Endroutine
Evtroutine Handling(#PHBN_UPDATE.Click)
Update Fields(#SALARY) In_File(PSLMST)
If_Status Is(*OKAY)
* convert the values to be sent back into a returned .csv file
Execute Subroutine(PUT_VALUES) With_Parms(*TEMP_DIR S_236FB_O.CSV)
* return to caller
Invoke Method(#Com_Owner.CloseForm)
Return
Endif
Endroutine
Evtroutine Handling(#PHBN_CANCEL.Click)
* return to caller
Invoke Method(#Com_Owner.CloseForm)
Return
Endroutine
*
* Get Exchanged values from .CSV file
*
Subroutine Name(GETVALUES) Parms(#S_236PATH #S_236FILE)
* Builds the .csv file name with full path)
Use Builtin(TCONCAT) With_Args(#S_236PATH #S_236FILE) To_Get(#S_236FILP)
* Retrieve field names, types and values into a list
Use Builtin(TRANSFORM_FILE) With_Args(#S_LSTEXCH #S_236FILP A) To_Get(#S_RETCDA2)
* If return code not EF, return 0 and return to caller)
If Cond('#S_RETCDA2 *NE ''EF''')
Message Msgtxt('Unable to transform file')
Return
Endif
* Select fields, validate them and post them to exch.list
* Get EMPNO
Execute Subroutine(GET_VALUE) With_Parms('EMPNO')
Change Field(#EMPNO) To(#S_236VAL)
* Get SALARY
Execute Subroutine(GET_VALUE) With_Parms('SALARY')
Change Field(#SALARY) To(#S_236VALN)
* Get Comment
Execute Subroutine(GET_VALUE) With_Parms('STD_TEXT')
Change Field(#STD_TEXT) To(#S_236VAL)
Endroutine
*
* Retrieve a single exchanged value from the working list
*
Subroutine Name(GET_VALUE) Parms(#S_236NAM1)
Change Field(#S_236NAM #S_236VAL #S_236VALN) To(*NULL)
Loc_Entry In_List(#S_LSTEXCH) Where('#S_236NAM *EQ #S_236NAM1')
If_Status Is(*OKAY)
If Cond('#S_236TYP *EQ N')
* Convert alpha field to number -
Use Builtin(CHECKNUMERIC) With_Args(#S_236VAL) To_Get(#S_236INT #S_236DEC #S_RETCDA1)
If Cond('#S_RETCDA1 *EQ Y')
Change Field(#S_236VALN) To('#S_236INT + #S_236DEC')
Endif
Endif
Endif
Endroutine
*
* Put exchanged values onto an exchange .CSV file
*
Subroutine Name(PUT_VALUES) Parms(#S_236PATH #S_236FILE)
* Builds the .csv file name with full path)
Use Builtin(TCONCAT) With_Args(#S_236PATH #S_236FILE) To_Get(#S_236FILP)
Clr_List Named(#S_LSTEXCH)
Change Field(#S_236VAL) To(#EMPNO)
Execute Subroutine(PUT_VALUE) With_Parms('EMPNO' 'A')
Change Field(#S_236VALN) To(#SALARY)
Execute Subroutine(PUT_VALUE) With_Parms('SALARY' 'N')
Change Field(#S_236VAL) To(#STD_TEXT)
Execute Subroutine(PUT_VALUE) With_Parms('STD_TEXT' 'A')
* Builds the .csv file name with full path)
Use Builtin(TCONCAT) With_Args(#S_236PATH #S_236FILE) To_Get(#S_236FILP)
Use Builtin(TRANSFORM_LIST) With_Args(#S_LSTEXCH #S_236FILP A) To_Get(#S_RETCDA2)
If Cond('#S_retcda2 *ne ''OK''')
Message Msgtxt('Unable to create flat file')
Endif
Endroutine
*
* Put a single exchanged value on the working list
*
Subroutine Name(PUT_VALUE) Parms(#S_236NAM #S_236TYP)
Define Field(#S_236TMP) Type(*CHAR) Length(31)
If Cond('#S_236TYP *eq N')
Use Builtin(NUMERIC_STRING) With_Args(#S_236VALN) To_Get(#S_236TMP)
Change Field(#S_236VAL) To(#S_236TMP)
Endif
Add_Entry To_List(#S_LSTEXCH)
Endroutine
End_Com