home *** CD-ROM | disk | FTP | other *** search
- ; Title : WORDPROC.TSK Last Updated : August 28, 1991
- ; Author : Steve Johnson - FmP. Version : 1.21
- ; Purpose : Remembers the names of up to 10 files with descriptions
- ; and edit dates and times. Edits files with nominated editor.
- ; Notes : Uses SAVE and RESTORE to/from WORDPROC.TM
- ; Latest 1.21
- ; : Couldn't RUN editor or LIST from the root directory.
- ; Changes : Use of virtual menu facility for menu 1.
- ; : Creates WORDPROC.TM in each directory invoked from
-
- hexvar esc,1b
- int popid
- int selvar
- var selvars,7,' CERDV' ;esc appended later!
- int count ;loop counter
- int cv,ev,line
- int resperror
- int savechoice
-
- logical delete
- logical dontdraw
- logical edit
- logical editing
- logical forever
- logical located
- logical nodat
-
- var action,8,'WORDPROC'
- var char,1
- var datf,12,"WORDPROC.TM" ;Name of data file
- var datv,8,OCCURS 10 ;Edit times
- var descriptlist,30,occurs 10
- var dot_ext,4
- var editor,40
- var filelist,14,occurs 12,
- ' '
- ' '
- ' '
- ' '
- ' '
- 'Update list Quit wordproc '
-
- var filename,14
- var lead,10 ;Pars before filename
- var location,40
- var locn,7
- var message,58
- var name,40
- ;ar newfile,14,'Update list'
- var null,1
- var path,164,$path ;set to environment variable path
- var root,3
- var select,1 ;Holds key user presses when prompted
- var timv,8,occurs 10 ;Edit dates
- var trail,10 ; '' after ''
- var tname,8,"WORDPROC"
- var try,40
- var work_dir,64
- vconst attn,79 ;Clear screen
- vconst cel,55 ;Clear line
- vconst cep,56 ;Clear page
- vconst cls,11 ;Clear screen
- vconst normal,5 ;Reset colours
-
- END
-
- move true to hide
- lookfor wordproc.ovr
- if not found
- forms logon.ovr ;in case /q and registered
- insert tname tname
- put "NO_FORMS"
- stop
- fi
- combine ddrive ':\' into root
- user work_dir
- if work_dir = root
- sizevar work_dir 2
- fi
- forms wordproc.ovr ;Open relevant forms file
- display cls
- dir datf ;Check for presence of datafile
- if found
- restore datf datv timv filelist descriptlist editor lead trail name
- if resp ne 0
- wait "WORDPROC: Error during data restoration"
- stop
- fi
- else
- ; go to a label
- move '1RETURN' to locn
- goto 1INIT
- 1RETURN
- if anyfk
- stop
- fi
- fi
- append esc to selvars
- until forever
- if editing ;initially false
- move 2 to line
- clear count ;reset loop count
- until count = 10
- fieldfill entry count of filelist ;fill a field of next form
- fieldfill entry count of descriptlist ;fill a field of next form
- move entry count of filelist to filename ;extract filename
- fi count ;increment loop count
- cursor 12 0 cep ;clear screen from line 12
- put 'EDIT' noclear ;display fields for editing
- cursor 12 0 cep ;clear screen from line 12 again
- if not anyfk ;ignore if user pressed a function key
- clear count ;reset loop count
- until count = 10 or anyfk ;loop 10 times
- get entry count of filelist ;get edited data from all fields
- get entry count of descriptlist
- if entry count of filelist = spaces and entry count of descriptlist ne spaces
- clear entry count of descriptlist
- add 2 to count giving line
- cursor line 22 cel
- fi
- fi count
- clear select
- else
- move "X" to select
- fi
- fi
- if not dontdraw
- clear count ;reset loop count
- move 2 to line
- until count = 10 ;display data, file statuses
- move entry count of filelist to filename
- if filename ne spaces
- if select ne "R"
- if not editing or anyfk
- fore 15
- cursor line 22 entry count of descriptlist
- if select ne 'X'
- cursor line 54 entry count of datv
- cursor line 63 entry count of timv
- fi
- fi
- if select ne 'X'
- trim filename
- dir filename
- if found
- cursor line 72 "Present"
- else
- cursor line 72 "Absent "
- fi
- fi
- fi
- fi
- increment line
- fi count
- fi
- clear editing ;finished edit phase
- move 0e000H to bbmask ;Enable F1, F2 and ESC keys
- menu 2,'DISPLAY_LIST',filelist
- option 2,12
- option 2,30
- save datf ;open file for output
- move resp to resperror
- save datv timv filelist descriptlist editor lead trail name
- add resp to resperror
- save ;close file
- add resp to resperror
- if resperror ne 0
- wait 'WORDPROC: An error occured when attempting to save data'
- fi
- stop ;(or ESC) return to operating system
- option 2,1,10
- subtract 1 from choice giving count
- move entry count of filelist to filename ;get appropriate filename
- move choice to savechoice
- clear choice
- trim filename ;remove any trailing spaces
- dir filename ;check for file..
- move 8000h to bbmask
- if found ;display appropriate option list
- move ev to choice
- put "EDIT_LIST"
- move hilite to ev
- else
- move cv to choice
- put "CREATE_LIST"
- move hilite to cv
- fi
- if choice = 30
- move esc to select
- else
- move display to select ;Use first char of Topic
- fi
- if selvars ct select
- move fcol to selvar
- fi
- clear dontdraw
- menu 1,selvar ;this is a virtual menu - no template
- option 1,1,2
- cursor 13 20 cel ;clear message line
- run editor 1 lead 1 work_dir '\' filename 1 trail ;execute editor
- display cls ;clear screen on exit
- if elevel = 0
- move time to entry count of timv ; edit date
- move date to entry count of datv ;and time
- else
- wait 'WORDPROC: A problem occurred when attempting to run editor'
- stop
- fi
- exitm
- option 1,3
- option 1,6
- cursor 13 20 cel
- clear bbdisp
- move savechoice to choice
- put 'MM_MESSAGE' nowait
- return 1
- option 1,4
- cursor 14 20 cel attn
- ask delete 'Delete ' filename ': Are you sure? (enter Y or N)'
- cursor 14 20 normal cel
- if delete
- erase filename
- else
- move true to dontdraw
- fi
- exitm
- option 1,5
- cursor 13 20 cel
- popscreen popid
- run 'list ' work_dir '\' filename
- popdown popid
- popfree popid
- put 'MM_MESSAGE' nowait
- clear popid
- clear bbdisp
- move true to dontdraw
- exitm
- endm 1
- move savechoice to choice ;Destroyed by 2nd menu
- exitm
- option 2,31
- put "HELP_SCREEN" wait 0 noclear
- move "R" to select
- move hilite to choice
- clear bbdisp
- exitm
- option 2,32
- append 40 to name
- sizevar name 14
- fieldfill NAME
- move '1UPDATE' to locn
- move 'CHANGES ' to action
- goto 1INIT
- clear choice
- 1UPDATE
- exitm
- option 2,11 ;user wants to add a file
- move true to editing
- endm 2
- fi
- 1INIT
- ;a label for a GOTO command
- clear dontdraw
- clear found message
- until found OR anyfk
- ; ask for a directory and program name
- ; combine the two add .exe if no '.' supplied
- ; then confirm the existence of that file
- insert message action
- put "EDITOR" noclear
- if not anyfk
- get name
- trim name
- if not name ct "."
- append ".exe" to name
- fi
- verify name using count editor
- setscan editor 2
- move zero to delim
- sizevar name 8
- clear dot_ext
- scan name dot_ext
- trim name
- append dot_ext to name
- move name to editor
- move editor to try
- dir editor
- if not found
- setscan path
- move ';' to delim
- move true to found
- clear located nodat
- until located or nodat
- clear location
- scan location
- if found
- move location to try ;lookout for trailing \
- append "*" to try
- if try ct "\*"
- combine location editor into try
- else
- combine location '\' editor into try
- fi
- dir try
- move found to located
- else
- move true to nodat
- fi
- fi
- if not found
- append 40 to editor
- append 40 to name
- sizevar name 14
- combine "Unable to access: " editor into message
- fieldfill name
- else
- move try to editor
- clear message
- fi
- fi
- fi
- fi
- if not anyfk
- if locn = '1UPDATE'
- fieldfill lead trail
- fi
- insert try action
- put "PARAMETERS"
- if not anyfk
- get lead trail
- trim lead trail
- save datf ;open file for output
- move resp to resperror
- save datv timv filelist descriptlist editor lead trail name
- add resp to resperror
- save ;close file
- add resp to resperror
- if resperror ne 0
- wait 'WORDPROC: An error occured when attempting to save data'
- stop
- fi
- fi
- else
- display normal cls
- fi
- ; go back to where you came from!
- GOBACK LOCN
-
- ENDTASK ;marks end of executive commands
-
- @VID
- @nf DISPLAY_LIST
- @win line2,column2,depth10,width1
- @win line2,column17,depth10,width5
- @win line2,column52,depth10,width1
- @COL CHAR,WHITE,blue
- @win line0,column0,depth2,width0
- @COL char,blue,cyan
- @HEAD LEFT,'FmP Taskmaster Demo'
- @HEAD RIGHT,'Wordprocessing Helper'
- @HEAD CENTRE,'WORDPROC.TSK'
- @BANNER
- @COL CHAR,cyan,blue
- Filename Description Date Time Status
- @COL CHAR,cyan,black
- @win line2,column0,depth12,width16
- @BBMENU WHITE,BLUE
- @COL CHAR,WHITE,BLUE
- @repeat x12
- { }
-
- @COL CHAR,WHITE,BLack
- @win line13,column20,depth1,width0
- @COL CHAR,WHITE,BLUE
- Press F1 for help. F2 to change editor details.
- @colour char,white,black
- @bright
- @END
- @nf mm_message
- @win line13,column20,depth1,width0
- @COL CHAR,WHITE,BLUE
- Press F1 for help. F2 to change editor details.
- @COL CHAR,WHITE,BLACK
- @bright
- @END
- @nf EDIT
- @OVERLAY
- @acceptfk f10
- @FILENAME
- @STR
- @FILENAME OPTIONAL
- @STR
- @FILENAME OPTIONAL
- @STR
- @FILENAME OPTIONAL
- @STR
- @FILENAME OPTIONAL
- @STR
- @FILENAME OPTIONAL
- @STR
- @FILENAME OPTIONAL
- @STR
- @FILENAME OPTIONAL
- @STR
- @FILENAME OPTIONAL
- @STR
- @FILENAME OPTIONAL
- @STR
- @window line2,column0,depth10,width50
- @repeat x10
- [ ] [ ]
-
- @col char,yellow,blue
- Use TAB and BACKTAB to move beween fields.
- When finished press to save changes or F10 to abandon them.
- @colour char,white,black
- @bright
- @END
- @nf CREATE_LIST
- @window line 13,column20,depth1,width0
- @BBIMENU cyan,blue
- {Create New file }{Return to filelist }
- @colour char,white,black
- @bright
- @END
- @nf EDIT_LIST
- @window line 13,column20,depth1,width0
- @BBIMENU cyan,blue
- {Edit file }{View file }{Delete file }{Return to filelist }
- @colour char,white,black
- @bright
- @END
- @nf HELP_SCREEN
- @colour char,cyan,blue
- @window line 15,column0,depth9,width0
- @out cyan
-
- The UPDATE option allows you to define a list of filenames and descriptions
- for files in the working directory. Taskmaster checks to see if named files
- exist and displays the result of this check in the status column.
-
- This task demonstrates the flexibility of Taskmaster Bounce-bar menus. As
- you see, the topics are not fixed; they can be defined and edited at Run-
- Time. The text of the selected topic can be used directly in the task.
- @colour char,white,black
- @bright
- @END
- @nf EDITOR
- @acceptfk f10
- @file
- @col page,cyan,blue
- @border
-
-
- Welcome to WORDPROC
-
- @col char,cyan,blue
- The file wordproc.tm is used to store the following information:
- 1. Details of your text editor,
- 2. The names, descriptions and edit DATES/TIMES of up to 10 files
-
- What do you normally type to access your wordprocessor or text
- editor ? If you use a COM or BAT extension please supply it else
- .EXE assumed. (Omit the drive letter)
-
- @col char,white,blue
- Editor name [ ] I will expect to find it on the PATH
- { }
- @col char,cyan,blue
- Press Function key F10 to abandon{WORDPROC} or to continue.
- @col char,white,blue
- @bright
- @END
- @nf parameters
- @acceptfk f10
- @str
- @str
- @col char,cyan,blue
- @win line8,column1,depth10,width78
- @col char,white,blue
- Your editor is: { }
-
- @col char,cyan,blue
- When I edit a file I will pass the filename as a command
- line parameter; if you would like me to supply additional
- parameters before or after the filename please supply them now:
-
- @col char,white,blue
- editor [ ] filename [ ]
- leading pars trailing pars
-
- @col char,cyan,blue
- Press Function key F10 to abandon{WORDPROC} or to continue.
- @col char,white,blue
- @bright
- @end
- @eof
-