Function SET191J

LANSA

Function SET191J
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_191);
********** COMMENT(Function .......: SET191J);
********** COMMENT(Created on .....: 10/10/00 at 14:43:32);
********** COMMENT(Description ....: OV_PASTE_CLIPBOARD);
********** COMMENT(Version.........: 1);
**********;
********** COMMENT(This function demonstrates: );
********** COMMENT(OV_PASTE_CLIPBOARD );
********** COMMENT(OV_POST_CLIPBOARD.);
**********;
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
**********;
********** COMMENT(Receives: nothing);
**********;
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT);
**********;
DEFINE FIELD(#S_191TXT1) TYPE(*CHAR) LENGTH(079) INPUT_ATR(LC);
DEFINE FIELD(#S_191TXT2) TYPE(*CHAR) LENGTH(079) INPUT_ATR(LC);
DEFINE FIELD(#S_191TXT3) TYPE(*CHAR) LENGTH(079) INPUT_ATR(LC);
DEFINE FIELD(#S_191TXT4) TYPE(*CHAR) LENGTH(079) INPUT_ATR(LC);
**********;
CHANGE FIELD(#S_191TXT1) TO('''Enter some text and use the post and paste function keys. ''');
CHANGE FIELD(#S_191TXT2) TO('''Note that although OV_POST_CLIPBOARD and OV_PASTE_CLIPBOARD''');
CHANGE FIELD(#S_191TXT3) TO('''interface well with each other, they do not interface well with other ''');
CHANGE FIELD(#S_191TXT4) TO('''applications. (e.g. notepad, browsers etc)''');
DEF_LIST NAME(#S_LSTBRW) FIELDS(#STD_TEXT);
DEF_LIST NAME(#S_LSTWRK) FIELDS(#STD_TEXT) TYPE(*WORKING) ENTRYS(5000);
OVERRIDE FIELD(#S_RETCDA2) DESC('OV_PASTE/POST_CLIPBOARD return code');
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
DEF_COND NAME(*AS400) COND('*CPUTYPE = AS400');
IF COND(*AS400);
MESSAGE MSGTXT('Not available on iSeries');
MENU;
ELSE;
INZ_LIST NAMED(#S_LSTBRW) NUM_ENTRYS(20) WITH_MODE(*CHANGE);
BEGIN_LOOP;
DISPLAY FIELDS((#S_191TXT1 *OUTPUT) (#S_191TXT2 *OUTPUT) (#S_191TXT3 *OUTPUT) (#S_191TXT4 *OUTPUT) (#S_RETCDA2 *OUTPUT *DESC)) IDENTIFY(*NOID) BROWSELIST(#S_LSTBRW) USER_KEYS((17 'Post' *NEXT *NONE)(18 'Paste' *NEXT *NONE)(19 'Clear'));
CASE OF_FIELD(#IO$KEY);
WHEN VALUE_IS('= ''17''');
********** COMMENT(Post to clipboard);
CLR_LIST NAMED(#S_LSTWRK);
SELECTLIST NAMED(#S_LSTBRW);
ADD_ENTRY TO_LIST(#S_LSTWRK);
ENDSELECT;
USE BUILTIN(OV_POST_CLIPBOARD) WITH_ARGS(#S_LSTWRK T N) TO_GET(#S_RETCDA2);
WHEN VALUE_IS('= ''18''');
********** COMMENT(Paste from clipboard );
USE BUILTIN(OV_PASTE_CLIPBOARD) WITH_ARGS(T N) TO_GET(#S_LSTWRK #S_RETCDA2);
CLR_LIST NAMED(#S_LSTBRW);
SET_MODE TO(*CHANGE);
SELECTLIST NAMED(#S_LSTWRK);
ADD_ENTRY TO_LIST(#S_LSTBRW);
ENDSELECT;
WHEN VALUE_IS('= ''19''');
********** COMMENT(Clear List );
CHANGE FIELD(#STD_TEXT) TO(*NULL);
INZ_LIST NAMED(#S_LSTBRW) NUM_ENTRYS(20) WITH_MODE(*CHANGE);
ENDCASE;
END_LOOP;
ENDIF;