home *** CD-ROM | disk | FTP | other *** search
Text File | 1985-07-11 | 31.3 KB | 1,274 lines |
-
-
-
- NANTUCKET PRIVATE NETWORK
- -------------------------
- 1. INSTRUCTIONS AND MENU-MAP
- 2. REFERENCE NOTES
- 3. ANOMALIES
- 4. SAMPLE PROGRAMS
- 5. FUNCTION LIBRARY
- 6. MAIL
- 7. WHAT'S NEW
-
-
- Enter item number or Help 2
-
-
- CLIPPER REFERENCE NOTES
- -----------------------
- 1. Installation
- 2. HELP.PRG
- 3. PLINK86
- 4. Size of Clipper indexes
- 5. Numeric values for INKEY() and LASTKEY()
-
-
- Enter item number or Help 1
-
-
- FOUR INSTALLS
- -------------
- Each Clipper system disk may be installed four times to other
- media; twice to a hard disk and twice to floppies. Once this
- count is depleted, the uninstall procedure may be used to get
- these installs back on the system disk.
-
- Copying the disk will not make an executable copy of Clipper.
- The install procedure must be used. Never write to the original
- system disk. A write-protect tab cannot be placed on the disk
- during installation, however, because the install counter must be
- decremented.
-
- The CLIPCOPY procedure uses a DOS batch file to call the SUPERLoK
- install program. If for any reason the install not successful,
- the batch program will go ahead and execute the remaining
- commands in the file. It can be terminated at any time with a
- control-C. The batch file assumes that Clipper is being
- installed with the system disk in drive A:. If another drive is
- being used, the batch file must be edited to provide the new
- drive designator.
-
-
- INSTALLING TO A FLOPPY ON AN XT
- -------------------------------
- On page A-5, item 2, the manual describes installing to a floppy
- with a one drive system by entering "CLIPCOPY A: F". This works
- fine during the actual installation process, but when the batch
- file starts copying files, DOS returns the error message, "File
- cannot be copied onto itself". To avoid this, place the system
- disk in the drive and type "INSTALL". The installation program
- will prompt you for the product and target drives. Enter "A" for
- both. You will then be prompted at the appropriate times to
- switch disks.
-
-
- --End--
-
-
- CLIPPER REFERENCE NOTES
- -----------------------
- 1. Installation
- 2. HELP.PRG
- 3. PLINK86
- 4. Size of Clipper indexes
- 5. Numeric values for INKEY() and LASTKEY()
-
-
- Enter item number or Help 2
-
-
- HELP.PRG PARAMETERS
- -------------------
- Page 1-13 of the manual list the parameters passed to HELP.PRG
- incorrectly. There are 3 parameters passed not 2, and they are
- passed in the following order.
-
- 1. input_var - A character variable containing the name of
- the memory variable that is waiting for user input.
-
- 2. line_num - A numeric variable containing the source code
- line number of the program calling HELP.PRG.
-
- 3. call_prg - A character variable containing the name of
- the file calling HELP.PRG.
-
- These names are suggestions only. You may use any legal memory
- variable name. However, these parameters must be passed to your
- HELP.PRG.
-
- RECURSIVE CALLS
- ---------------
- Recursive calling of HELP.PRG can be avoided by inserting the
- following code at the top of HELP.PRG.
-
- IF call_prg = "HELP"
- RETURN
- ENDIF
-
-
- --End--
-
-
- CLIPPER REFERENCE NOTES
- -----------------------
- 1. Installation
- 2. HELP.PRG
- 3. PLINK86
- 4. Size of Clipper indexes
- 5. Numeric values for INKEY() and LASTKEY()
-
-
- Enter item number or Help 3
-
-
- OVERLAY MANAGEMENT
- ------------------
- Two classes of information are created by PLINK86 when creating
- overlays, a code class and a data class. Data is any constant
- information such as strings in quotes and memory variable names.
- The default operation of the linker places only the code class
- into overlays. The data class is added to the .EXE file. This
- data "overhead" makes it difficult to run large applications on
- 256K machines even with careful overlay planning.
-
- To place the data class into the overlay, use the following
- command in an .LNK file before the first "BEGIN" statement.
-
- OVERLAY NIL, $CONSTANTS
-
- Example 1 on page 2-9 could include this command.
-
- FILE MAIN
- LIB CLIPPER
- OVERLAY NIL, $CONSTANTS
- BEGIN
- SECTION FILE AR
- SECTION FILE AP
- SECTION FILE GL
- END
-
- Placed in a file called ACCOUNT.LNK, these commands would be
- submitted to the linker by entering the following at the DOS
- prompt.
-
- PLINK86 @ACCOUNT
-
- --End--
- 4
-
-
- CLIPPER REFERENCE NOTES
- -----------------------
- 1. Installation
- 2. HELP.PRG
- 3. PLINK86
- 4. Size of Clipper indexes
- 5. Numeric values for INKEY() and LASTKEY()
-
-
- Enter item number or Help
-
- INDEX SIZES
- -----------
- The following formulas can be used to calculate the size of an
- index created by Clipper.
-
- minimum # of index keys per page (Kmn):
-
- int((1012 - Kl) / (2 * Kl + 20)) where Kl = key length
-
- maximum # of index keys per page (Kmx):
-
- 2 * Kmn
-
- Minimum number of index pages: (Pmn)
-
- R / Kmx where R is No of records in
- the file
-
- If Pmn is not a whole number, Pmn is "rounded" to the next higher
- whole number.
-
- Maximum number of index pages: (Pmx)
-
- 2 * Pmn
-
- Minimum index size:
-
- (Pmn * 1024) + 1024 1024 is both the page size
- and the size of the .NTX
- header.
-
- Maximum index size:
-
- (Pmx * 1024) + 1024
-
- Notes:
-
- A "page" is simply the smallest whole division in an index. In
- clipper's scheme, the page size is 1024 bytes.
-
- The first equation is a simplified form of the actual size
- allocation formula used in the clipper compiler.
-
- The index "header" contains the information needed by your
- program to maintain the indeces.
-
- A good working size for each index is roughly 2/3 of the maximum
- size.
-
- --End--
- 5
-
-
- CLIPPER REFERENCE NOTES
- -----------------------
- 1. Installation
- 2. HELP.PRG
- 3. PLINK86
- 4. Size of Clipper indexes
- 5. Numeric values for INKEY() and LASTKEY()
-
-
- Enter item number or Help
-
- Numeric values returned from INKEY() and LASTKEY()
- --------------------------------------------------
-
- Special Keys Inkey Returns
- ------------ -------------
- F1 15104
- F2 15360
- F3 15616
- F4 15872
- F5 16128
- F6 16384
- F7 16640
- F8 16896
- F9 17152
- F10 17408
-
- Alt F1 26624
- Alt F2 26880
- Alt F3 27136
- Alt F4 27392
- Alt F5 27648
- Alt F6 27904
- Alt F7 28160
- Alt F8 28416
- Alt F9 28672
- Alt F10 28928
-
- Ctrl F1 24064
- Ctrl F2 24320
- Ctrl F3 24576
- Ctrl F4 27392
- Ctrl F5 25088
- Ctrl F6 25344
- Ctrl F7 25600
- Ctrl F8 25856
- Ctrl F9 26112
- Ctrl F10 26368
-
- Shift F1 21504
- Shift F2 21760
- Shift F3 22016
- Shift F4 22272
- Shift F5 25088
- Shift F6 22784
- Shift F7 23040
- Shift F8 25856
- Shift F9 23552
- Shift F10 17408
-
- End 20224
- Ctrl End 29952
- Enter 13
- Ctrl Enter 10
-
- Home 55
- Up Arrow 18432
- Down Arrow 20480
- Left Arrow 19712
- Right Arrow 19712
- Pg Dn 20736
- Pg Up 18688
-
- Ctrl Home 30464
- Ctrl Left Arrow 29440
- Ctrl Right Arrow 29696
- Ctrl Pg Dn 30208
- Ctrl Pg Up 33792
-
- Ctrl PrtSc 16
- Del 21248
- Esc 27
- Ins 20992
- Space Bar 32
- Tab 9
- Backspace 8
-
- All the the printable keys return their ASCII value.
-
- --End--
-
-
- CLIPPER REFERENCE NOTES
- -----------------------
- 1. Installation
- 2. HELP.PRG
- 3. PLINK86
- 4. Size of Clipper indexes
- 5. Numeric values for INKEY() and LASTKEY()
-
-
- Enter item number or Help p
-
-
- NANTUCKET PRIVATE NETWORK
- -------------------------
- 1. INSTRUCTIONS AND MENU-MAP
- 2. REFERENCE NOTES
- 3. ANOMALIES
- 4. SAMPLE PROGRAMS
- 5. FUNCTION LIBRARY
- 6. MAIL
- 7. WHAT'S NEW
-
-
- Enter item number or Help 2
-
-
- CLIPPER REFERENCE NOTES
- -----------------------
- 1. Installation
- 2. HELP.PRG
- 3. PLINK86
- 4. Size of Clipper indexes
- 5. Numeric values for INKEY() and LASTKEY()
-
-
- Enter item number or Help p
-
-
- NANTUCKET PRIVATE NETWORK
- -------------------------
- 1. INSTRUCTIONS AND MENU-MAP
- 2. REFERENCE NOTES
- 3. ANOMALIES
- 4. SAMPLE PROGRAMS
- 5. FUNCTION LIBRARY
- 6. MAIL
- 7. WHAT'S NEW
-
-
- Enter item number or Help 3
-
-
- ANOMALY REPORT - July 1, 1985
- -----------------------------
- >>> &<memvar>
-
- Using "&" in a character string causes a 5,5 error message
- (variable not found) if the macro symbol is not followed by a
- space. Inserting a space between the ampersand and the next word
- will not cause this error.
-
-
- >>> @ 24,<exp> SAY ...GET
-
- Writing to row 24 will cause the screen to scroll. To work
- around this anomaly, write the cursor to another row before
- completing the read. For example:
-
- @ 24,10 SAY "Enter data:" GET data
- @ 0,0
- READ
-
- To clear line 24 without scrolling, use the SPACE() function.
-
- @ 24,0 SAY SPACE(78)
-
-
- >>> @ <exp>,<exp> CLEAR
-
- This command should clear the lower right hand corner of the
- screen starting at the coordinates indicated. Instead, it clears
- the remainder of the current line and the entire rest of screen.
-
-
- >>> ALIAS
-
- dBASE III allows a memory variable with the same name as a field
- to be accessed by using the "M" alias.
-
- ? M->memvar
-
- The "M" alias is not supported under Clipper.
-
-
- >>> CLEAR ALL
-
- In addition to closing all open database files, releasing all
- memory variables, and selecting work area 1, CLEAR ALL will
- also clear the sereen.
-
-
- >>> COPY TO <filename> SDF
-
- Creating an SDF file with SET DELETED ON produces a corrupted
- file.
-
- Work-around:
-
- USE <filename>
- SET FILTER TO .NOT. DELETED()
- COPY TO <filename> SDF
-
-
-
- >>> CREATE <newfile> FROM <structure extended file>
-
- A structure extended file created by dBASE III will sometimes
- cause the computer to hang. Create a structure extended file
- under Clipper to solve the problem.
-
-
- >>> CTOD()
-
- The CTOD() function will return invalid data if the year portion
- of the date is 4 characters. For example;
-
- ? CTOD("09/19/1985")
-
- returns
-
- 00/0.//
-
-
- >>> Date type
-
- Adding 1 day to the next to the last day of any leap year will
- produce an invalid date. For example;
-
- mdate = CTOD("12/30/84")
- mnum = 0
- DO WHILE mnum < 3
- ? mdate + mnum
- mnum = mnum + 1
- ENDDO
-
- returns
-
- 12/30/84
- 00/30/85
- 01/01/85
-
- This works correctly in any year not a leap year.
-
-
- >>> INDEX ON <exp> TO <filename>
-
- Creating an index leaves EOF() true and the record pointer at one
- greater than the number of records in the file. If any
- sequential operation is performed on the file after the creation
- of an index, include the command GO TOP.
-
- INDEX ON <exp> TO <filename>
- GO TOP
- DO WHILE .NOT. EOF()
-
-
- >>> LOCATE FOR <condition>
-
- LOCATE with an empty file will hang the computer.
-
- Work-around:
- * Test for empty file...
- empty = EOF() .AND. BOF()
- IF .NOT. empty
- LOCATE FOR <condition>
- ENDIF
-
-
- >>> Multiple Indexes
-
- The PACK and REINDEX commands will only update the first index
- correctly if more than one is in use. To work around this
- problem, recreate the indexes individually after a PACK or
- REINDEX separately.
-
-
- >>> NOTE
-
- Not implemented. Use "*" to create comment lines.
-
-
- >>> PACK
-
- If the last record or group of records in a file are marked for
- deletion, the PACK command will not remove them from the file.
- Only those deleted records that precede a record not marked for
- deletion will be removed.
-
- Work-around 1.
-
- * This will leave one blank record at the end of the file.
- USE <filename>
- APPEND BLANK
- PACK
-
- Work-around 2.
-
- * This procedure saves a backup copy of the file.
- RENAME <filename>.DBF TO <filename>.OLD
- USE <filename>.OLD
- SET DELETED ON
- COPY TO <filename>
-
-
- >>> Programs created by MODIFY COMMAND
-
- Command files created or changed with MODIFY COMMAND may have a
- "wrap" if they exceed 67 characters per line. The Clipper
- compiler will not accept these lines.
-
- Work-around:
-
- Use the semi-colon as a line continuation character.
-
-
- >>> Reserved words
-
- "WRITE" seems to be a reserved word. Calling a procedure WRITE
- will produce a warning 11 when linking. Rename the procedure.
-
-
-
- >>> SELECT &<memvar>
-
- Using a macro to SELECT a work area returns an error code (5,5).
- To SELECT an area based on the contents of a memory variable, use
- a DO CASE structure.
-
- DO CASE
- CASE memvar = "ACCOUNTS"
- SELECT ACCOUNTS
- CASE memvar = "CLIENTS"
- SELECT CLIENTS
- ENDCASE
-
-
- >>> SET COLOR TO <standard>, [<enhanced>]
-
- Many applications use SET COLOR TO 0/0 to turn off the display
- from the keyboard for passwords. Clipper will not change the
- enhanced display with this syntax. The correct syntax is;
-
- SET COLOR TO 7+/0,0/0
-
- This will provide high intensity white on black for SAYs and
- black on black for GETs.
-
-
- >>> SET DEFAULT TO <drive>
-
- When using the following commands, Clipper searches the DOS
- default directory instead of the one defined with the SET DEFAULT
- command.
-
- FILE()
- RENAME
- COPY FILE <filename> TO <filename>
- DIR
- DELETE FILE <filename>
-
-
- >>> SET FORMAT TO <filename>
-
- If the same format file is used more than once in a program, the
- compiler returns "symbol redefinition error." This message can
- be ignored. It simply means that the format file has already
- been placed in a table of files to be compiled.
-
- --End--
-
-
- NANTUCKET PRIVATE NETWORK
- -------------------------
- 1. INSTRUCTIONS AND MENU-MAP
- 2. REFERENCE NOTES
- 3. ANOMALIES
- 4. SAMPLE PROGRAMS
- 5. FUNCTION LIBRARY
- 6. MAIL
- 7. WHAT'S NEW
-
-
- Enter item number or Help 4
-
- CLIPPER SAMPLE PROGRAMS
- -----------------------
- 1. Quit To Procedure
- 2. LIST . . . . . LIST any .DBF file
- 3. PRINTIT. . . . Print ascii files with header and page breaks.
-
-
- Enter item number or Help 1
-
-
- * Procedure: QTO.PRG
- * Author...: Barry Grant
- * Date.....: 05-29-85, modified 06-06-85 by Ray Love
- * Notes....: Based on a routine by Tom Rettig from the "Advanced
- * Programmer's Guide", copyright (c) 1985 Luis Castro,
- * Jay Hansen, and Tom Rettig. Published by Ashton-Tate.
- *
- * This program allows programs to call one another by starting
- * execution with a batch file then modifying that batch file to
- * call the next program. This is done by passing the name of the
- * next program to the procedure QUIT_TO. For example,
- *
- * DO Quit_to WITH next
- *
- * where the contents of next is the program to execute. The called
- * routines can return by using the same procedure. To exit the batch
- * file, pass "GOTO END" to QUIT_TO.
- *
- * * * * * * * * * * I M P O R T A N T * * * * * * * * * * * * * *
- * The length of the memory variable passed to QUIT_TO must always *
- * be 8 characters. The file pointer used by DOS must find the *
- * instruction GOTO START at the same location in the the batch *
- * file every time. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * Any memory variables that need to be passed may be SAVEd to a
- * .MEM file.
- *
- * This example uses the names START.BAT for the batch file and
- * MAIN.EXE for the intitial program to execute. The file START.BAT
- * contains the following:
- *
- * ECHO OFF
- * MAIN
- * GOTO START
- * :START
- * GOTO END
- * GOTO START
- * :END
- * ECHO ON
-
- PROCEDURE QUIT_TO
- PARAMETERS program
- SET ALTERNATE TO START.BAT
- SET ALTERNATE ON
- SET CONSOLE OFF
- ? "ECHO OFF"
- ? "MAIN"
- ? "GOTO START"
- ? ":START"
- ? program
- ? "GOTO START"
- ? ":END"
- ? "ECHO ON"
- SET ALTERNATE TO
- SET CONSOLE ON
- QUIT
- * EOP QUIT_TO
-
- * The following three programs demonstrate the use of QUIT_TO.
- * Compile separately, create START.BAT, and enter "START" to the
- * DOS prompt.
-
- * MAIN.PRG
- * Notes...: Main menu of a procedure to call other programs.
-
- SET PROCEDURE TO QTO
- DO WHILE .T.
- CLEAR
- @ 10,30 SAY "M A I N M E N U"
- @ 11,30 SAY "_________________"
- @ 12,30 SAY "1. Program 1"
- @ 13,30 SAY "2. Program 2"
- @ 14,30 SAY "3. Quit"
- choice = " "
- DO WHILE .NOT. CHOICE $"123"
- @ 18,30 SAY "Choice? " GET CHOICE PICTURE "9"
- READ
- ENDDO
- DO CASE
- CASE choice = "1"
- * Add spaces to make next 8 characters long...
- next = "TEST_1 "
- DO QUIT_TO WITH next
- CASE choice = "2"
- next = "TEST_2 "
- DO QUIT_TO WITH next
- CASE choice = "3"
- next = "GOTO END"
- DO QUIT_TO WITH next
- ENDCASE
- ENDDO
- * EOF MAIN.PRG
-
- *TEST_1.PRG
- SET PROCEDURE TO QTO
- CLEAR
- WAIT "This is TEST_1.PRG. Press any key to return to MAIN."
- next = "MAIN "
- DO QUIT_TO WITH next
- * EOF TEST_1.PRG
-
- *TEST_2.PRG
- SET PROCEDURE TO QTO
- CLEAR
- WAIT "This is TEST_2.PRG. Press any key to return to MAIN."
- next = "MAIN "
- DO QUIT_TO WITH next
- * EOF TEST_2.PRG
-
-
- --End--
- 2
-
- CLIPPER SAMPLE PROGRAMS
- -----------------------
- 1. Quit To Procedure
- 2. LIST . . . . . LIST any .DBF file
- 3. PRINTIT. . . . Print ascii files with header and page breaks.
-
-
- Enter item number or Help
-
-
- * Program.: LIST.PRG
- * Author..: Brian Russel
- * Date....: 06/20/85
- * Notes...: Simulates the raw form of the dBASE LIST command. Pass
- * the file to be LISTed on the DOS command line.
- * A:LIST <fiLEName>
-
- * Get file to use.
- PARAMETER file
- file = UPPER(TRIM(file)) + ".DBF"
- IF .NOT. FILE("&file")
- ? file + " not found"
- RETURN
- ENDIF
-
- USE &file
- * Display field name header.
- f = 1
- ? "Record# "
- DO WHILE "" <> FIELD(f)
- field = FIELD(f)
- DO CASE
- CASE TYPE("&field") = 'C'
- LEN = LEN(&field)
- CASE TYPE("&field") = 'N'
- LEN = LEN(str(&field))
- CASE TYPE("&field") = 'D'
- LEN = LEN(DTOC(&field))
- CASE TYPE("&field") = 'L'
- LEN = 1
- ENDCASE
- ?? SUBSTR(field + SPACE(80), 1, LEN) + ' '
- f = f + 1
- ENDDO
-
- *Display data.
- DO WHILE .NOT. EOF()
- ? RECNO(), IF(DELETED(), "*", " ")
- f = 1
- DO WHILE "" <> field(f)
- field = FIELD(f)
- ?? &field
- ?? ' '
- f = f + 1
- ENDDO
- SKIP
- ENDDO
-
- *EOF:LIST.PRG
-
-
- --End--
- 3
-
- CLIPPER SAMPLE PROGRAMS
- -----------------------
- 1. Quit To Procedure
- 2. LIST . . . . . LIST any .DBF file
- 3. PRINTIT. . . . Print ascii files with header and page breaks.
-
-
- Enter item number or Help
-
- * Program.: PRINTIT.PRG
- * Author..: Barry W. Grant, CLU (Source ID: TCN158)
- * Date....: 07/05/85
- * Notes...: My version of a utility program to print ASCII text files.
- * Two database (.DBF) files must be CREATED. Each .DBF file
- * structure consists of one CHARACTER field:
- *
- * .DBF file Field Name Field Length
- *
- * PRINTLST.DBF file_name 40
- * PRINTFIL.DBF m_line 80
- *
- * Memory Variables Used:
- *
- * doit - logical for a "DO WHILE" loop
- * ans - length = 1, for user Y/N responses
- * page_no - numeric for the page number
- * f_name - length = 8, file name
- * file_ext - length = 3, file extension
- * (.COM, .EXE, .DBF and .OBJ extensions are
- * "trapped" in Line 89.)
- * m_path - length = 36, complete DOS path search criteria
- * Example: C:\SUBDIR1\SUBDIR2\
- * Leave blank if file(s) to be printed are
- * in same location as this program.
- * p_file - length = 12, complete DOS file name (including
- * path criteria when applicable)
- *
- * DOS wildcard characters ("*", "?") may be used in the file name
- * and file extension. All matching files will be printed.
-
- CLEAR
- SET TALK OFF
- SET CONFIRM ON
- SET SAFETY OFF
- SET BELL OFF
- SET COLOR TO 7/0,U
- SELECT 1
- USE printlst
- SELECT 2
- USE printfil
- STORE .T. TO doit
- DO WHILE doit
- CLEAR
- f_name = " "
- m_path = SPACE(36)
- file_ext = " "
- p_file = " "
- ans = " "
- page_no = 1
- @ 8,5 SAY "Enter Drive and Path (if applicable):"
- @ 8,43 GET m_path PICTURE "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- @ 10,5 SAY "Enter the name of the ASCII text file to be printed: "
- @ 10,58 GET f_name PICTURE "!!!!!!!!"
- @ 12,5 SAY " Enter the file extension: "
- @ 12,58 GET file_ext PICTURE "!!!"
- READ
- CLEAR
- IF f_name = " "
- @ 8,5 SAY "A FILE NAME (or wildcard character) MUST BE ENTERED!"
- @ 10,5 SAY "Select another file? Y/N: "
- @ 10,33 GET ans PICTURE "!"
- READ
- IF ans = "Y"
- LOOP
- ELSE
- EXIT
- ENDIF
- ENDIF
- @ 10,27 SAY "SEARCHING DISK FOR FILE(s)"
- STORE TRIM(m_path)+TRIM(f_name)+"."+TRIM(file_ext) TO p_file
- * next command redirects the DOS directory to a temporary .TXT file
- DIR &p_file > tprint.txt
- SELECT 1
- IF LASTREC() <> 0
- ZAP
- ENDIF
- APPEND FROM tprint SDF
- GO TOP
- DO WHILE SUBSTR(file_name,1,1) = " "
- SKIP
- ENDDO
- IF SUBSTR(file_name,1,14) <> "File not found"
- STORE .T. TO p_loop
- DO WHILE p_loop
- STORE SUBSTR(file_name,1,8) TO f_name
- STORE SUBSTR(file_name,10,3) TO file_ext
- STORE TRIM(m_path)+TRIM(f_name)+"."+TRIM(file_ext) TO p_file
- IF file_ext="COM" .OR. file_ext="EXE" .OR. file_ext="OBJ" .OR. ;
- file_ext="DBF"
- CLEAR
- @ 10,20 SAY "&p_file IS NOT AN ASCII FILE!"
- ELSE
- SELECT 2
- IF LASTREC() <> 0
- ZAP
- ENDIF
- CLEAR
- @ 10,26 SAY "READING FILE TO BE PRINTED"
- APPEND FROM &p_file SDF
- STORE 1 TO line_cnt, page_no
- CLEAR
- @ 10,20 SAY "PRINTING FILE: &p_file"
- SET DEVICE TO PRINT
- @ 3,5 SAY p_file
- @ 3,40 SAY DATE()
- @ 3,70 SAY "Page "+STR(page_no,3,0)
- STORE 5 TO line_cnt
- GO TOP
- DO WHILE .NOT. EOF()
- IF line_cnt > 60
- EJECT
- STORE page_no + 1 TO page_no
- @ 3,5 SAY p_file
- @ 3,40 SAY DATE()
- @ 3,70 SAY "Page "+STR(page_no,3,0)
- STORE 5 TO line_cnt
- ENDIF
- @ line_cnt,0 SAY m_line
- STORE line_cnt + 1 TO line_cnt
- SKIP
- ENDDO
- EJECT
- SET DEVICE TO SCREEN
- CLEAR
- SELECT 1
- ENDIF
- SKIP
- IF EOF() .OR. SUBSTR(file_name,1,1) = " "
- STORE .F. TO p_loop
- ELSE
- LOOP
- ENDIF
- ENDDO
- CLEAR
- @ 10,5 SAY "Print another file? Y/N: "
- @ 10,32 GET ans PICTURE "!"
- READ
- IF ans = "Y"
- ZAP
- LOOP
- ENDIF
- ELSE
- CLEAR
- @ 8,5 SAY "FILE DOES NOT EXIST!"
- @ 10,5 SAY "Select another file? Y/N: "
- @ 10,32 GET ans PICTURE "!"
- READ
- IF ans = "Y"
- LOOP
- ENDIF
- ENDIF
- STORE .F. TO doit
- ENDDO
- IF FILE("tprint.txt")
- ERASE tprint.txt
- ENDIF
- SELECT 1
- ZAP
- SELECT 2
- ZAP
- CLEAR ALL
- QUIT
-
- * End of file: PRINTIT.PRG
- *******************************************************
-
- --End--
-
- CLIPPER SAMPLE PROGRAMS
- -----------------------
- 1. Quit To Procedure
- 2. LIST . . . . . LIST any .DBF file
- 3. PRINTIT. . . . Print ascii files with header and page breaks.
-
-
- Enter item number or Help p
-
-
- NANTUCKET PRIVATE NETWORK
- -------------------------
- 1. INSTRUCTIONS AND MENU-MAP
- 2. REFERENCE NOTES
- 3. ANOMALIES
- 4. SAMPLE PROGRAMS
- 5. FUNCTION LIBRARY
- 6. MAIL
- 7. WHAT'S NEW
-
-
- Enter item number or Help 5
-
-
-
- CLIPPER FUNCTION LIBRARY
- ------------------------
- 1. LTRIM(). . . . removes leading spaces
- 2. RAND() . . . . random number generator
- 3. CLR(). . . . . work-around for @...CLEAR anomaly
- 4. EXPAND() . . . double space strings for menus and reports
- 5. CENTER() . . . center @..SAY's
-
-
- Enter item number or Help 1
-
-
- *Function....LTRIM()
- *Syntax......LTRIM(expC)
- *Parameters..Any character expression.
- *Returns.....The same string with any leading blanks moved to the
- * end.
- *Notes.......Removing the addition of a space in the assignment
- * statement will return a string that is shorter by
- * the number of leading spaces.
-
- FUNCTION LTRIM
-
- PARAM string
-
- DO WHILE SUBSTR(string,1,1) = " " .AND. LEN(string) > 1
- string = SUBSTR(string,2) + " "
- ENDDO
-
- RETURN(string)
-
- --End--
- 2
-
-
-
- CLIPPER FUNCTION LIBRARY
- ------------------------
- 1. LTRIM(). . . . removes leading spaces
- 2. RAND() . . . . random number generator
- 3. CLR(). . . . . work-around for @...CLEAR anomaly
- 4. EXPAND() . . . double space strings for menus and reports
- 5. CENTER() . . . center @..SAY's
-
-
- Enter item number or Help
-
- * Function...RAND() function
- * Syntax.....RAND(expN)
- * Parameters.A numeric expression that evaluates to an integer.
- * Returns....An integer in the range of 0 to n-1.
- * Notes......Requires that a memory variable called "seed" be
- * initialized to a value between 0 and 1 before calling.
- * For example:
- * seed = VAL(SUBSTR(TIME(),8,1)) * .1
-
- FUNCTION RAND
- PARAM n
-
- seed = 997 * seed
- seed = seed - INT(seed)
-
- RETURN (INT(n * seed))
-
- --End--
- 3
-
-
-
- CLIPPER FUNCTION LIBRARY
- ------------------------
- 1. LTRIM(). . . . removes leading spaces
- 2. RAND() . . . . random number generator
- 3. CLR(). . . . . work-around for @...CLEAR anomaly
- 4. EXPAND() . . . double space strings for menus and reports
- 5. CENTER() . . . center @..SAY's
-
-
- Enter item number or Help
-
- *Function....:CLR()
- *Syntax......:CLR(expN,expN)
- *Parameters..:row,col
- *Returns.....:null
- *Notes.......:@ row, col CLEAR does not perform as documented.
- * It should clear a corner described by the row and column
- * coordinates. Clipper, however starts at the described row and
- * column and clears everything to the end of screen. This
- * function will simulate the CLEAR command as documented.
- * Since the purpose of a function is to return a value and what we
- * really want here is to DO something, this should more properly
- * be written as a procedure. This is provided purely as an
- * example of the enormous versatility of user defined functions.
- * Since a function MUST return a value, CLR() returns null string.
- * Call the function by with a question mark.
- * ? CLR(row,col)
- * If used as a procedure, you don't have to worry about any
- * of that (but then we wouldn't have a function example).
- * Following are the two ways. Take your pick.
-
- * FUNCTION EXAMPLE
- FUNCTION clr
- PARAM row,col
- *
- FOR f_row = row to 23
- @ f_row, col
- NEXT
- * Clear line 24 without scrolling...
- @ 24, col SAY SPACE(79 - col)
- RETURN ("")
- *
- *
- * PROCEDURE EXAMPLE
- * Syntax: DO clr WITH row,col
- PROCEDURE clr
- PARAM row,col
- *
- FOR f_row = row to 23
- @ f_row, col
- NEXT
- @ 24, col SAY SPACE(79 - col)
-
- RETURN
-
- --End--
- 4
-
-
-
- CLIPPER FUNCTION LIBRARY
- ------------------------
- 1. LTRIM(). . . . removes leading spaces
- 2. RAND() . . . . random number generator
- 3. CLR(). . . . . work-around for @...CLEAR anomaly
- 4. EXPAND() . . . double space strings for menus and reports
- 5. CENTER() . . . center @..SAY's
-
-
- Enter item number or Help
-
- *Function....EXPAND()
- *Syntax......EXPAND(expC)
- *Author......Steve Straley
- *Parameters..Any character string.
- *Returns.....The same string is returned with spaces between characters
- *
- *Notes.......This function can be used when printing titles for reports
- * and menus with the display separated with spaces between
- * each character. This function will should save the trouble
- * of typing out those extra spaces.
-
- FUNCTION Expand
-
- PARAMETER in_string
-
- length = LEN(in_string)
- counter = 1
- out_str = ""
-
- DO WHILE counter <= length
- out_str = out_str + SUBSTR(in_string,counter,1) + " "
- counter = counter + 1
- ENDDO
-
- RETURN(TRIM(out_str))
-
-
- --End--
- 5
-
-
-
- CLIPPER FUNCTION LIBRARY
- ------------------------
- 1. LTRIM(). . . . removes leading spaces
- 2. RAND() . . . . random number generator
- 3. CLR(). . . . . work-around for @...CLEAR anomaly
- 4. EXPAND() . . . double space strings for menus and reports
- 5. CENTER() . . . center @..SAY's
-
-
- Enter item number or Help
-
- *Title........CENTER
- *Syntax.......CENTER(expC)
- *Paramenters..Any string less than 80 characters in length.
- *Returns......The appropriate column position to center the line.
- *Notes........Use this function in place of a column coordinate.
- * @ 12, CENTER("Hello") SAY "Hello"
-
- FUNCTION CENTER
-
- PARAM string
-
- col_pos = LEN(string)
- IF col_pos < 80
- col_pos = INT((80 - col_pos) / 2)
- ELSE
- col_pos = 0
- ENDIF
-
- RETURN (col_pos)
-
-
- --End--
- p
-
-
-
- CLIPPER FUNCTION LIBRARY
- ------------------------
- 1. LTRIM(). . . . removes leading spaces
- 2. RAND() . . . . random number generator
- 3. CLR(). . . . . work-around for @...CLEAR anomaly
- 4. EXPAND() . . . double space strings for menus and reports
- 5. CENTER() . . . center @..SAY's
-
-
- Enter item number or Help
-
- NANTUCKET PRIVATE NETWORK
- -------------------------
- 1. INSTRUCTIONS AND MENU-MAP
- 2. REFERENCE NOTES
- 3. ANOMALIES
- 4. SAMPLE PROGRAMS
- 5. FUNCTION LIBRARY
- 6. MAIL
- 7. WHAT'S NEW
-
-
- Enter item number or Help 6
-
-
- ELECTRONIC MAIL INSTRUCTIONS
- ----------------------------
- On-line MAIL to Nantucket Support should be sent to NAN002.
- In order for us to provide you with the best service possible,
- please follow these guidlines.
-
- 1. Provide us with information concerning your hardware,
- peripherals, operating system version, and any utility programs
- you may have residing in memory (i.e. SideKick, Smartkey, etc.).
-
- 2. Give a BRIEF description (1 or 2 lines) of your application's
- general nature.
-
- 3. Finally, provide us with the SPECIFIC nature of your problem
- including error messages and the command syntax being used. You
- may provide some source code as an example. However, due to the
- time necessary to download files, only 25 lines of source code
- will be accepted. So please, consolidate your problem (or
- suspected problem) to as few lines of code as possible.
-
- 4. Include your name, Clipper serial number, Source ID (not your
- password), and phone number.
-
- --End--
-
-
- NANTUCKET PRIVATE NETWORK
- -------------------------
- 1. INSTRUCTIONS AND MENU-MAP
- 2. REFERENCE NOTES
- 3. ANOMALIES
- 4. SAMPLE PROGRAMS
- 5. FUNCTION LIBRARY
- 6. MAIL
- 7. WHAT'S NEW
-
-
- Enter item number or Help q
-