Programming Guide : A. Operating System Differences : Operating System Commands
 
Share this page          
Operating System Commands
The OpenROAD call system statement lets you execute a single operating system command from your 4GL code. When you use this statement in a portable application, you must account for the differences between commands on the various operating systems.
The following example presents a solution:
if CurSession.OperatingSystem = SY_UNIX then
   call system 'ls /usr/dracula/files';
elseif CurSession.OperatingSystem = SY_VMS then
   call system 'directory
   user$disk:[dracula.files]';
elseif CurSession.OperatingSystem = SY_MSDOS then
   call system 'command dir \usr\dracula\files';
elseif CurSession.OperatingSystem = SY_NT then
   call system 'cmd dir \usr\dracula\files';
else
   CurFrame.InfoPopup(messagetext =
   'Error: mysterious operating system');
endif;