home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
e
/
epmmac2.zip
/
MAIN.E
< prev
next >
Wrap
Text File
|
1992-12-16
|
4KB
|
121 lines
define DEBUG_MAIN = 0
defmain /* defmain should be used to parse the command line arguments */
compile if WANT_PROFILE='SWITCH'
universal REXX_PROFILE
compile endif
compile if EVERSION < 5
universal comsfileid, messy
compile else
universal activemenu, should_showwindow
should_showwindow = 1 -- Lets cmdline commands inhibit the SHOWWINDOW.
compile endif
doscmdline = 'e 'arg(1) /* Can do special processing of DOS command line.*/
unnamed_name=UNNAMED_FILE_NAME -- Define the name once to save a few bytes.
.filename = unnamed_name -- Ver. 3.11: Don't rely on fileid.
compile if DEBUG_MAIN
messageNwait('DEFMAIN: arg(1)="'arg(1)'"')
compile endif
compile if EVERSION < 5
if messy then .windowoverlap=1; endif -- messy-desk style?
compile endif
compile if EVERSION > '5.15'
compile if WANT_APPLICATION_INI_FILE
'initconfig' -- Check if anything of interest is in OS2.INI
compile if DEBUG_MAIN
messageNwait('DEFMAIN: after INITCONFIG')
compile endif
compile endif
compile if (HOST_SUPPORT='EMUL' | HOST_SUPPORT='E3EMUL') and not defined(my_SAVEPATH)
call check_savepath()
compile endif
compile endif
doscmdline -- Execute the doscmdline.
compile if DEBUG_MAIN
messageNwait('DEFMAIN: after DOSCMDLINE')
compile endif
getfileid newfileid
compile if EVERSION < 5
if 'e'<>doscmdline then /* Put doscmdline into coms stack if nontrivial.*/
getline line,comsfileid.last,comsfileid
if line<>doscmdline then -- Don't duplicate last line
if comsfileid.last > 30 then deleteline 1,comsfileid endif -- trim if too big
insertline doscmdline,comsfileid.last+1,comsfileid
endif
endif
compile endif
/* E automatically created an empty file when it started. */
/* If user specified file(s) to edit, get rid of the empty file. */
do i=1 to 1
getfileid emptyfileid, UNNAMED_FILE_NAME
if emptyfileid='' then -- User deleted it?
leave
endif
if emptyfileid.modify then -- User changed it?
leave
endif
if newfileid=emptyfileid then -- Check if others in ring.
compile if EVERSION < 5
if messy then nextwindow else nextfile endif
getfileid newfileid
if messy then prevwindow else prevfile endif
compile else
nextfile
getfileid newfileid
prevfile
compile endif
endif
if newfileid<>emptyfileid then
activatefile emptyfileid
'xcom q'
compile if EPM and MENU_LIMIT
call updateringmenu()
compile endif
activatefile newfileid
call select_edit_keys()
endif
end
compile if CURSOR_ON_COMMAND and not EPM
cursor_command
compile endif
compile if EPM
compile if INCLUDE_MENU_SUPPORT
showmenu activemenu /* show the default EPM menu */
compile if DEBUG_MAIN
messageNwait('DEFMAIN: after SHOWMENU')
compile endif
compile endif
if should_showwindow then
call showwindow('ON')
compile if DEBUG_MAIN
messageNwait('DEFMAIN: after SHOWWINDOW')
compile endif
endif
compile endif
compile if WANT_PROFILE
compile if WANT_PROFILE='SWITCH'
if REXX_PROFILE then
compile endif
profile = 'profile.erx'
findfile profile1, profile, EPATH
if rc then findfile profile1, profile, 'PATH'; endif
if not rc then
'rx' profile1 arg(1)
endif
compile if WANT_PROFILE='SWITCH'
endif
compile endif
compile endif