Form S_159FSV: System Variable Values Editor

LANSA

Form S_159FSV: System Variable Values Editor
Name: S_159FSV

Description: RDMLX Standalone Form
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM BORDERICONS(Maximize+Minimize+SystemMenu) HEIGHT(233) LEFT(289) TOP(197) WIDTH(573);
;
DEFINE_COM CLASS(#PRIM_LTVW) NAME(#VARLIST) DISPLAYPOSITION(1) HEIGHT(167) LEFT(0) PARENT(#COM_OWNER) SELECTIONSTYLE(Single) TABPOSITION(2) TOP(7) WIDTH(166);
DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_1) CAPTION('System Variable') CAPTIONTYPE(Caption) DISPLAYPOSITION(2) PARENT(#VARLIST) SOURCE(#SYSVAR$NM) WIDTH(20) WIDTHTYPE(Remainder);
DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_2) PARENT(#VARLIST) SOURCE(#STD_CODEL) VISIBLE(False) WIDTH(20);
DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_4) PARENT(#VARLIST) SOURCE(#SYSVAR$NV) VISIBLE(False) WIDTH(20);
DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_3) PARENT(#VARLIST) SOURCE(#SYSVAR$AV) VISIBLE(False) WIDTH(20);
;
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_2) CAPTION(Details) DISPLAYPOSITION(2) HEIGHT(175) LEFT(168) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(2) VISIBLE(False) WIDTH(397);
DEFINE_COM CLASS(#SYSVAR$NM.Visual) NAME(#SYSVAR$NM) CAPTION(Name) DISPLAYPOSITION(1) HEIGHT(19) LABELTYPE(Caption) LEFT(8) MARGINLEFT(50) PARENT(#GPBX_2) TABPOSITION(1) TOP(16) WIDTH(375);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_1) CAPTION(Type) DISPLAYPOSITION(4) HEIGHT(70) LEFT(8) PARENT(#GPBX_2) TABPOSITION(2) TABSTOP(False) TOP(48) WIDTH(89);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RB_ALPHA) BUTTONCHECKED(True) CAPTION(Alpha) DISPLAYPOSITION(1) HEIGHT(24) LEFT(16) PARENT(#GPBX_1) TABPOSITION(1) TOP(18) WIDTH(70);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RB_NUMBER) CAPTION(Numeric) DISPLAYPOSITION(2) LEFT(16) PARENT(#GPBX_1) TABPOSITION(2) TABSTOP(False) TOP(36) WIDTH(70);
DEFINE_COM CLASS(#SYSVAR$AV.Visual) NAME(#SYSVAR$AV) CAPTION('Alpha Value') DISPLAYPOSITION(5) HEIGHT(19) LABELTYPE(Caption) LEFT(102) MARGINLEFT(74) PARENT(#GPBX_2) TABPOSITION(3) TOP(55) WIDTH(281);
DEFINE_COM CLASS(#SYSVAR$NV.Visual) NAME(#SYSVAR$NV) CAPTION('Numeric Value') DISPLAYPOSITION(6) HEIGHT(19) LABELTYPE(Caption) LEFT(102) MARGINLEFT(74) PARENT(#GPBX_2) TABPOSITION(4) TOP(88) WIDTH(281);
;
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PB_SAVE) CAPTION(Save) DISPLAYPOSITION(3) ENABLED(False) LEFT(128) PARENT(#GPBX_2) TABPOSITION(5) TOP(136);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PB_CANCEL) BUTTONCANCEL(True) CAPTION(Cancel) DISPLAYPOSITION(2) LEFT(301) PARENT(#GPBX_2) TABPOSITION(7) TOP(136);
;
DEFINE FIELD(#SYSVARFIL) TYPE(*CHAR) LENGTH(100);
DEFINE FIELD(#RETCODE) TYPE(*CHAR) LENGTH(2);
DEFINE FIELD(#SAVVAR$NM) REFFLD(#SYSVAR$NM);
DEF_LIST NAME(#SAV1LIST) FIELDS(#SYSVAR$NM #STD_CODEL #SYSVAR$NV) TYPE(*WORKING) ENTRYS(1);
DEF_LIST NAME(#SAV2LIST) FIELDS( #SYSVAR$AV) TYPE(*WORKING) ENTRYS(1);
DEFINE FIELD(#NEWVAR$NM) TYPE(*CHAR) LENGTH(20) ;
;
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(3) HEIGHT(25) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(3) TOP(181) WIDTH(565);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PB_DELETE) CAPTION(Delete) DISPLAYPOSITION(7) LEFT(216) PARENT(#GPBX_2) TABPOSITION(6) TOP(136);
;
EVTROUTINE handling(#com_owner.Initialize);
change #NEWVAR$NM <NEW>;
USE BUILTIN(TCONCAT) WITH_ARGS(*PART_DIR_EXECUTE VSAM008.DAT) TO_GET(#SYSVARFIL);
SET #com_owner caption(*component_desc);
EXECUTE SUBROUTINE(DISKTOLIST);
set #gpbx_2 visible(false) ;
ENDROUTINE ;
;
subroutine DisktoList;
CLR_LIST NAMED(#VARLIST);
USE BUILTIN(TRANSFORM_FILE) WITH_ARGS(#VARLIST #SYSVARFIL T) TO_GET(#RETCODE);
if '#RETCODE *NE EF';
USE BUILTIN(CLR_MESSAGES);
CHANGE FIELD(#SYSVAR$NM) TO(#NEWVAR$NM);
CHANGE FIELD(#STD_CODEL) TO(TRUE);
CHANGE FIELD(#SYSVAR$AV #SYSVAR$NV) TO(*NULL);
ADD_ENTRY TO_LIST(#VARLIST);
ENDIF ;
endroutine ;
;
subroutine ListtoDisk;
USE BUILTIN(TRANSFORM_LIST) WITH_ARGS(#VARLIST #SYSVARFIL T) TO_GET(#RETCODE);
endroutine ;
;
EVTROUTINE HANDLING(#PB_delete.Click);
if '#sysvar$nm *ne #NEWVAR$NM' ;
CHANGE FIELD(#savvar$nm) TO(#SYSVAR$NM);
SELECTLIST NAMED(#VARLIST);
IF COND('#sysvar$nm = #savvar$nm');
DLT_ENTRY FROM_LIST(#VARLIST);
RETURN ;
ENDIF ;
ENDSELECT ;
set #gpbx_2 visible(false);
endif ;
endroutine ;
;
EVTROUTINE HANDLING(#PB_SAVE.Click);
define #testname *char 2;
define #testname1 *char 1 to_overlay(#testname 1) ;
define #testname2 *char 2 to_overlay(#testname 2);
change #testname #sysvar$nm;
if '(#testname1 *ne ''*'') *or (#testname2 = *blanks)';
USE BUILTIN(MESSAGE_BOX_SHOW) WITH_ARGS(OK OK WARNING ERROR 'Invalid system variable name');
else ;
CHANGE FIELD(#SAVVAR$NM) TO(#SYSVAR$NM);
CHANGE FIELD(#STD_CODEL) TO(#RB_ALPHA.BUTTONCHECKED);
INZ_LIST NAMED(#SAV1LIST);
INZ_LIST NAMED(#SAV2LIST);
SELECTLIST NAMED(#VARLIST);
IF COND('#sysvar$nm = #savvar$nm');
GET_ENTRY NUMBER(1) FROM_LIST(#SAV1LIST);
GET_ENTRY NUMBER(1) FROM_LIST(#SAV2LIST);
UPD_ENTRY IN_LIST(#VARLIST);
RETURN ;
ENDIF ;
ENDSELECT ;
GET_ENTRY NUMBER(1) FROM_LIST(#SAV1LIST);
GET_ENTRY NUMBER(1) FROM_LIST(#SAV2LIST);
ADD_ENTRY TO_LIST(#VARLIST);
CHANGE FIELD(#SYSVAR$NM #SYSVAR$AV #SYSVAR$NV) TO(*NULL);
invoke #sysvar$nm.setfocus ;
endif ;
ENDROUTINE ;
;
EVTROUTINE HANDLING(#VARLIST.ItemGotFocus);
if '#sysvar$nm = #newvar$nm';
set #pb_delete enabled(false);
else ;
set #pb_delete enabled(True);
endif ;
if '#std_codel = TRUE';
execute GotoAlpha;
else ;
execute GotoNumber;
endif ;
set #pb_save enabled(true);
set #gpbx_2 visible(true);
ENDROUTINE ;
;
EVTROUTINE HANDLING(#COM_OWNER.Closing);
EXECUTE SUBROUTINE(LISTTODISK);
ENDROUTINE ;
;
EVTROUTINE HANDLING(#PB_CANCEL.Click);
Invoke #com_owner.CloseForm;
ENDROUTINE ;
;
subroutine GotoAlpha;
set #rb_alpha buttonchecked(true);
change #std_codel true;
Set #sysvar$av enabled(True) readonly(false);
change #sysvar$nv 0;
set #sysvar$nv enabled(false) readonly(true);
endroutine ;
;
subroutine GotoNumber;
set #rb_number buttonchecked(true);
change #std_codel false;
Set #sysvar$nv enabled(True) readonly(false);
change #sysvar$av *blanks;
set #sysvar$av enabled(false) readonly(true);
endroutine ;
;
EVTROUTINE HANDLING(#RB_ALPHA.Click);
if '#rb_alpha.buttonchecked = true';
execute GotoAlpha ;
else ;
execute GotoNumber ;
endif ;
ENDROUTINE ;
;
EVTROUTINE HANDLING(#RB_NUMBER.Click);
if '#rb_number.buttonchecked = true';
execute GotoNumber ;
else ;
execute GotoAlpha ;
endif ;
ENDROUTINE ;
;
END_COM ;