home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / forthmac / !Forthmacs / risc_os / Tcl / setup < prev    next >
Encoding:
Text File  |  1997-03-19  |  4.0 KB  |  124 lines

  1. set fonts(n) Trinity.Medium
  2. set fonts(i) Trinity.Medium.Italic
  3. set fonts(b) Trinity.Bold
  4. set fonts(t) Corpus.Medium
  5. set fonts(a) Sassoon.Primary
  6.  
  7. set colours(red) 255:0:0
  8. set colours(green) 0:255:0
  9. set colours(blue) 0:0:255
  10. set colours(yellow) 255:255:0
  11. set colours(cyan) 0:255:255
  12. set colours(magenta) 255:0:255
  13. set colours(white) 255:255:255
  14. set colours(black) 0:0:0
  15. set colours(grey) 127:127:127
  16.  
  17. # define some global variables
  18. set line ""
  19. set fid 0
  20. set win 0
  21. set licencename ""
  22. set licencedate "010195"
  23. set searchname ""
  24.  
  25. # The next lines define global flags that could be set to 1
  26. # if the option should be on at start
  27. set debugflag 0
  28. set traceflag 0
  29. set profileflag 0
  30. set clockflag 0
  31. set serialflag 0
  32. set blockflag 0
  33. set compatibleflag 0
  34. set w_file "risc_os\.auto"
  35. set binsizevar "Large"
  36. set Licence "Evaluation Version"
  37. set docdriver "ASCII"
  38.  
  39. # these variables are set according to the !Forthmacs system status and control greying in the menus
  40. set meta 1;    if {[file exists Forthmacs:meta.arm.target]}        {set meta 0}
  41. set docs 1;    if {[file exists Forthmacs:docs.formatt.format]}        {set docs 0}
  42. set develop 1; if {[file exists Forthmacs:private.develop]}        {set develop 0}
  43.  
  44. if {[file exists Forthmacs:private.Licence]}\
  45.   { set fid [open Forthmacs:private.Licence]; set Licence [gets $fid]; close $fid}
  46.  
  47.  
  48. # function declarations
  49. proc setoptions {}\
  50. { global compatibleflag debugflag traceflag profileflag clockflag serialflag blockflag
  51.   global binsizevar docdriver
  52.   system "seteval Forthmacsoptions 0"
  53.   if {$binsizevar == "Large"} {system "seteval Forthmacsoptions 4096"}
  54.   if {$docdriver  == "LaTeX"} {system "seteval Forthmacsoptions Forthmacsoptions +  8192"}
  55.   if {$docdriver  == "HTML"}  {system "seteval Forthmacsoptions Forthmacsoptions + 16384"}
  56.   system "seteval Forthmacsoptions Forthmacsoptions +      $compatibleflag"
  57.   system "seteval Forthmacsoptions Forthmacsoptions +  2 * $debugflag"
  58.   system "seteval Forthmacsoptions Forthmacsoptions +  4 * $traceflag"
  59.   system "seteval Forthmacsoptions Forthmacsoptions +  8 * $serialflag"
  60.   system "seteval Forthmacsoptions Forthmacsoptions + 16 * $blockflag"
  61.   system "seteval Forthmacsoptions Forthmacsoptions + 32 * $profileflag"
  62.   system "seteval Forthmacsoptions Forthmacsoptions + 64 * $clockflag"
  63.   system "set Forthmacsoptions <Forthmacsoptions>"
  64. }
  65.  
  66. proc archive         {list} {system "archive $list"}
  67. proc update-archive     {list date } {system "+archive $list $date"}
  68. proc doexit {}\
  69. { system "Unset ForthmacsTcl"
  70.   system "Unset Forthmacsoptions"
  71.   exit
  72.  
  73. proc binary {bin}\
  74. { global binsizevar
  75.   setoptions
  76.   if {$binsizevar == "Large"} {system "Forthmacs:risc_os.bin.run.$bin"}
  77.   if {$binsizevar == "Small"} {system "Forthmacs:risc_os.bin.run.s$bin"}
  78. }
  79.  
  80. proc compiler {bin}\
  81. { global binsizevar
  82.   setoptions
  83.   if {$binsizevar == "Large"} {system "Forthmacs:risc_os.bin.load.$bin"}
  84.   if {$binsizevar == "Small"} {system "Forthmacs:risc_os.bin.load.s$bin"}
  85. }
  86.  
  87. proc runforth {file}\
  88. { global binsizevar
  89.   setoptions
  90.   if {$binsizevar == "Large"} {system "Forthmacs:risc_os.bin.run.fForth $file"}
  91.   if {$binsizevar == "Small"} {system "Forthmacs:risc_os.bin.run.sfForth $file"}
  92. }
  93.  
  94. proc clickproc {button}\
  95. { if {$button == "s"} {system "Filer_OpenDir <Forthmacs\$Dir>"}
  96.   if {$button == "a"} {runforth risc_os.auto}
  97. }
  98.  
  99. proc showfile {fname}\
  100. { global line fid win
  101.     set fid [open $fname]
  102.     w_text win$win create -title $fname -width 1200.OS -size 13p
  103.     w_text win$win options -l.1i
  104.     while {![eof $fid]} { set line [gets $fid]; w_text win$win print $line}
  105.     close $fid; w_text win$win open; incr win
  106. }
  107.  
  108. proc makelicence {name date}\
  109. {  global fid
  110.    system "Copy Forthmacs:private.licence <Forthmacs\$Dir>.private.licence+ ~V~CFD"
  111.    set fid [open <Forthmacs\$Dir>.private.licence w];puts $fid $name;close $fid
  112.    update-archive WorkDiscR $date
  113.    system "Copy Forthmacs:private.licence+ <Forthmacs\$Dir>.private.licence ~V~CFD"
  114. }
  115.  
  116. proc search {name}\
  117. {  system "set tmp\$word $name"
  118.    system "set Forthmacsdocstyle ASCII"
  119.    system "Forthmacs:risc_os.bin.search"
  120.    showfile "Forthmacs:docs.html.searchfile"
  121.    system "unset Forthmacsdocstyle"
  122. }
  123.