home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / TM480.ZIP / TMEXAM.EXE / TMDEV.TSK < prev    next >
Encoding:
Text File  |  1991-09-10  |  14.3 KB  |  481 lines

  1. ; Title   : TMDEV.TSK                   Last Updated : August 21, 1991
  2. ; Author  : Steve Johnson - FmP.        Version      : 1.30
  3. ; Purpose : A Task development harness.
  4. ; Notes   : Uses SAVE and RESTORE to file called TMDEV.TM
  5. ;           The task will not allow users to select options requiring a
  6. ;           filename until they have confirmed the name found in the restore
  7. ;           operation, but it does remember which option they wanted to
  8. ;           perform and performs it after filename confirmation.
  9. ;           Quiet flag ignored by shareware version.
  10. ; Latest  : Use of new @BBHELP facility
  11. ;         : Use of FMPTM and FMPSCR for expert users
  12. ; Version 1.20:
  13. ;         : Addition of LIST for View option
  14. ;         : Keyvals added 
  15. ;         : Default is now reserved word changed to defcol
  16. ;         : Shellout option added 
  17.  
  18. var fmptm,20,$fmptm
  19. var fmpscr,20,$fmpscr
  20. var keyvals,8,'zDIESQVM'     ;z is impossible (not UPPER case)
  21. int i                ;saves choice 
  22. int count                       ;Loop counter
  23. int deferred_choice             ;Saves impossible choice numbers
  24. int fstat                       ;File verification status
  25. int main_choice                 ;Saves choice from outer menu
  26. int tskmac            ;Remembers MAC or TSK 
  27. var continue,12                 ;Holds return label
  28. logical selected                ;True is user specified a filename
  29.  
  30. var char,1
  31. var default_drive,1
  32. var drive,2                     ;Drive id followed by colon
  33. var editor,8,'LIST'             ;Name of editor
  34. var extension,3                 ;Last 3 characters of filename
  35. var file_bytes,1,occurs 14      ;Used to extract parts of SOURCE_FILE
  36. var filename,8,'   TMDEV'       ;1st 8 characters of filename
  37. var fullname,14                 ;This contains filename without spaces
  38. var macname,14                  ;The name of the MAC file
  39. var help_no,2
  40. var help_name,6
  41. var mac,1,"n"                   ;If Y: There is a MAC file for this TSK
  42. var mono,1,"y"                  ;If Y: Invoke Taskmaster with /M flag
  43. var names,1,"n"                 ;If Y: Invoke Taskmaster with /S flag
  44. var null,1                      ;Used to reset FILENAME and EXTENSION
  45. var postflags,8                 ;Editor flags after filename
  46. var preflags,8                  ;Editor flags preceding filename
  47. var quiet,1,"n"                 ;If Y: Invoke Taskmaster with /Q flag
  48. var source_file,14,'c:test.tsk' ;Dummy filename
  49. var tm_flags,6
  50. var one_space,1,' '
  51. var two_spaces,2,'  '
  52. var command_line,41
  53. var comspec,30,$comspec
  54.  
  55. vconst attention,79             ;Highlight colour combination
  56. èvconst cel,55                   ;Clear to end of line
  57. vconst cep,56                   ;Clear to end of page (screen)
  58. vconst cls,11                   ;Clear screen
  59. vconst defcol,5                 ;Default colour combination
  60.  
  61. end
  62.  
  63. if comspec = null
  64.   move 'c:\command' to comspec
  65. fi
  66. if fmpscr = null
  67.   move 'SCR' to fmpscr
  68. fi
  69. if fmptm = null
  70.   move 'TM' to fmptm
  71. fi
  72. move ddrive to default_drive
  73. lookfor tmdev.ovr        ;Check forms available
  74. if not found
  75.   forms logon.ovr       ;in case /q and not registered
  76.   insert filename filename
  77.   put "NO_FORMS"
  78.   stop
  79. fi
  80. forms tmdev.ovr          ;open forms file for use
  81. display cls
  82. if colour
  83.   move "n" to mono
  84. fi
  85. lookfor tmdev.tm         ;if the task has been used previously
  86. if found
  87.   restore 'tmdev.tm' source_file editor mac mono names quiet preflags postflags
  88. ; use old filename editor name and flag settings
  89.   if resp ne 0
  90.     Displayln "TMDEV: Failure during restoration of data from TMDEV.TM"
  91.     wait "Please try deleting it - press any key to abort"
  92.     stop
  93.   fi
  94.   restore
  95.   put "HELP_GEN" wait 0 noclear
  96. else
  97.   move '1INIT' to continue
  98.   goto 1GETDEFAULTS
  99. 1INIT
  100.   if anyfk
  101.     stop
  102.   fi
  103.   put "HELP_GEN" wait 0 noclear
  104. fi
  105. move true to hide
  106. move 0c000h to bbmask ;<esc> and F1
  107. menu 1,'BBMENU'
  108. option 1,1
  109.   clear selected
  110.   until selected or funkey = 10
  111. è    move '1GOTDEFAULTS' to continue
  112.     goto 1GETDEFAULTS
  113. 1GOTDEFAULTS
  114.     if selected
  115.       if deferred_choice ne 0
  116.     move deferred_choice to choice
  117.     if not anyfk
  118.       clear deferred_choice
  119.       cursor 2 0 defcol cel "Now I can action your selection..."
  120.       return 100
  121.     fi
  122.       else
  123.     cursor 2 0 defcol cel "Filename confirmed..."
  124.       fi
  125.     else
  126.       cursor 2 0 defcol cel "You must confirm a filename before "
  127.       display "I can action your selection"
  128.       put "HELP_GEN" wait 0 noclear
  129.       move 10 to funkey
  130.     fi
  131.   fi
  132.   return
  133. option 1,2
  134. option 1,3
  135. option 1,4
  136. option 1,6
  137.   if not selected
  138.     move hilite to deferred_choice
  139.     move 1 to choice
  140.     return 100
  141.   fi
  142.   cursor 2 0 defcol cep
  143.   userline          ;Prevents video mode change
  144.   if choice = 2
  145.     select drive
  146.     run default_drive ':' fmptm 1 tm_flags 1 drive filename
  147.     select default_drive
  148.     cursor 21 50 attention " TMDEV: Press any key " defcol
  149.     inkey char
  150.     cursor 2 0 defcol cep
  151.     upper char
  152.     if keyvals ct char
  153.       move fcol to choice 
  154.       return 100
  155.     fi
  156.   fi
  157.   if choice = 3 or choice = 6 and mac = 'y' or mac = 'Y'  
  158.     move choice to i
  159.     move tskmac to choice
  160.     put 'TSKMAC'
  161.     move hilite to tskmac 
  162.     move i to choice
  163.     if choice = 6
  164.       run 'list ' drive filename '.' display
  165.       return
  166. è    fi
  167.   fi
  168.   if choice = 6
  169.     run 'list ' fullname
  170.     return
  171.   fi
  172.   if choice = 3
  173.     combine editor 1 preflags 1 into command_line
  174.     if mac = 'y' or mac = 'Y'  
  175.       append filename '.' display to command_line
  176.     else 
  177.       append fullname to command_line
  178.     fi
  179.     append 1 postflags to command_line
  180.     move 1 to resp
  181.     until resp = 0
  182.       replace all two_spaces of command_line with one_space
  183.     fi
  184.     trim command_line
  185.     move 0 to elevel
  186.     run command_line
  187.     if elevel ne 0 or resp ne 0
  188.       cursor 21 50 attention " TMDEV: Press any key "  defcol
  189.       inkey char
  190. ;     let user see the error message... (if there is one!)
  191.     fi
  192.     cursor 2 0 defcol cep
  193.   fi
  194.   if choice = 4
  195.     select drive
  196.     run default_drive ":" fmpscr 1 filename ' /p'
  197.     select default_drive
  198.     if resp ne 0
  199.       put "HELP04"
  200.     fi
  201.   fi
  202.   return
  203. option 1,7
  204.   display defcol cls 'Please type EXIT<return> to return to TMDEV'
  205.   run 'command'
  206.   return
  207. option 1,5
  208. option 1,30     ;<esc>
  209.   stop
  210. option 1,31
  211.   move hilite to help_no with lead_zeroes
  212.   combine "HELP" help_no into help_name
  213.   move hilite to main_choice
  214.   put help_name 
  215.   move main_choice to choice
  216.   return
  217. endm 1
  218.  
  219. 1GETDEFAULTS
  220. clear selected
  221. èuntil selected or anyfk
  222.   append 8 to editor
  223.   fieldfill source_file mac mono names quiet editor preflags postflags
  224.   put 'NAME_EXT' 
  225.   if not anyfk
  226.     get source_file mac mono names quiet editor preflags postflags
  227.     upper mono quiet mac names
  228.     sizevar tm_flags 0
  229.     if mono = "Y"
  230.       append '/m' to tm_flags
  231.     fi
  232.     if quiet = "Y"
  233.       append '/q' to tm_flags
  234.     fi
  235.     if names = "Y"
  236.       append '/s' to tm_flags
  237.     fi
  238.     trim editor preflags postflags source_file
  239.     verify source_file using fstat source_file
  240. ;   fstat must be 0: using an @file field!
  241.     move source_file to file_bytes
  242.     CLEAR count DRIVE extension filename char
  243.     setscan source_file
  244.     move zero to delim
  245.     scan drive filename char extension
  246.     trim filename extension
  247.     combine drive filename '.' extension into fullname
  248.     combine drive filename '.MAC'  into macname
  249.     if extension = "TSK"
  250.       if filename = "TMDEV"
  251.     cursor 1 0 attention "TMDEV cannot be used to develop itself!" defcol cel
  252.       else
  253.     dir fullname
  254.     if found
  255.       move true to selected
  256.     else
  257.       cursor 1 0
  258.       ask selected cel 'Warning: No such file as ' source_file '. Proceed? '
  259.     fi
  260.         if mac = 'Y'
  261.           dir macname
  262.       if not found
  263.             cursor 1 0 cel 'Error: No such file as ' macname ' Press a key'
  264.             inkey char
  265.             move 'N' to mac
  266.             clear selected
  267.           fi
  268.     fi
  269.       fi
  270.     else
  271.       cursor 1 0 attention "Tasks must have a filetype of TSK !" defcol cel
  272.       inkey char
  273.       move "TSK" to extension
  274.       combine drive filename '.' extension into fullname
  275.       verify fullname using fstat source_file
  276. è    fi
  277.   fi
  278. fi
  279. if not anyfk
  280.   save 'tmdev.tm' source_file editor mac mono names quiet preflags postflags
  281.   save
  282. fi
  283. ;saves data for next run.
  284. ;cursor 2 0 defcol cep
  285. GOBACK continue
  286. @VID
  287. @defaults bright,cyan,blue
  288. @nf NAME_EXT
  289. @FILE
  290. @acceptfk f10
  291. @logical
  292. @logical
  293. @logical
  294. @logical
  295. @string min1
  296. @string
  297. @string
  298. @col char,white,blue
  299. @window line0,column70,depth1,width8
  300. F10=Quit
  301. @col char,white,blue
  302. @window line 2,column5,depth 15,width70
  303. @drop under,offset 2
  304. @double_line
  305. @dim
  306. @gon
  307. 7-------------------------------------------------------------------9 
  308. 0 Please confirm or edit details:                                   0
  309. 4----------------------------------------8--------------------------6
  310. 0 The name of the task being developed:  0 Use TAB,  or  to  move 0
  311. 0 Filename [              ]              0 between fields.   to 0
  312. 0 Separate MAC file [ ] Y or N           0 save any changes  or F10 0
  313. 4----------------------------------------2----------------9 to quit 0
  314. 0 When invoking Taskmaster:                               4---------6
  315. 0 Use Mono mode [ ] Show Formnames [ ] Use Quiet mode [ ] 0         0
  316. 4---------------------------------------------------------3         0
  317. 0 The Editor will be invoked as:                                    0
  318. 0 Editor_name {{pre_flags}} filename {{post_flags}}                     0
  319. 0 Please specify:                                                   0
  320. 0 Editor name [        ] Pre Flags [        ] Post Flags [        ] 0
  321. 1-------------------------------------------------------------------3
  322. @bright
  323. @END
  324. @nf BBMENU
  325. @bright
  326. @col char,white,blue
  327. @window line0,column0,depth2,width0
  328. @BBIMENU GREEN,BLUE
  329. @key bright,white,blue
  330. { Defaults }{ Interpret }{ Edit }{ Scr }{ Quit }{ View }{ MS-DOS shell }
  331. è@col char,white,blue
  332. @window line0,column70,depth1,width8
  333. F1=Help
  334. @BBHELP line 1,column 0,width 60,bright,white,red
  335. @HELP ' Change editor and application details and flags'
  336. @HELP ' Load a copy of Taskmaster to Interpret the named task '
  337. @HELP ' Load your nominated wordprocessor to Edit the task'
  338. @HELP ' Process the task using Scr to create an OVR or FORMS file'
  339. @HELP ' Leave this task - return from whence you came'
  340. @HELP ' Load LIST.COM to look at the nominated task'
  341. @HELP ' Get a DOS prompt for running things not on the menu '
  342. @END
  343. @nf HELP01
  344. @colour char,white,blue
  345. @GON
  346. @dim
  347. @WINDOW LINE 3,COLUMN 10,DEPTH 15,WIDTH 49
  348. @drop under,offset 2
  349. @outline cyan
  350.   Defaults-Option-Help
  351.  Hel≡ oε TMDEV.TSK║  Aε examplσ TASKMASTE╥ átasδ ì
  352. áfo≥ applicatioε developers«  Singlσ sourceΣ fo≥ ì
  353. áCDO╙ o≥ M╙-DO╙ operation«  (Uni° equivalen⌠ ái≤ ì
  354. áDEVELOP.TSK).
  355.  
  356. á Yo⌡ ámus⌠ áconfirφ thσ namσ oµ ß átasδ ábeforσ ì
  357. áselectinτ áoption≤ requirinτ ß tasδ name« á Thσ ì
  358. átasδ áwil∞ ápolicσ this«  Thσ áedito≥ ánamσ ái≤ ì
  359. áaskeΣ fo≥ onl∙ iµ thσ datafilσ TMDEV.T═ i≤ áno⌠ ì
  360. áavailable.
  361.  
  362.  Thσ áfilenamσ anΣ edito≥ namσ arσ árecordeΣ áiε ì
  363. áTMDEV.T═ fo≥ subsequen⌠ restoration.
  364. @END
  365. @nf HELP02
  366. @colour char,white,BLUE
  367. @GON
  368. @dim
  369. @WINDOW LINE 3,COLUMN 10,DEPTH 13,WIDTH 49
  370. @drop under,offset 2
  371. @outline cyan
  372.   Interpret-Option-Help
  373.  Thσ áINTERPRETÆ áoptioε load≤ áanothe≥ ácop∙ áoµ ì
  374. áTaskmaste≥ a≤ ß 'childº proces≤ whicΦ áattempt≤ ì
  375. át∩ executσ thσ nameΣ  task«  Wheε thi≤ á'childº ì
  376. áproces≤ ái≤ áterminateΣ á(duσ át∩ áerror≤ áá o≥ ì
  377. áexecutinτ áß STO╨ command⌐ contro∞ wil∞ áreturε ì
  378. át∩ TMDEV.
  379.  
  380.  Thσ PAT╚ wil∞ bσ useΣ t∩ locatσ Taskmaster«  Iµ ì
  381. áyo⌡ áwisΦ át∩ ánominatσ áß áspecifiπ ácop∙ ááoµ ì
  382. áTaskmaste≥ pleasσ se⌠ thσ environmen⌠ ávariablσ ì
  383. áFMPT═ accordingl∙ (FMPT═ ha≤ n∩ othe≥ use).ì
  384. @END
  385. @nf HELP03
  386. @colour char,white,BLUE
  387. @GON
  388. è@dim
  389. @WINDOW LINE 3,COLUMN 10,DEPTH 6,WIDTH 49
  390. @drop under,offset 2
  391. @outline cyan
  392.   Edit-Option-Help
  393.  Thσ átasδ wil∞ bσ editeΣ usinτ thσ áedito≥ áyo⌡ ì
  394. ánominatσ usinτ thσ DEFAULT╙ option«  B∙ defaul⌠ ì
  395. áLIS╘ ái≤ ánameΣ a≤ thσ editor¼  i⌠ i≤ áiε áfac⌠ ì
  396. ájus⌠ ß filσ viewer« 
  397. @END
  398. @nf HELP04
  399. @colour char,white,BLUE
  400. @GON
  401. @dim
  402. @WINDOW LINE 3,COLUMN 10,DEPTH 14,WIDTH 49
  403. @drop under,offset 2
  404. @outline cyan
  405.   SCR-Option-Help
  406.  Thσ á SCRù áoptioε áload≤ áTH┼ áSCREE╬ áTEMPLAT┼ ì
  407. áPROCESSORù áiµ i⌠ i≤ availablσ whicΦ ácreate≤ áß ì
  408. áfilσ ácalleΣ TASKNAME.OV╥ containinτ áprocesseΣ ì
  409. áforms« á Yo⌡ ma∙ looδ a⌠ thσ forφ sourcσ á(i.e« ì
  410. ábeforσ áthe∙ havσ beeε processed⌐ b∙ áexamininτ ì
  411. áthσ  TS╦ files╗ thσ form≤ arσ usuall∙ founΣ áa⌠ ì
  412. áthσ enΣ  oµ thσ file.
  413.  
  414.  Thσ áPAT╚ wil∞ bσ useΣ t∩ locatσ SCR« á Iµ áyo⌡ ì
  415. áwisΦ t∩ nominatσ ß specifiπ cop∙ oµ SC╥ ápleasσ ì
  416. áse⌠ thσ environmen⌠ variablσ FMPSC╥ accordingl∙ ì
  417. á(FMPSC╥ ha≤ n∩ othe≥ use)« 
  418. @END
  419. @nf HELP05
  420. @colour char,white,BLUE
  421. @GON
  422. @dim
  423. @WINDOW LINE 3,COLUMN 10,DEPTH 7,WIDTH 25
  424. @drop under,offset 2
  425. @outline cyan
  426.   Quit-Option-Help
  427.  Thσ  qui⌠ optioε simpl∙ 
  428. áreturn≤ t∩ thσ ácallinτ ì
  429. áprocess¼ áááthi≤ áááái≤ ì
  430. áusuall∙ ááthσ ááCommanΣ ì
  431. áLinσ Interpreter.
  432. @END
  433. @nf HELP06
  434. @colour char,white,BLUE
  435. @GON
  436. @dim
  437. @WINDOW LINE 3,COLUMN 10,DEPTH 5,WIDTH 25
  438. @drop under,offset 2
  439. @outline cyan
  440.   View-File-Option-Help
  441.  Thi≤ áinvoke≤ áLIS╘ át∩ ì
  442. ávie≈ áthσ ásourcσ áfilσ ì
  443. áselected.
  444. @END
  445. @nf help07
  446. @colour char,white,BLUE
  447. @GON
  448. @dim
  449. @WINDO╫ LIN┼ 3,COLUM╬ 10,DEPT╚ 12,WIDT╚ 25
  450. @dro≡ under,offse⌠ 2
  451. @outline cyan
  452.   MS-DOS-Shell-help
  453. è Thi≤ ááload≤ áááanothe≥ ì
  454. ácommanΣ interprete≥ át∩ ì
  455. áallo≈ áyo⌡ át∩ áperforφ ì
  456. áan∙ command≤ yo⌡ áwish« ì
  457. áTaskmaste≥ áááááremain≤ ì
  458. áloadeΣ áanΣ ááresident« ì
  459. áWheε yo⌡ wisΦ t∩ returε ì
  460. át∩ áTaskmaste≥ á simpl∙ ì
  461. áente≥ áEXITü (thi≤ á
  462. ámen⌡ wil∞ rσ-appear)
  463. @end
  464. @nf HELP_GEN
  465. @colour char,white,BLUE
  466. @GON
  467. @WINDOW LINE 3,COLUMN 10,DEPTH 11,WIDTH 60
  468. @outline cyan
  469.   General-Help
  470.  Please  select  the option you require  using  the  <space
  471.  bar>, <arrow keys> or <home> key and pressing .
  472.                                                             
  473.  This  is an instant Bounce-bar menu so you may  press  the
  474.  first  character of any topic - in which case   is
  475.  not needed.
  476.                                                             
  477.  Context  sensitive help is available:  Highlight  a  topic
  478.  and press function key <F1>.
  479. @end
  480.  
  481. @nf tskmac
  482. @bbmenu cyan,blue
  483. @bright
  484. @win line0,column69,depth1,width10
  485. {TSK }{MAC }
  486.  Select...
  487. @end
  488. @eof
  489.