Accueil
Nous contacter
Private area
-Accueil- -Nouvelles- -Agenda- -Meetings- -Divers-
RPG Free Format
Le Comité de Common Europe Luxembourg à le plaisir de vous inviter à la session :
RPG Free Format
par Paul Roy, Real Solutions
Agenda : Le 3 octobre 2013, à l'hotel DoubleTree by Hilton
  • à partir de 12H30 sandwich lunch
  • 14 H Présentation pat 1
  • 15H30 cofee break
  • 15H50 Présentation part 2
  • 17H closing & drink
RPG Free

Presentation du langage, des possibiliés
Compte-Rendu

les présentations sont disponibles ci - dessous.

Presentation
example de code - ci dessous
H dftactgrp(*NO)
D Main PR EXTPGM('UUDR00R')
D Directory 255A
D extension 3A
D Pgm2Call 10A

D Main PI
D P_dir 255A
D P_Ext 3A
D P_Pgm 10A

D Procdir PR
D Directory 255A
D extension 3A
D Pgm2Call 10A

D readdir PR * EXTPROC('readdir')
D dirp * VALUE


D closedir PR 10I 0 EXTPROC('closedir')
D dirhandle * VALUE

C/free
// P_DIR = %trim(P_dir)+ null;
ProcDir(P_DIR:P_EXT:P_PGM);
*inlr = *ON;
return;
/end-free

P ProcDir B
D ProcDir PI
D P_dir_ 255A
D P_Ext_ 3A
D P_Pgm_ 10A
D ptr_ent s *
D ActionProgram PR EXTPGM(programName)
D fileName 640
D opendir PR * EXTPROC('opendir')
D dirname * VALUE options(*string)
D closedir PR 10I 0 EXTPROC('closedir')
D dirhandle *
D dirent ds based(ptr_ent )
D d_reserved1 16A
D d_fileno_gen_id...
D 10U 0
D d_fileno 10U 0
D d_reclen 10U 0
D d_reserved3 10I 0
D d_reserved4 8A
D d_nlsinfo 12A
D nls_ccsid 10I 0 OVERLAY(d_nlsinfo:1)
D nls_cntry 2A OVERLAY(d_nlsinfo:5)
D nls_lang 3A OVERLAY(d_nlsinfo:7)
D nls_reserv 3A OVERLAY(d_nlsinfo:10)
D d_namelen 10U 0
D d_name 640A
D d_name_p S *
D
D Dirname S 255
D hdl_dir S *
D nullPtr S *
**-- File stat-structure: -----------------------------------------**
D Buf Ds Align
D st_mode 10u 0
D st_ino 10u 0
D st_nlink 5u 0
D 2a
D st_uid 10u 0
D st_gid 10u 0
D st_size 10i 0
D st_atime 10i 0
D st_mtime 10i 0
D st_ctime 10i 0
D st_dev 10u 0
D st_blksize 10u 0
D st_allocsize 10u 0
D st_objtype 11a
D 1a
D st_codepage 5u 0
D st_reserv1 62a
D st_ino_gen_id 10u 0
**
D st_objtype_p S * inz(%addr(st_objtype))

D objName S 640
D fileExtension S 3
D programName S 10
D i S 5 0
D rtcd S 10I 0
D stat PR 10I 0 ExtProc('stat')
D path * value options(*string : *trim )
D buf LikeDS(buf)


C/free
hdl_dir = opendir(%trim(P_DIR_));
programName=P_PGM_;
if hdl_dir <> *null ;
ptr_ent = readdir(hdl_dir);
dow ( ptr_ent <> *null);
d_name_p = %addr(d_name) ;
objName = ' ';
objName = %trim( p_dir_ ) + '/' + %trim(%str(d_name_p) );
i = %len(%trim(objname ));
if stat( objName :buf)<> -1 ;
if %str(st_objtype_P ) = '*DIR' ;
if %subst(objname : i : 1) <> '.' ;
ProcDir(objName : P_ext : P_PGM);
endif;
else;
dow (i> 1 AND %subst(objName : i : 1) <> '.');
i-=1;
enddo;
fileExtension = %subst(objName:i+1);
if fileExtension = P_EXT_;
ActionProgram(objName);
Endif;
ENDIF;
ENDIF;
d_name=' ';
ptr_ent = readdir(hdl_dir);
ENDDO;
rtcd = closedir(hdl_dir);
ENDIF;


return;
/end-free
P ProcDir E