Form S_156FDE: High Speed Data Entry

LANSA

Form S_156FDE: High Speed Data Entry
Name: S_156FDE

Description: RDMLX Standalone Form
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM BORDERICONS(Maximize+Minimize+SystemMenu) HEIGHT(184) LEFT(260) TOP(297) WIDTH(492);
;
DEFINE_COM CLASS(#EMPNO.Visual) NAME(#EMPNO) DISPLAYPOSITION(2) HEIGHT(19) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(1) TOP(8) WIDTH(209);
DEFINE_COM CLASS(#GIVENAME.Visual) NAME(#GIVENAME) DISPLAYPOSITION(3) ENABLED(False) HEIGHT(19) LEFT(224) MARGINLEFT(0) PARENT(#COM_OWNER) TABPOSITION(6) TABSTOP(False) TOP(8) WIDTH(113);
DEFINE_COM CLASS(#SURNAME.Visual) NAME(#SURNAME) DISPLAYPOSITION(4) ENABLED(False) HEIGHT(19) LEFT(344) MARGINLEFT(0) PARENT(#COM_OWNER) TABPOSITION(7) TABSTOP(False) TOP(8) WIDTH(137);
DEFINE_COM CLASS(#DEPTMENT.Visual) NAME(#DEPTMENT) DISPLAYPOSITION(5) HEIGHT(19) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(2) TOP(40) WIDTH(201);
DEFINE_COM CLASS(#DEPTDESC.Visual) NAME(#DEPTDESC) DISPLAYPOSITION(6) ENABLED(False) HEIGHT(19) LEFT(224) MARGINLEFT(0) PARENT(#COM_OWNER) TABPOSITION(9) TABSTOP(False) TOP(40) WIDTH(153);
DEFINE_COM CLASS(#SECTION.Visual) NAME(#SECTION) DISPLAYPOSITION(7) HEIGHT(19) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(3) TABSTOP(False) TOP(72) WIDTH(185);
DEFINE_COM CLASS(#SECDESC.Visual) NAME(#SECDESC) DISPLAYPOSITION(8) ENABLED(False) HEIGHT(19) LEFT(224) MARGINLEFT(0) PARENT(#COM_OWNER) TABPOSITION(8) TABSTOP(False) TOP(72) WIDTH(137);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_SAVE) CAPTION(Save) DISPLAYPOSITION(9) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(4) TOP(104);
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(1) HEIGHT(22) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(5) TABSTOP(False) TOP(135) WIDTH(484);
;
define #testblank *char 1;
def_cond *isblank '#testblank *EQ Y' ;
def_cond *notblank '#testblank *NE Y' ;
;
* Form Initialization;
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption('Example of high speed data entry');
invoke #empno.setfocus;
ENDROUTINE ;
;
* Save button clicked ;
;
EVTROUTINE HANDLING(#BTN_SAVE.Click);
change (#empno #surname #givename #deptment #deptdesc #section #secdesc) *blanks;
invoke #empno.setfocus;
message 'Emulated save completed';
ENDROUTINE ;
;
* Employee number changed ;
;
EVTROUTINE HANDLING(#EMPNO.Changed);
change (#givename #surname) *blanks ;
execute testblank (#empno 5);
if *notblank;
fetch (#givename #surname) from_file(pslmst) with_key(#empno);
if_status *okay;
invoke #deptment.setfocus;
else ;
change (#givename #surname) UNKNOWN;
message 'Unknown employee number specified';
endif ;
endif ;
ENDROUTINE ;
;
* Department Code changed;
;
EVTROUTINE HANDLING(#deptment.Changed);
change (#deptdesc) *blanks ;
execute testblank (#deptment 3);
if *notblank;
fetch (#deptdesc) from_file(deptab) with_key(#deptment) keep_last(100);
if_status *okay;
invoke #section.setfocus;
else ;
change (#deptdesc) UNKNOWN;
message 'Unknown department code specified';
endif ;
endif ;
ENDROUTINE ;
;
* Section Code changed ;
;
EVTROUTINE HANDLING(#section.Changed);
change (#secdesc) *blanks ;
execute testblank (#section 2);
if *notblank;
fetch (#secdesc) from_file(sectab) with_key(#deptment #section) keep_last(100);
if_status *okay;
invoke #btn_save.setfocus;
else ;
change (#secdesc) UNKNOWN;
message 'Unknown section code specified';
endif ;
endif ;
ENDROUTINE ;
;
* Check for non-blank value at specified location ;
;
subroutine testblank ((#std_textl *received)(#ii *received));
DEFINE FIELD(#II) TYPE(*DEC) LENGTH(7) DECIMALS(0);
DEF_ARRAY NAME(#TXT) INDEXES(#II) OVERLAYING(#STD_TEXTL) TYPE(*CHAR) TOT_ENTRY(80) ENTRY_LEN(1);
if '#TXT#II *EQ '' '' ';
change #testblank Y;
else ;
change #testblank N;
endif ;
endroutine ;
;
END_COM ;