home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol285 / makeclip.prg < prev    next >
Encoding:
Text File  |  1986-12-22  |  21.0 KB  |  731 lines

  1. **    Last revision: June 14, 1986 at 7:53
  2.  
  3. **    Revised by H.M. Van Tassell to write LINKEM.LNK file
  4.  
  5. *******************************************************************************
  6. * Name       COMPILE.prg
  7. * Date       January 29, 1986
  8. * Author     Stephen Straley
  9. * Note       This program will check the directory for files, and write
  10. *            CLIP files accordingly as well as the batch file for the
  11. *            compile
  12. *
  13. *******************************************************************************
  14.  
  15.  
  16. SET SCOREBOARD OFF
  17. scrframe  = "╔═╗║╝═╚║ "
  18. scrbar    = "╠" + REPLICATE("═",78) + "╣"
  19. scrlin    = "║"
  20. STORE SPACE(4096) TO scr_page1, scr_page2
  21.  
  22. DO Scrinit
  23. DO Input_it
  24. CLOSE DATABASES
  25. DO Port_it1
  26. CLOSE DATABASES
  27. DO Port_it2
  28. CLOSE DATABASES
  29. DO Port_it3
  30. CLOSE DATABASES
  31. DO Choice
  32. DO Exiting
  33.  
  34.  
  35. PROCEDURE Scrinit
  36.  
  37.    CLEAR
  38.    @ 0,0,20,79 BOX SUBSTR(scrframe,1,8)
  39.    @ 4,0 SAY scrbar
  40.    FOR x = 1 TO 3
  41.       @ x,1 SAY REPLICATE("█",78)
  42.    NEXT
  43.    @ 1,5 SAY " MAKECLiP "
  44.    @ 1,75 - LEN(" Version 1.10 ") SAY " Version 1.10 "
  45.    @ 3,40 - LEN(" The Clipper Utility Program - Main Menu ")/2 SAY " The Clipper Utility Program - Main Menu "
  46.    CALL _scrsave WITH scr_page1
  47.    @ 10,5 SAY "The follow program was designed to make Clip Files out of all available"
  48.    @ 12,5 SAY "program, format,  and procedure files  available to the  program on the"
  49.    @ 14,5 SAY "registered directory/drive.   If you are unsure what CLiP files are  or"
  50.    @ 16,5 SAY "to their purpose, please strike  FUNCTION KEY 1 (F1) for a description."
  51.    STORE "Y" TO continue
  52.    @ 18,25 SAY "Would you like to continue? " GET continue PICT "!" VALID(continue $"YN")
  53.    READ
  54.    IF continue = "N"
  55.       @ 23,0 SAY ""
  56.       QUIT
  57.    ENDIF
  58.    
  59. PROCEDURE Input_it
  60.  
  61. * This routine will take a directory of all PRG, PRC, and FMT files on disk
  62.  
  63. @ 0,0 CLEAR
  64. @ 4,0,20,79 BOX SUBSTR(scrframe,1,8)
  65. CALL _scrsave WITH scr_page2
  66. @ 10,10 SAY ""
  67. ?? "Reading Disk Information"
  68. @ 11,10 SAY ""
  69. IF .NOT. FILE("*.PRG")
  70.    ?? "There are no Program Files Available on drive"
  71. ELSE
  72.    RUN DIR *.PRG > CAPTURE.TXT
  73. ENDIF
  74. @ 12,10 SAY ""
  75. IF .NOT. FILE("*.PRC")
  76.    ?? "There are no Procedure Files Available on drive"
  77. ELSE
  78.    RUN DIR *.PRC >>CAPTURE.TXT
  79. ENDIF
  80. @ 13,10 SAY ""
  81. IF .NOT. FILE("*.FMT")
  82.    ?? "There are no Format Files Avilable on drive"
  83. ELSE
  84.    RUN DIR *.FMT >>CAPTURE.TXT
  85. ENDIF
  86.  
  87. PROCEDURE Port_it1
  88.  
  89. * This procedure will take the captured file and port it into a raw data
  90. * base.
  91.  
  92. CREATE Template
  93. USE Template
  94. APPEND BLANK
  95. REPLACE field_name WITH "TEMP", field_type WITH "C", field_len WITH 80
  96. USE
  97. CREATE Port1 FROM Template
  98. ERASE Template
  99. USE Port1
  100. APPEND FROM Capture.txt SDF
  101. USE
  102.  
  103. PROCEDURE Port_it2
  104.  
  105. * This procedure take the ported database in PORT1.DBF and sorts it into
  106. * a secondary database by root file name, extention, and if it is going to
  107. * be a major file (a file at the head of a CLIP file.
  108.  
  109. CREATE Template
  110. USE Template
  111. APPEND BLANK
  112. REPLACE field_name WITH "ROOT", field_type WITH "C", field_len WITH 8
  113. APPEND BLANK
  114. REPLACE field_name WITH "EXT", field_type WITH "C", field_len WITH 3
  115. APPEND BLANK
  116. REPLACE field_name WITH "MAJOR", field_type WITH "L", field_len WITH 1
  117. USE
  118. CREATE Port2 FROM Template
  119. ERASE Template
  120.  
  121.  
  122. PROCEDURE Port_it3
  123.  
  124. * This will port between the two files....
  125. *
  126.  
  127. SELECT 2
  128. USE Port2
  129. SELECT 1
  130. USE Port1
  131. DO WHILE .NOT. EOF()
  132.    IF SUBSTR(temp,1,1) # " "
  133.       SELECT 2
  134.       APPEND BLANK
  135.       REPLACE root  WITH SUBSTR(A->temp,1,8)
  136.       REPLACE ext   WITH SUBSTR(A->temp,10,3)
  137.       REPLACE major WITH .F.
  138.       SELECT 1
  139.    ENDIF
  140.    SKIP
  141. ENDDO
  142.  
  143. PROCEDURE Choice
  144.  
  145. CALL _scrrest WITH scr_page1
  146. STORE "Y" TO input
  147. @ 10,15 SAY "Would you like to compile every file seperately? " GET input PICT "!" VALID(input $"YN")
  148. READ
  149. IF input = "Y"
  150.    DO Seperate
  151. ELSE
  152.    DO Indiv
  153. ENDIF
  154.  
  155.  
  156.  
  157. PROCEDURE Indiv
  158.  
  159. SELECT 1
  160. USE Port2
  161. COPY STRUCTURE TO Port4
  162. screen_no = 0
  163. SET MESSAGE TO 22
  164. DO WHILE screen_no >= 0
  165.    CALL _scrrest WITH scr_page1
  166.    position = RECNO()
  167.    down      = 6
  168.    over      = 5
  169.    option    = 1
  170.    count     = 1
  171.    ending    = LASTREC()
  172.    IF EOF()
  173.       DO Exiting
  174.    ENDIF
  175.    DO WHILE count <= 30
  176.       DO CASE
  177.       CASE ext = "PRG"
  178.          info = "This is a Program File"
  179.       CASE ext = "PRC"
  180.          info = "This is a Procedure File"
  181.       OTHERWISE
  182.          info = "This is a Format File"
  183.       ENDCASE
  184.       IF DELETED()
  185.          info = info + " --- FILE ALREADY SELECTED/USED"
  186.       ENDIF
  187.       info = SPACE(5) + info
  188.       @ down, over PROMPT root MESSAGE CENTRING(info)
  189.       over = over + 15
  190.       IF over > 70
  191.          down = down + 2
  192.          over = 5
  193.       ENDIF
  194.       count = count + 1
  195.       SKIP
  196.       IF EOF()
  197.          EXIT
  198.       ENDIF
  199.    ENDDO
  200.    @ down, over PROMPT "Write File" MESSAGE CENTRING("Selected FIles will be now written")
  201.    over = over + 15
  202.    IF over > 70
  203.       down = down + 2
  204.       over = 5
  205.    ENDIF
  206.    IF RECNO() < ending
  207.       @ down, over PROMPT "Next Screen" MESSAGE SPACE(78)
  208.    ENDIF
  209.  
  210.    SET KEY -1 TO Review
  211.    SET KEY 24 TO Downprmt
  212.    SET KEY  5 TO Upprmt
  213.       
  214.    MENU TO option
  215.  
  216.    SET KEY -1 TO
  217.    SET KEY 24 TO
  218.    SET KEY  5 TO
  219.  
  220.    DO CASE
  221.    CASE option = 0
  222.       screen_no = screen_no - 1
  223.       IF screen_no >= 0
  224.          GO position
  225.          SKIP - 30
  226.       ENDIF
  227.    CASE option = 32
  228.       screen_no = screen_no + 1
  229.       count = 1
  230.       CALL _scrrest WITH scr_page1
  231.    CASE option = count
  232.       DO Writfile
  233.       screen_no = 0
  234.    OTHERWISE
  235.       GO (screen_no * 30 + option)
  236.       IF DELETED()
  237.          RECALL
  238.       ELSE
  239.          DELETE
  240.       ENDIF
  241.       GO position
  242.       count = 1
  243.    ENDCASE
  244. ENDDO
  245.  
  246. PROCEDURE Writfile
  247.  
  248.    SET FILTER TO DELETED()
  249.    GO TOP
  250.    rec_count = 0
  251.    DO WHILE .NOT. EOF()
  252.       rec_count = rec_count + 1
  253.       SKIP
  254.    ENDDO
  255.    IF rec_count > 32 .OR. rec_count = 0
  256.       IF rec_count > 32
  257.          a_mess = LTRIM(STR(rec_count)) + " is too many files in a CLIP file.  Unselect " + LTRIM(STR(32 - rec_count)) + " files. "
  258.       ELSE
  259.          a_mess = "An empty file can not be written.  Any Key to Continue.."
  260.       ENDIF
  261.       @ 22,0 SAY CENTRING(a_mess)
  262.       qw = INKEY(0)
  263.       SET FILTER TO
  264.       GO TOP
  265.       RETURN
  266.    ENDIF
  267.    COPY TO Port3
  268.    STORE .F. TO Abort_it
  269.    DO Outfile
  270.    IF Abort_it
  271.       RETURN
  272.    ENDIF
  273.    USE Port2
  274.    PACK
  275.    GO TOP
  276.  
  277. PROCEDURE Outfile
  278.  
  279.    option = 0
  280.    down_out = 6
  281.    over_out = 5
  282.    USE Port3
  283.    CALL _scrrest WITH scr_page1
  284.    @ 3,1 SAY REPLICATE("█",78)
  285.    @ 3,26 SAY "CLIP File Selection Menu"
  286.    DO WHILE .NOT. EOF()
  287.       visual = TRIM(root) + "." + ext
  288.       @ down_out, over_out PROMPT visual
  289.       over_out = over_out + 15
  290.       IF over_out > 70
  291.          down_out = down_out + 2
  292.          over_out = 5
  293.       ENDIF
  294.       SKIP
  295.    ENDDO
  296.    MENU TO option
  297.    IF option = 0
  298.       STORE .T. TO Abort_it
  299.       RETURN
  300.    ENDIF
  301.    GO option
  302.    REPLACE major WITH .T.
  303.    DO Finalout
  304.  
  305. PROCEDURE Finalout
  306.  
  307.    LOCATE FOR major = .T.
  308.    outfile = TRIM(root) + ".CLP"
  309.    SET ALTERNATE TO &outfile
  310.    @ 11,20,14,60 BOX scrframe
  311.    @ 12,21 SAY SUBSTR(CENTRING("Now creating " + outfile),21,38)
  312.    @ 13,21 SAY SUBSTR(CENTRING(" Listing " + TRIM(root) + "." + ext),21,38)
  313.    SET CONSOLE OFF
  314.    SET ALTERNATE ON
  315.    ? TRIM(root)
  316.    SET ALTERNATE OFF
  317.    SET CONSOLE OFF
  318.    GO TOP
  319.    DO WHILE .NOT. EOF()
  320.       IF .NOT. major
  321.          @ 13,21 SAY SUBSTR(CENTRING(" Listing " + TRIM(root) + "." + ext),21,38)
  322.          SET CONSOLE OFF
  323.          SET ALTERNATE ON
  324.          ? TRIM(root)
  325.          SET ALTERNATE OFF
  326.          SET CONSOLE OFF
  327.       ENDIF
  328.       IF ext = "PRC" .OR. ext = "FMT"
  329.          ths_is_in = TRIM(root) + "." + ext
  330.          ths_is_out = TRIM(root) + ".PRG"
  331.          RENAME &ths_is_in. TO &ths_is_out
  332.       ENDIF
  333.       SKIP
  334.    ENDDO
  335.    GO option
  336.    SELECT 2
  337.    USE Port4
  338.    APPEND BLANK
  339.    REPLACE root WITH A->root, ext WITH A->ext, major WITH A->major
  340.    SELECT 1
  341.    ZAP
  342.  
  343. PROCEDURE Seperate
  344.  
  345. USE Port2
  346. REPLACE ALL major WITH .T.
  347. @ 12,01 SAY SUBSTR(CENTRING("Manipulating Data FIle for Output"),1,78)
  348. COPY TO Port4
  349. GO TOP
  350. SET CONSOLE OFF
  351. DO WHILE .NOT. EOF()
  352.    outfile = TRIM(root) + ".CLP"
  353.    a_mess = "Now working with " + TRIM(root) + "." + ext
  354.    @ 12,01 SAY SUBSTR(CENTRING(a_mess),1,78)
  355.    SET ALTERNATE TO &outfile
  356.    SET ALTERNATE ON
  357.    ? root
  358.    SET ALTERNATE OFF
  359.    CLOSE ALTERNATE
  360.    SKIP
  361.    @ 12,20 SAY SPACE(40)
  362. ENDDO
  363. SET CONSOLE ON
  364.  
  365.  
  366.  
  367. PROCEDURE Exiting
  368.  
  369. CLOSE DATABASES
  370. CALL _scrrest WITH scr_page1
  371. batch = "CLIPALL"
  372. STORE "Y" TO input, ynput
  373. @ 10,15 SAY "Would you like a BATCH file to compile your CLP files? " GET input PICT "!" VALID(input $"YN")
  374. READ
  375. @ 10,15 SAY SPACE(60)
  376. IF input = "Y"
  377.    @ 10,15 SAY "Would you like to PAUSE between every compile? " GET ynput PICT "!" VALID(ynput $"YN")
  378.    READ
  379.    @ 10,15 SAY SPACE(60)
  380.    a_batch = SPACE(8)
  381.    @ 10,15 SAY "Enter desired name of batch file: " GET a_batch PICT "!!!!!!!!"
  382.    READ
  383.    IF LEN(TRIM(a_batch)) <> 0
  384.      batch = TRIM(a_batch)
  385.    ENDIF
  386.    USE Port4
  387.    GO TOP
  388.    outfile = batch +".BAT"
  389.    @ 10,01 SAY SUBSTR(CENTRING("Now Writing " + outfile + " file."),1,78)
  390.    SET ALTERNATE TO &outfile
  391.    SET CONSOLE OFF
  392.    DO WHILE .NOT. EOF()
  393.       a_mess = "Now Writing for Clipper @" + TRIM(root)
  394.       @ 12,1 SAY SUBSTR(CENTRING(a_mess),1,78)
  395.       SET ALTERNATE ON
  396.       ? "CLS"
  397.       ? "CLIPPER @" + TRIM(root)
  398.       IF ynput = "Y"
  399.          ? "PAUSE"
  400.       ENDIF
  401.       SET ALTERNATE OFF
  402.       SKIP
  403.    ENDDO
  404.    CLOSE ALTERNATE
  405.    @ 10,1 SAY SPACE(78)
  406.    @ 12,1 SAY SPACE(78)
  407.    b_mess = "Run Batch File, "
  408. ELSE
  409.    b_mess = "Compile CLiP Files, "
  410. ENDIF
  411.  
  412. **  add section to write a LNK file *******
  413.  
  414. USE Port4
  415. GO TOP
  416. @ 10,1 SAY SPACE(78)
  417. @ 12,1 SAY SPACE(78)
  418. outfile = batch +".LNK"
  419. @ 10,01 SAY SUBSTR(CENTRING("Now Writing the "+ outfile + " file."),1,78)
  420. SET ALTERNATE TO &outfile
  421. SET CONSOLE OFF
  422. SET ALTERNATE ON
  423. ? "ERROR: you MUST restructure this link file..."
  424. ? "The main module must be the first one in the file"
  425. ? "See the PLINK86 section of the manual for overlay information"
  426. SET ALTERNATE OFF
  427. DO WHILE .NOT. EOF()
  428.    a_mess = "Now Writing for FI" + TRIM(root)
  429.    @ 12,1 SAY SUBSTR(CENTRING(a_mess),1,78)
  430.    SET ALTERNATE ON
  431.    ? "FI " + TRIM(root)
  432.    SET ALTERNATE OFF
  433.    SKIP
  434. ENDDO
  435. SET ALTERNATE ON
  436. ? "LIB Clipper" 
  437. SET ALTERNATE OFF
  438. CLOSE ALTERNATE
  439. @ 10,1 SAY SPACE(78)
  440. @ 12,1 SAY SPACE(78)
  441.  
  442. ** end of LNK section *******
  443.  
  444. a_mess = b_mess + "then revise '" + batch + ".LNK' to determine Link Structure"
  445. @ 11,1 SAY SUBSTR(CENTRING(a_mess),1,78)
  446. @ 13,1 SAY SUBSTR(CENTRING("Thank you for running MAKECLiP."),1,78)
  447. ERASE Capture.txt
  448. ERASE Template.dbf
  449. ERASE Port1.dbf
  450. ERASE Port2.dbf
  451. IF FILE("Port3.dbf")
  452.    ERASE Port3.dbf
  453. ENDIF
  454. @ 23,00 SAY ""
  455. QUIT            
  456.    
  457. PROCEDURE Review
  458. PARAMETER p, l, v
  459.    
  460.    SAVE SCREEN
  461.    CALL _scrrest WITH scr_page2
  462.    down_rev = 6
  463.    over_rev = 5
  464.    SET FILTER TO DELETED()
  465.    GO TOP
  466.    DO WHILE .NOT. EOF()
  467.       @ down_rev, over_rev SAY root
  468.       over_rev = over_rev + 15
  469.       IF over_rev > 70
  470.          down_rev = down_rev + 2
  471.          over_rev = 5
  472.       ENDIF
  473.       SKIP
  474.    ENDDO
  475.    a_mess = "All Files Listed.  Any Key to Return to Main Menu"
  476.    @ 22,00 SAY CENTRING(a_mess)
  477.    qw = INKEY(0)
  478.    SET FILTER TO
  479.    GO position
  480.    RESTORE SCREEN
  481.  
  482. PROCEDURE Help
  483.  
  484.    PARAMETERS aa, bb, cc
  485.  
  486.    SAVE SCREEN
  487.    DO CASE
  488.    CASE aa = "SCRINIT"
  489.       @ 0,0 CLEAR
  490.       TEXT
  491. CLIP FILES ... are text files with .CLP extentions.  Inside of these text files
  492.      are the names of the programs we wish to compile, either individually or
  493.      in a group of files.  Consider the following file layout.
  494.  
  495.                                 GL.prg
  496.                                   ║
  497.                        ╔══════════╩═══════════╗
  498.                        ║                      ║
  499.                   GLMENU.prg            GLUTILITY.prg
  500.                        ║                      ║
  501.                        ║           ╔══════════╩══════════╗
  502.                        ║      BACKUP.prg              RESTORE.prg
  503.                        ║
  504.     ╔══════════════════╬══════════════════════╦═══════════════════════╗
  505.     ║                  ║                      ║                       ║
  506.  GLCOA.prg         GLTRANS.prg           GLSORT.prg             GLLIST.prg
  507.     ║                  ║                      ║
  508. GLCOA_1.prg         ENTER.prg            SORT_1.prg
  509.     ║                  ║ 
  510. GLCOA_2.prg          EDIT.prg
  511.                        ║
  512.                     DELETE.prg      (Any Key to Continue...or Q to Quit)
  513. ENDTEXT
  514. qw = INKEY(0)
  515. IF qw = ASC("Q") .OR. qw = ASC("q")
  516.    RESTORE SCREEN
  517.    RETURN
  518. ENDIF
  519. @ 0,0 CLEAR
  520. @ 0,00 SAY "CLIP FILES"
  521. @ 2,00 SAY CENTRING("In the previous listed structure, GL.prg calls both GLMENU.prg and")
  522. @ 4,00 SAY CENTRING("GLUTILITY.prg, which in turn call their respective sub-routines.  Now let's")
  523. @ 6,00 SAY CENTRING("say you tried compiling this application by starting everything off with")
  524. @ 8,30 SAY "C>"
  525. @ ROW(),COL() SAY "C"
  526.   qw = INKEY(.5)
  527. @ ROW(),COL() SAY "L"
  528.   qw = INKEY(.5)
  529. @ ROW(),COL() SAY "I"
  530.   qw = INKEY(.5)
  531. @ ROW(),COL() SAY "P"
  532.   qw = INKEY(.5)
  533. @ ROW(),COL() SAY "P"
  534.   qw = INKEY(.5)
  535. @ ROW(),COL() SAY "E"
  536.   qw = INKEY(.5)
  537. @ ROW(),COL() SAY "R"
  538.   qw = INKEY(.5)
  539. @ ROW(),COL()+1 SAY "G"
  540.   qw = INKEY(.5)
  541. @ ROW(),COL() SAY "L"
  542.   qw = INKEY(.5)
  543. @ 10,00 SAY CENTRING("From this, one at a time, each program(sub-routine) would be called in and")
  544. @ 12,00 SAY CENTRING("compiled.  Eventually, your screen may look like this...")
  545. @ 14,00 SAY "Compiling GL.PRG      "
  546. DO Counting WITH 150
  547. @ 15,00 SAY "Compiling GLMENU.PRG  "
  548. DO Counting WITH 76
  549. @ 16,00 SAY "Compiling GLUTILTY.PRG"
  550. DO Counting WITH 252
  551. @ 17,00 SAY "Compiling GLCOA.PRG   "
  552. DO Counting WITH 56
  553. @ 18,00 SAY "Compiling GLCOA_1.PRG "
  554. DO Counting WITH 32
  555. @ 19,00 SAY "Compiling GLCOA_2.PRG "
  556. DO Counting WITH 89
  557. @ 20,00 SAY "Compiling GLTRANS.PRG "
  558. DO Counting WITH 162
  559. @ 21,00 SAY "Compiling ENTER.PRG   "
  560. DO Counting WITH 52
  561. @ 22,00 SAY "Too Many Constants           Press Any Key for Next Screen or 'Q' to Quit..."
  562. qw = INKEY(0)
  563. IF qw = ASC("Q") .OR. qw = ASC("q")
  564.    RESTORE SCREEN
  565.    RETURN
  566. ENDIF
  567. @ 0,0 CLEAR
  568. TEXT
  569. CLIP FILES
  570.  
  571.     At this point in the compiling process, the compiler is informing us that
  572. too much is being compiled at this time.  Technically speaking, the compiler
  573. establishes a point of reference in a special table for every constant ("STORE
  574. 0.00 TO a, STORE 1 TO b, etc...).  Once this special table is full, the
  575. compiler can not compile any more souce code during this particular pass.
  576.  
  577. From this point on, every line of the program, and following programs, would 
  578. produce the same error and bogus object code.   The solution is to break up the
  579. amount of code the compiler has to see at one time.  To do this, you have to
  580. use CLIP files.  CLIP files are also necessary in preparing your application
  581. to be broken up for overlays.
  582.  
  583. CLIP files are no more than ordinary text files with a .CLP extention.  Inside
  584. of a CLIP file, place the name of the program you wish to compile exclusively.
  585. No matter if a program calls another program (sub-routine), only those programs
  586. listed in the CLIP file will be compiled together making a single .OBJ file.
  587. CLIP files may contain just one name of a program, or an entire group.  Making
  588. the right decision is difficult when it pertains to overlays.  This program
  589. will help deciper that for you.   So now, back to the example.  Let us make 3
  590. unique .CLP files.     Any Key to Continue or 'Q' to Quit..."
  591. ENDTEXT
  592. qw = INKEY(0)
  593. IF qw = ASC("Q") .OR. qw = ASC("q")
  594.    RESTORE SCREEN
  595.    RETURN
  596. ENDIF
  597. @ 0,0 CLEAR
  598. TEXT
  599. CLIP FILES
  600.  
  601.    Inside of GL.CLP, list the following programs:        GL
  602.                                                          GLMENU
  603.                                                          GLUTILTY
  604.                                                          BACKUP
  605.                                                          RESTORE
  606.    Inside of GLCOA.CLP, list the following programs:     GLCOA
  607.                                                          GLCOA_1
  608.                                                          GLCOA_2
  609.                                                          GLTRANS
  610.                                                          ENTER
  611.                                                          EDIT
  612.                                                          DELETE
  613.    Inside of FINAL.CLP, list the following programs:     GLSORT
  614.                                                          GLSORT_1
  615.                                                          GLLIST
  616.  
  617.  
  618. So now there are an additional 3 files on your directory with the names of the
  619. programs we wish to compile. 
  620.                                     Any Key to Continue or 'Q' to Quit
  621. ENDTEXT
  622. qw = INKEY(0)
  623. IF qw = ASC("Q") .OR. qw = ASC("q")
  624.    RESTORE SCREEN
  625.    RETURN
  626. ENDIF
  627. @ 0,0 CLEAR
  628. TEXT
  629. CLIP Files
  630.  
  631.    Now compile each CLIP file in the following manner:
  632.  
  633.               C>CLIPPER @GL
  634.               C>CLIPPER @GLCOA
  635.               C>CLIPPER @FINAL
  636.  
  637.    The results would be three seperate .OBJ files with the names of the
  638. associated .CLP files.  So now on the disk there would be three new files
  639. created after the three compiles:
  640.  
  641.               GL.OBJ
  642.               GLCOA.OBJ
  643.               FINAL.OBJ
  644.  
  645. Notice that no matter what is being compiled inside of the .CLP files, the name
  646. of the CLIP file can be anything.  Keep in mind that the compiler will take the
  647. name of the CLIP file and use that as the name of the .OBJ file.  In this
  648. example, the last .CLP file is called FINAL.CLP for a good reason.
  649.  
  650.                            Any Key to Continue or 'Q' to Quit...
  651. ENDTEXT
  652. qw = INKEY(0)
  653. IF qw = ASC("Q") .OR. qw = ASC("q")
  654.    RESTORE SCREEN
  655.    RETURN
  656. ENDIF
  657. @ 0,0 CLEAR
  658. TEXT
  659. CLIP Files
  660.  
  661.     Sometimes, we compile code which has problems in it, and these problems 
  662. may not surface until we try to run our application.    It can be frustrating
  663. to change one or two lines of cone in, let's say for example, GLLIST.prg.  For
  664. once we have made the necessary changes, we would have to re-compile and re-
  665. link our application together.  By using CLIP files, we can isolate code which
  666. is "clean" from that which we are still trying to finish.  In this example, all
  667. we would have to do once we changed the desired lines of code in GLLIST.PRG is
  668. to re-compile the FINAL.CLP file by itself, and then to link it with the 
  669. remaining two files previously compiled.  This method is very helpful in saving
  670. time and energy when trying to get an application up and running.
  671.  
  672.    Finally, CLIP files are the only method in which to break up program,
  673. procedure, and format files into logical sections for an overlay scheme.  The
  674. linker which comes with Clipper does not automatically figure out the best
  675. overlay scheme for you system.  It can't.  Consider your system.  Is it the
  676. same exact system for your clients/customers.  Probably not.  Therefore it is
  677. up to you to logically break up the programs into seperate/grouped compile and
  678. from that, to link them together in an order best suited for your environment.
  679.  
  680.                                         Any Key to Continue ...
  681. ENDTEXT
  682.    CASE aa = "CHOICE"
  683.       @ 0,0 SAY CENTRING("If you want to compile each and every PRG, FMT, and PRC file available")
  684.       @ 1,0 SAY CENTRING("to be compiled individually (seperated and placed in  individual  CLIP")
  685.       @ 2,0 SAY CENTRING("files, then answer 'Y' to this question.   Otherwise, you  may  choose")
  686.       @ 3,0 SAY CENTRING("selectively which files to compile together.  Any Key to Continue...")
  687.    CASE aa = "OUTFILE"
  688.       @ 0,0 SAY CENTRING("The below listed files were chosen to be compiled together.  Please now")
  689.       @ 1,0 SAY CENTRING("select which file wile head the list of the compile.  This  means  that")
  690.       @ 2,0 SAY CENTRING("that the name of the CLIP file  wil take the name of  the first file in")
  691.       @ 3,0 SAY CENTRING("the list.  RETURN for selected file; ESC key for first in list.")
  692.    OTHERWISE
  693.       @ 0,0 SAY CENTRING("To choose a file to join a list, move the cursor key to that file name")
  694.       @ 1,0 SAY CENTRING("and strike the RETURN key.  To move to a previous menu, strike the ESC")
  695.       @ 2,0 SAY CENTRING("key.  If there is no previous screen, the ESC key will return  to  the")
  696.       @ 3,0 SAY CENTRING("DOS prompt.    Any Key to Return...")
  697.    ENDCASE
  698.    qw = INKEY(0)
  699.    RESTORE SCREEN
  700.  
  701. PROCEDURE Counting
  702.    
  703.    PARAMETER end_count
  704.  
  705.    posit = ROW()+1
  706.    FOR qw = 1 TO end_count
  707.      @ posit,00 SAY "Line " + LTRIM(STR(qw))
  708.    NEXT
  709.  
  710. PROCEDURE Downprmt
  711.  
  712.    PARAMETER p, l, v
  713.  
  714.    KEYBOARD REPLICATE(CHR(4),5)
  715.  
  716. PROCEDURE Upprmt
  717.  
  718.    PARAMETER p, l, v
  719.  
  720.    KEYBOARD REPLICATE(CHR(19),5)
  721.  
  722. FUNCTION Centring
  723.  
  724.    PARAMETER string
  725.  
  726.    temp = (80 - LEN(string))/2
  727.    RETURN(SPACE(temp) + string + SPACE(temp))
  728.  
  729.  
  730.                                                                                                         
  731.