home *** CD-ROM | disk | FTP | other *** search
/ Czech Crown / Koruna-Ceska.bin / utility / codewr / basic.cwl < prev    next >
Encoding:
Text File  |  1994-01-04  |  5.8 KB  |  366 lines

  1. batch BASICINIT:
  2.     let include = d:\bc\inc
  3.     let exe = f:\program.exe
  4.     return
  5.  
  6. batch H:
  7. menu Tech help !:
  8.     cp d:\th
  9.     help
  10.     end
  11. batch B:
  12. menu Binary editor by TRC:
  13.     bed
  14.     end
  15. batch S:
  16. menu NO debug info:
  17.     for i 11 99
  18.         touch $i
  19.     loop
  20. batch E:
  21.     let debug = 0
  22.     end
  23. batch A:
  24. menu Debug info ON:
  25.     let debug = 1
  26.     end
  27.  
  28. batch D:
  29.     cp f:\
  30.     d:\bc\bin\td386 -VP -VG $exe $cmdline
  31.     errexit
  32.     end
  33.  
  34. batch R:
  35. batch run
  36.     $exe $cmdline
  37.     errexit
  38.     end
  39.  
  40. batch F:
  41. menu Profiler:
  42.     cp f:\
  43.     d:\bc\bin\tf386 -VP -VG $exe
  44.     errexit
  45.     end
  46.  
  47. batch N:
  48. menu COMMAND.COM:
  49.     command
  50.     end
  51. menu Borland C++ IDE:
  52.     cp d:\bc\bin
  53.     bc
  54.     return
  55. batch M:
  56.     mem
  57.     pause
  58.     end
  59. batch T:
  60.     for i 11 99
  61.         touch $i
  62.     loop
  63.     end
  64.  
  65. macro Y:
  66.     displayoff
  67.     t = 0
  68.     do
  69.         type " "
  70.         Backspace
  71.         a = fileno
  72.         Alt Right
  73.     loop while a <> fileno
  74.     restorepos
  75.     return
  76.  
  77. batch O:
  78.     c:\util\trc\colors
  79.     pause
  80.     end
  81.  
  82. batch C:
  83.     gosub compile
  84.     pause
  85.     gosub run
  86.     end
  87.  
  88. menu Print Clipboard
  89. batch P
  90.     `prntab 3
  91.     `copy c:\source\_prj\clipfile.cws prn:
  92.     return
  93.  
  94. batch Compile:
  95.  
  96.     echo ************* Building %exe **************
  97.     
  98.     create $0
  99.  
  100.     if not *objdir
  101.         let objdir = #exe
  102.     endif
  103.  
  104.     let link    = #objdir\llist.lnk
  105.     let compile = #objdir\clist.lst
  106.     let mustlink
  107.     let mustbcc
  108.     
  109.     create $compile
  110.     create $link
  111.  
  112.     append   $link   d:\bc\lib\c0$model.obj
  113.     if $debug = 1
  114.         appendln $compile -v
  115.     endif
  116.     appendln $compile -V -H -D$macro -C -Od
  117.     appendln $compile -I$include;#16
  118.     appendln $compile -K -O -Z -c -m$model -w -vi -n#objdir -H=F:\h.sym
  119.     appendln $compile $bccargs
  120.     if $ovy = 1
  121.         appendln $compile -Y
  122.     endif
  123.     appendln $compile
  124.  
  125.     for file
  126.         if &file = c or &file = cpp
  127.             if $file > #objdir\%file.obj
  128.                 echo %file
  129.                 if $ovy = 1
  130.                     add $compile -Yo $file -Yo-
  131.                 else
  132.                     add $compile $file
  133.                 endif
  134.                 let mustlink = 1
  135.                 let mustbcc = 1
  136.             endif
  137.             appendln  $link +
  138.             if $ovy = 1
  139.                 append $link /o #objdir\%file.obj /o-
  140.             else
  141.                 append $link #objdir\%file.obj
  142.             endif
  143.         elif &file = ca
  144.             if $file > #objdir\%file.obj
  145.                 echo %file
  146.                 add $compile $file
  147.                 let mustlink = 1
  148.                 let mustbcc = 1
  149.             endif
  150.             appendln  $link +
  151.             append $link #objdir\%file.obj
  152.         elif &file = asm
  153.             if $file > #objdir\%file.obj
  154.                 echo %file
  155.                 out1
  156.                 d:\bc\bin\tasm /m10 /mx $file,#objdir\%file.OBJ
  157.                 errexit
  158.                 stdout
  159.                 let mustlink = 1
  160.             endif
  161.             appendln  $link +
  162.             append    $link #objdir\%file.obj
  163.         elif &file = h
  164.             out1
  165.             if $mustbcc = 1
  166.                 echo --- BCC ---
  167.                 d:\bc\bin\bcc @$compile
  168.                 let mustbcc
  169.                 create $compile
  170.                 errexit
  171.             endif
  172.             if $debug = 1
  173.                 appendln $compile -v
  174.             endif
  175.             appendln $compile -V -H -D$macro -C -Od
  176.             appendln $compile -I$include;#file
  177.             appendln $compile -K -O -Z -c -m$model -w -vi -n#objdir -H=F:\h.sym
  178.             appendln $compile $bccargs
  179.             if $ovy = 1
  180.                 appendln $compile -Y
  181.             endif
  182.             appendln $compile
  183.             stdout
  184.         elif gosub compile_&file
  185.         else
  186.             if $file > #objdir\%file.obj
  187.                 echo %file
  188.                 d:\bc\bgi\bgiobj $file #objdir\%file.obj _%file
  189.                 let mustlink = 1
  190.             endif
  191.             appendln  $link +
  192.             append    $link #objdir\%file.obj
  193.         endif
  194.     loop
  195.     cp #objdir\
  196.     appendln $link
  197.     appendln $link $exe
  198.     appendln $link
  199.     for file
  200.         if $file . lib
  201.             appendln $link $file +
  202.         endif
  203.     loop
  204.     if $ovy = 1
  205.         appendln $link d:\bc\lib\overlay +
  206.     endif
  207.     if $math = 1
  208.         appendln $link d:\bc\lib\emu d:\bc\lib\math$model +
  209.     endif
  210.     appendln $link d:\bc\lib\c$model
  211.     out1
  212.     if $mustbcc = 1
  213.         echo --- BCC ---
  214.         d:\bc\bin\bcc @$compile
  215.         errexit
  216.     endif
  217.     if $mustlink = 1
  218.         stdout
  219.         echo --- LINK ---
  220.         `type $link
  221.         out1
  222.         if $debug = 1
  223.             d:\bc\bin\tlink /s /v /l /c @$link
  224.         else
  225.             d:\bc\bin\tlink /s /l /c @$link
  226.         endif
  227.         errexit
  228.     else
  229.         echo No files to compile or link (%exe actual)
  230.     endif
  231.     echo ------------------------------------
  232.     stdout
  233.     return
  234.     
  235.  
  236. edit fnt:
  237.     cp c:\util
  238.     c:\util\fdes
  239.     return
  240.  
  241. edit cgr:
  242.     c:\util\ced $file
  243.     return
  244.     
  245. edit lib:
  246.     echo Can't edit this type of file..
  247.     pause
  248.     return
  249.  
  250. macro testwarning:
  251.     displayoff
  252.     findstore
  253.     find$ = "Warning"
  254.     findglobal = 0
  255.     findword = 0
  256.     findcase = 0
  257.     _Warning$ = ""
  258.     if fileno then ^E
  259.     ^PageUp
  260.     if find then _Warning$ = "1"
  261.     Esc
  262.     findrestore
  263.     return
  264.  
  265. macro findstore:
  266.     f_f$ = find$
  267.     f_r$ = replace$
  268.     f_g  = findglobal
  269.     f_w  = findword
  270.     f_c  = findcase
  271.     return
  272.  
  273. macro findrestore:
  274.     find$      = f_f$
  275.     replace$   = f_r$
  276.     findglobal = f_g
  277.     findword   = f_w
  278.     findcase   = f_c
  279.     return
  280.  
  281. macro lines:
  282.     displayoff
  283.     setfile 16
  284.     t = 0
  285.     do
  286.         t = t + lastline
  287.         a = fileno
  288.         Alt Right
  289.     loop while a <> fileno
  290.     say "This project consists of", t, "lines"
  291.     restorepos
  292.     return
  293.  
  294. macro gotos:
  295.     displayoff
  296.     findstore
  297.     find$ = "goto"
  298.     findglobal = 0
  299.     findword = 1
  300.     findcase = 1
  301.     setfile 16
  302.     t = 0
  303.     do
  304.         ^PageUp
  305.         do while find
  306.             t = t + 1
  307.         loop
  308.         ^R
  309.         a = fileno
  310.         Alt Right
  311.     loop while a <> fileno
  312.     say "This project includes", t, "goto statements"
  313.     findrestore
  314.     restorepos
  315.     return
  316.  
  317. macro =F1.CPP:
  318. macro =F1.C:
  319.     findstore
  320.     displayoff
  321.     findglobal = 0
  322.     findword   = 1
  323.     findcase   = 1
  324.     ^Right
  325.     ^Left
  326.     a = column
  327.     b = a
  328.     do while ucase(line$(b)) >= "A" and ucase(line$(b)) <= "Z" or line$(b) = "_"
  329.         b = b + 1
  330.     loop
  331.     if a = b
  332.         a$ = line$(a)
  333.     elif a < b
  334.         a$ = line$(a to b - 1)
  335.     else
  336.         error "No identifier !"
  337.     endif
  338.     a$ = line$(a to b - 1)
  339.     return
  340.     displayon
  341.     setfile 15
  342.     text_lock = 1
  343.     text_tabsize = 3
  344.     a$ = findfirst$ _include$ + "\\*.H"
  345.     while a$ <> ""
  346.         loadfile a$
  347.         ^PageUp
  348.         exitif find
  349.     loop
  350.     Left
  351.     findrestore
  352.     return
  353.  
  354. macro ^f1.C:
  355. macro ^f1.CPP:
  356. macro ^f1.CA:
  357. macro ^f1.H:
  358. macro ^f1.HPP:
  359.     a = (70 - len line$) / 2
  360.     b = 70 - len line$ - a
  361.     if a < 0 or b < 0 then error "Remark too long"
  362.     line$ = "/*" + string$(a, "*") + " " + line$ + " " + string$(b, "*") + "*/"
  363.     home
  364.     return
  365.  
  366.