Function SET191B

LANSA

Function SET191B

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_191);
********** COMMENT(Function .......: SET191B);
********** COMMENT(Created on .....: 10/10/00 at 14:43:32);
********** COMMENT(Description ....: OV_FILE_SERVICE MAKE_DIR REMOVE_DIR);
********** COMMENT(Version.........: 1);
**********;
********** COMMENT(This function creates a directory called C:\OV_DEMO and);
********** COMMENT(then creates directories A, B, C and D within it. It );
********** COMMENT(then destroys all the directories created);
********** COMMENT(Note that this is done in reverse order );
********** COMMENT(because a directory must be);
********** COMMENT(empty to be removed (destroyed) :);
**********;
********** 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);
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
DEF_COND NAME(*AS400) COND('*CPUTYPE = AS400');
IF COND(*AS400);
MESSAGE MSGTXT('Not available on iSeries');
MENU;
ELSE;
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(MAKE_DIR 'C:\OV_DEMO');
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(MAKE_DIR 'C:\OV_DEMO\A');
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(MAKE_DIR 'C:\OV_DEMO\B');
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(MAKE_DIR 'C:\OV_DEMO\C');
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(MAKE_DIR 'C:\OV_DEMO\D');
MESSAGE MSGTXT('Directories all created .... use OK to delete them now');
POP_UP FIELDS((#DATE *L3 *P2)) AT_LOC(8 23) WITH_SIZE(55 10) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(REMOVE_DIR 'C:\OV_DEMO\A');
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(REMOVE_DIR 'C:\OV_DEMO\B');
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(REMOVE_DIR 'C:\OV_DEMO\C');
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(REMOVE_DIR 'C:\OV_DEMO\D');
EXECUTE SUBROUTINE(DIRECT) WITH_PARMS(REMOVE_DIR 'C:\OV_DEMO');
MESSAGE MSGTXT('Directories all deleted .... use OK to end this function');
POP_UP FIELDS((#DATE *L3 *P2)) AT_LOC(8 23) WITH_SIZE(55 10) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
ENDIF;
SUBROUTINE NAME(DIRECT) PARMS((#OV_SERV *RECEIVED) (#OV_DIRECT *RECEIVED));
DEFINE FIELD(#OV_SERV) TYPE(*CHAR) LENGTH(20);
DEFINE FIELD(#OV_DIRECT) TYPE(*CHAR) LENGTH(65);
DEFINE FIELD(#OV_RETC) TYPE(*CHAR) LENGTH(2);
DEFINE FIELD(#OV_ERRNO) TYPE(*DEC) LENGTH(7) DECIMALS(0) EDIT_CODE(4);
USE BUILTIN(OV_FILE_SERVICE) WITH_ARGS(#OV_SERV #OV_DIRECT) TO_GET(#OV_RETC #OV_ERRNO);
IF COND('#OV_RETC *NE OK');
DISPLAY FIELDS(#OV_SERV (#OV_DIRECT *NOID) #OV_RETC #OV_ERRNO) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
ABORT MSGTXT('Directory Operation failed');
ENDIF;
ENDROUTINE;