Dec 132017
Manual for clipper autumn 1986. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
CLIPDOCS.TXT | 109974 | 22001 | deflated |
Download File CLIPDOCS.ZIP Here
Contents of the CLIPDOCS.TXT file
______________________________________________________________________________
Hello from MG
The follow 33 pages were put together to aid us in our program developement.
We were very tired of having to search through 3 manuals, a dBase book or two,
and quite a few Read Me and .Prg files to find the proper syntax and misc
notes about a particular command or function. That is what brought about this
file, it is all of the information we could find or have discovered about
Clipper Autumn 86, the Tom Rettig library, the Dbu library, the Memo library
and the Extenddb.prg functions.
We've tried to make it as accurate as possible, but as with everything else to
do with computers, we are sure there is plenty of room for improvements,
additions, corrections and your discoveries. Please write and let us know!
We would like you to help us distribute this file to every Clipper programmer,
or soon to be, that you know. Yes, its Freeware or ShareWare or whatever you
want to call it. And, yes, we would appreciate some remuneration for the work.
Print out this file, use it for awhile and IF you find it to be a useful
Reference Guide then please send us what you feel it is worth to you, based
on the amount of use you are getting out of it and the time it saves you from
having to search for those other docs! Thanks!!!
______________________________________________________________________________
To print this file, simply use the DOS PRINT command, i.e. PRINT CLIPDOCS.TXT
The rest of this file has been formatted for 12 CPI with the proper form feeds
and a left hand margin of 5 characters. This will allow you to easily punch it
and put it in a notebook with some dividers.
The divider sections that we are using are:
GENERAL INFO
TIMING
COMMANDS
SET COMMANDS
FUNCTIONS - ALPHABETICALLY
FUNCTIONS - BY GROUP
MISC - utilities and dbiii notes
NOTES - for blank paper
We hope you enjoy it and that it makes your programming jobs go smoother and
quicker!!
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_______ ____ _________ ____ ______ ______ ____ _______
______ ____ _________ ____ _____ _____ _____ _____ ____ _____ ______
_____ _________ _________ ____ ______ ____ ______ ____ __________ ______ _____
_____ __________ _________ ____ ______ ____ ______ ____ __________ ______ _____
_____ __________ _________ ____ _____ _____ _____ _____ ______ _____ ______
_____ __________ _________ ____ ______ ______ ______ _______
_____ __________ _________ ____ ____________ ____________ __________ __ _________
_____ _________ _________ ____ ____________ ____________ __________ ___ ________
______ ____ ____ ____ ____________ ____________ ____ ____ _______
_______ ____ ____ ____ ____________ ____________ ____ _____ ______
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
D O C U M E N T A T I O N N O T E S A N D T I M I N G
Including
The Tom Rettig Library
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
CLIPPER COMMANDS AND FUNCTIONS Written By MG
DOCUMENTATION AND TIMING as of 09/10/87 1475 W. Cypress Ave
San Dimas, CA 91773
Clipper - AUTUMN 86 Version with Dbu.Lib & Memo.Lib
Tom Rettig Library - Version 1.04/1.05 Tr86.Lib
_________________________________________________________________________________________
_________________________________________________________________________________________
General Info
Max No of Variables 64,000 (2048 by default, 44K - 22 bytes per variable)
Max Variable Name Len 10 (longer names ok but clipper only uses first 10 chars)
Max No of DBF Fields 1,024
Max No of DBF Records - limited to available disk space
Max No of Relations 1 parent and up to 8 children
Max No of Open DBF 10
Max No of NTX per DBF 7
Max Index Key Len 100 characters
Max No of DOS Open Files 20 (5 reserved for DOS, 15 for clipper)
DOS 2.0 or greater required for non network systems
DOS 3.1 or greater required for networked systems
.DBF - Database File
.DBT - Database Memo Field File
.FRM - Report Form File
.FMT - Screen Format File
.LBL - Label Style File
.MEM - Memory Variable File (can now include saved screen memvar(s))
.NTX - DBF Index File
.PRG - Source Code File
.TXT - DOS Text File (default ext for set alternate to)
_________________________________________________________________________________________
_________________________________________________________________________________________
Operators
= equal
== exact equal
# not equal
<> not equal
!= not equal
< less than
> greater than
<= less than or equal
>= greater than or equal
'' string delimiters
"" string delimiters
[] string delimiters
$ equal to or contained in i.e. $
+ string concantination - exact concantination including spaces
- string concantination - trailing blanks moved to end of combined strings
+ plus
- minus
* multiply
/ divide
% modulus (remainder only)
^ power
** power
! same as .not.
.NOT. x=.Not.x or x=!x toggles x between .t. and .f.
.OR.
.AND.
Dos Redirection
>PRN, >LPT1 - The 1st parallel printer port
>LPT2 - The 2nd parallel printer port
>LPT3 - The 3rd parallel printer port
>AUX >COM1 - The 1st serial port
>COM2 - The 2nd serial port
>CON - Keyboard input / Screen output
>NUL - used to eliminate Dos messages
>filenameS - file I/O
>>filenameS - file I/O, on, output append to file if it exists, else create it
_________________________________________________________________________________________
_________________________________________________________________________________________
Definitions
- Quoted string, memo field, string memvar or function that returns char type
- Number, numeric memvar or function that returns a number type
- Date, date memvar or function that returns a date type
- .T..F..Y..N. memvar or a function or action that returns a logical type
- any of the above
- Unquoted direct string or macro substitution (&memvarC)
Note: In the docs items
that end in: Examples _________________________________________________
C = expC filenameC = "Myfile.dbf" or Mfile when Mfile="Myfile.dbf"
N = expN startN = 12 or X when X=12
D = expD dateD = 09/23/87 or Mdate when Mdate=Date()
L = expL L = .T. or .F. or Meof when Meof=Eof()
S = expS processS = Myproc or &Mp_ when Mp_="Myproc"
- name of a specific type of memory variable
- name of any memory variable
- a list of valid memvar(s) separated by commas
array - name of clipper array i.e. Myarr
elem - element number of clipper array variable i.e. Myarr[3]
- row,column
- top left row,col
- bottom right row,col
- Record
Next
Rest - not in clip - use While .T.
All
- a test i.e. Name='C' or Date
> - reference other work area unless alias > J then ref memvar
- a list of valid field(s) in the curent DBF
- a vaild DOS filename with or without drive and path
no: - no colon should follow the drive letter i.e. C not C:
noext - no .ext should follow the filename i.e. Myfile not Myfile.xyz
- using ? and * i.e. ??p???.DBF *.NTX MG_*
dateD - 09/23/87 - same as expD
dateC - "09/23/87"
date_stringC - "19870923"
time_stringC - "00:00:00" thru "23:59:59"
_________________________________________________________________________________________
_________________________________________________________________________________________
Timing Tests
_________________________________________________________________________________________
The following items were timed on a 10 MHz AT Clone with an 80287. The
times shown in the right hand column are in seconds for 1,000 iterations.
This was done to compare different commands and functions, not to figure
out the exact execution time since Seconds() is not accurate enough (+-.06).
Note: The time for the For...Next loop has been subtracted from each test.
@ 2,2 ................................ - 4.35
@ 2,2 Say " <78 spaces> " ............ - 4.65
@ 2,2 Say Space(78) .................. - 4.95
@ 2,2 Clear To 2,79 .................. - 15.35
Call Scroll with 2,2,2,79,0,'d' ...... - 2.15
@ 2,2 Clear To 24,2 .................. - 5.45
For r=2 to 24
@ r,2 Say " "
Next ................................. - 56.25
Call Scroll with 2,2,24,2,0,'d' ...... - 2.70
Clear ................................ - 97.70
@ 0,0 Clear .......................... - 97.75
@ 0,0 Clear To 24,79 ................. - 299.90
@ 0,0,24,79 Box "" ................... - 299.90
Call Scroll with 0,0,24,79,0,'d' ..... - 10.15
Call Rombios with 16,regs,flag ....... - 15.90 * regs and flag pre-setup
rgs='070000000000184F0000000000000000' * this is the same as the
flg=0 * above Call Scroll
Call Rombios with 16,rgs,flg ......... - 17.00 * regs and flags setup in loop
Asc() .......................... - .17
Chr() .......................... - .44
Len() .......................... - .17
Lower() ........................ - .83
Upper() ........................ - .83
Trim() ......................... - .50
Ltrim() ........................ - .61
Alltrim() ...................... - 2.65
Trim(Ltrim()) .................. - 1.16
Ljust() ........................ - 2.98
Subs(Trim(x)+Space(n),1,Len(x)) ...... - 3.68
Substr(,2) ..................... - .66 *
Substr(,2,2).................... - .78 * longer return strings slow
Left(,5) ....................... - 2.43 * these functions down, but
Right(,5) ...................... - 2.53 * Substr was always faster
Substr(,Len()-4) ......... - 1.59 * than Left or Right
Space(10) ............................ - .12
Space(50) ............................ - .12
Val() .......................... - 1.49
Trim()+" "+ ............. - 2.37
-(" "+) ................. - 1.88
"ff"$ .......................... - .39
Chrfound("ff",) ................ - .94
At("f",) ....................... - .39
Atlast("f",) ................... - 1.11
Atnext("f", Chrcount(,) ............. - 1.21
_________________________________________________________________________________________
Timing Tests Cont.
Abs() .......................... - .11
Exp() .......................... - .66
Int() .......................... - 2.86
Log() .......................... - .50
Min(,) .................. - .39
Max(,) .................. - .39
If(<,,) .... - .77 * Same as Min, Max
If< .. Else .. Endi .... - .66 * Same as Min, Max
Round(,2) ...................... - 4.18
Sqrt() ......................... - .33
Str() .......................... - 2.64
Str(,7) ........................ - 2.64
Str(,7,2) ...................... - 2.80
Transform(,'9999.99') .......... - 4.51
Do While i<1000 ...................... - 1.59
For i=1 to 1000 ...................... - 1.54
For i=1 to 1000 Step 1 ............... - 1.92
If .t. ............................... - .16
If .f. ............................... - .11
If a=b ............................... - .54 * Trues return approx the same
If a<>b .............................. - .60 times i.e. ab !a=b etc.
Do While .t. (with Exit) ............. - .55 * Do While .t. Exit Enddo
Do While .f. ......................... - .49 * Do While .f. Enddo
Do Proc_ ............................. - .39 * Proc pname Return
Do Proc_ with i ...................... - .71 * Proc pname Param P1 Return
Do Proc_ with (i) .................... - .93 * Proc pname Param P1 Return
Func_() .............................. - .66 * Func fname Return ""
Func_(i) ............................. - 1.21 * Func fname Param P1 Return ""
Do Case Case .t. ................... - .21 * Do Case Case .t. Endcase
Do Case Case .f. ................... - .21 * Do Case Case .f. Endcase
Save Screen .......................... - 8.07
Rest Screen .......................... - .06
Save Screen to memvar ................ - 12.19
Rest Screen from memvar .............. - 10.98
Store 1 to a ......................... - .33 * Longer variable names also
a=1 .................................. - .33 return these same times
Store 1 to a,b,c,d ................... - .98
a=1 .. b=1 .. c=1 .. d=1 ............. - 1.32
Keyboard "" .......................... - .50
Keyboard "a" ......................... - .62
Keyboard Chr(13) ..................... - 1.10
Keyboard "a"+Chr(13) ................. - 1.60
Keyboard ................... - 1.10 * memvarC = 'a'+chr(13)
Keyboard ............... - 1.38 * array[elem] = 'a'+chr(13)
Clear Typeahead ...................... - .50
Inkey() .............................. - .50
Last() ............................... - .28
Updated() ............................ - .18
_________________________________________________________________________________________
_________________________________________________________________________________________
Commands
_________________________________________________________________________________________
_________________________________________________________________________________________
* - comment line
NOTE - comment line
&& - trailing comments
_________________________________________________________________________________________
? - print (new line)
?? - print (continue same line)
_________________________________________________________________________________________
& - macro substitution - no more that 12 .and..or..not.s in macro
max macro len() seems to be 2048
commands are not allowed, i.e. Use, List Display etc.
commas are not allowed except for Set Color macros
_________________________________________________________________________________________
$ - returns .T. if expC is equal to or contained in expC2
_________________________________________________________________________________________
@ [SAY - leaves cursor at end of say exp
[PICT]]
[GET - leaves cursor at end of get exp until Read
[PICT] a null get is not read i.e. x="" @ r,c get x
[RANGE]
[VALID]]
@ CLEAR - clears rectangle from r,c to 24,79
leaves cursor at r,c not at end of screen
@ r,c - clears to end of line - leaves cursor at r,c
@ r,c Say "" - moves cursor to r,c - no chars written to screen
@ 24,79 Say " " - hides cursor for Inkey(x), watch out for incorrect set color @ 24,79
or use:
Call Cursor With "Off"
Set Cons Off
Wait
Set Cons On
_________________________________________________________________________________________
_________________________________________________________________________________________
Picture Templates and Functions For Say, Get and Transform
_________________________________________________________________________________________
Templates
9 - digits + - and . if in pict
# - digits + - spaces and . if in pict
A - only alpha characters
L - only T F Y N t f y n
Y - only Y N y n
N - only alphanumeric
X - any character
! - convert to upper case (alphanumeric)
$ - replace leading zeros with $
* - replace leading zeros with *
. - forces a decimal point
, - displays commas if over 999.99
Functions
@B - numbers are left justified
@Z - numeric zero is displayed as a blank
@E - European numeric pict (999,99 not 999.99)
@A - accept only alpha characters
@! - convert to upper case
@R - used to place non data characters into the picture
@K - clear field if not a cursor key press first
@Sn - scroll data in window n wide
@( - negative number in brackets ( 125.60)
@) - negative number in brackets - no leading spaces (125.60)
Exapmles
pict "@K !!!!" pict '@K @! AAA99AA999'
pict "@K @!" pict '@! Y'
pict "@K @S40" pict '@) 999,999.99"
pict "@!" pict '@Z'
pict "999,999.99"
_________________________________________________________________________________________
_________________________________________________________________________________________
@ CLEAR TO - leaves cursor at t+1,l+1
If t=b - horizontal line clear - leaves cursor at b,r+1
If l=r - vertical line clear - leaves cursor at b,r+1
@ TO [DOUBLE] - draws box
@ BOX or "" to clear - leaves cursor at t+1,l+1
If t=b - horizontal line - leaves cursor at b,r+1
If l=r - vertical line - leaves cursor at b,r+1
SET MESSAGE TO [] - prompt message line, starting at column 0
@ PROMPT [MESS ] - no more than 32 prompts per menu
MENU TO - Note: cursor is automatically turned off but
it is Always! turned back on after Menu To
__________ Undocumented items about Clear To / To / Box _________________________
@ 12,12 Clear To 8,4 - only clears 4 corners - leaves cursor at b+1,r+1
@ 12,12 Clear To 8,20 - only clears 2 rows - leaves cursor at t+1,l+1
8,12 to 8,20 and 12,12 to 12,20
@ 8,20 Clear To 12,12 - only clears 2 columns - leaves cursor at b+1,r+1
8,12 to 20,12 and 8,20 to 20,20
@ 8,20 Clear To 25,40 - clears rectangle and - leaves cursor at t+1,l+1
clears (r-l)*b-24 chars on 24th line starting at b,r+1
Tom Rettig's Call Scroll t,l,b,r,0,"d" is much faster! and it leaves the cursor
wherever it was before
@ 12,12 To 8,4 - leaves cursor at t+1,l+1
or
@ 12,12,8,4 Box "."
@ 12,12 To 8,20 - leaves cursor at t+1,l+1
or
@ 12,12,8,20 Box "."
@ 8,20 To 12,12 - leaves cursor at t+1,l+1
or
@ 8,20,12,12 Box "."
@ 20,20 To 25,40 - leaves cursor at t+1,l+1
or ...
@ 20,20,25,40 Box "." ...
@ 20,20 To 25,79 - leaves cursor at t+1,l+1
or ..........
@ 20,20,25,79 Box "." ..........
@ r,c To - Compiles ok but generates runtime error!
_________________________________________________________________________________________
_________________________________________________________________________________________
ACCEPT [] TO - always stores user input to memvarC data type
quotes are not needed and if included they will be
stored in memvarC - null entry returns null memvarC
_________________________________________________________________________________________
APPEND [][] - adds records to current DBF from filenameS
FROM
[FOR/WHILE]
[SDF/Delimited]
_________________________________________________________________________________________
APPEND BLANK - adds blank record to current DBF
_________________________________________________________________________________________
AVERAGE - calculates the average of field_list into memvar_list
TO
[FOR/WHILE]
_________________________________________________________________________________________
CALL WITH - calls C and ASM progs with up to 7
[WITH WORD] params passed
_________________________________________________________________________________________
CANCEL - Closes all files and exits to DOS
_________________________________________________________________________________________
CLEAR - clears CRT
CLEAR ALL - clears CRT and erases the current memvars
CLEAR GETS - releases current gets from read list
CLEAR MEMORY - ereases current memvars
CLEAR TYPEAHEAD - clear keyboard buffer, same as Keyb ""
_________________________________________________________________________________________
CLOSE - close just the current DBF and its DBT,NTX files
CLOSE ALTE - close the alternate output file
CLOSE DATA - close all DBFs and their DBT,NTX files
CLOSE FORM - close format file
CLOSE INDE - close current NTX files (same as set index to)
CLOSE PROC - close an external procedure file
_________________________________________________________________________________________
CONTINUE - continues the last Locate command - finds next match
_________________________________________________________________________________________
COPY FILE TO - copies any kind of file, but it places Dos Copy
COPY FILE TO messages on your screen in Dos colors. Redirect
the output to Nul without a space, i.e.
Copy File myfile.ext To newfile.ext>Nul
COPY STRUCTURE TO
[FIELDS] - copies current DBF stru to new empty DBF
COPY TO - copies current DBF file to a new DBF
[] or to a new TXT file [SDF]
[FIELDS]
[FOR/WHILE]
[SDF/DELIMITED [WITH BLANK/]]
COPY TO STRUCTURE EXTENDED - copies stru definition to new DBF
_________________________________________________________________________________________
_________________________________________________________________________________________
COUNT [] - counts the number of records that match
[FOR/WHILE] and/or For/While
TO
_________________________________________________________________________________________
CREATE - creates an empty structure definition file with 4 fields
Field_name, Field_type, Field_len, Field_dec
CREATE - creates a new DBF file from the above structure file
FROM
_________________________________________________________________________________________
DECLARE[] i.e. DECL A[25],B[12] ....
[,] expN range 1 thru 2048 - array[0] not allowed
_________________________________________________________________________________________
DELETE [] - marks record(s) as Deleted()
[FOR/WHILE]
DELETE FILE - not recognized use
Run Del instead
_________________________________________________________________________________________
DIR [:/p/w] - displays directory (in DOS colors!) starting
at last r,c (also see Adir function)
Dos redirection is allowed
_________________________________________________________________________________________
DISPLAY [OFF] [] - does not page when the screen is full
[FOR/WHILE] like db iii does, so when or For/While
[TO PRINT/TO FILE] is included it acts just like List
_________________________________________________________________________________________
DO/
[WITH ] - passed by ref - original params can be changed by proc
[WITH ()] - passed by value - original params will not be changed by proc
[WITH] - single array element passed - always passed by value
[WITH] - entire array passed - always passed by value
- Notes: regular memvars and arrays can be mixed in param list
by ref and by value can be mixed in param list
param list entries are separated by commas
when an expression is passed, X+1, instead of just the
memvar name, X, it is always passed by value
_________________________________________________________________________________________
DO CASE - set up conditional processing based on case conditionS
CASE
CASE
[OTHERWISE
]
ENDCASE
_________________________________________________________________________________________
_________________________________________________________________________________________
DO WHILE - sets up loop condition
[LOOP] - goes back to top of the current loop
[EXIT] - exits loop
ENDDO - end of loop when conditionS is no longer true
_________________________________________________________________________________________
EJECT - send formfeed char to printer with or without SET PRINT ON!
_________________________________________________________________________________________
ERASE - erases any type of file
_________________________________________________________________________________________
EXTERNAL - allows external proc names to be used in macros
_________________________________________________________________________________________
FIND - rapidly finds indexed record whose index key matches expS
_________________________________________________________________________________________
FOR = TO [STEP ] - good old standard For Next Loop
NEXT
_________________________________________________________________________________________
FUNCTION - user defined function (udf) (see extenddb.prg for examples)
RETURN/""
_________________________________________________________________________________________
GO / GOTO/TOP/BOTTOM - move the database to record expN, the Top or the Bottom
_________________________________________________________________________________________
HELP - see Set Key 28
_________________________________________________________________________________________
IF - conditional processing based on if conditionS
[ELSE
]
ENDI
IF(,,) Note: If(c,e,e) and Iff(c,e,e) are FULLY evaluated
before the value is assigned, i.e.
IFF(,,) b=If(x=0,0,a/x) will return a runtime error
when x=0 even though a/x is the Else expression
_________________________________________________________________________________________
INDEX ON TO - Create Clipper index file
_________________________________________________________________________________________
INPUT [] TO - user entry converts memvar to C N or L data type, the
user must put quotes around string entries, 256 chars max
if null or space entry, last value for memvar is retained
Note: Input will evaluate an expression i.e Log(1.234)
Ltrim(" xxxx"), 2*3+1 etc. including functions
like Inkey(x), handy for checking some items!
_________________________________________________________________________________________
_________________________________________________________________________________________
JOIN WITH TO - combines specific records and fields from
[FOR] current and alias DBFs into a new DBF
[FIELDS]
_________________________________________________________________________________________
KEYBOARD/"" - clears keyboard buffer and stuffs it with new expC / "" just clears
subtracts 256 from val(expC) if it is greater than 255
Keyb Chr(19) WILL pause your system (^S)
_________________________________________________________________________________________
LABEL FORM - generates labels using the specified
[SAMPLE] [] label form file (see Label utility)
[FOR/WHILE]
[TO PRINT/TO FILE]
_________________________________________________________________________________________
LIST [OFF] [] - list records to screen, printer or file
[FOR/WHILE]
[TO PRINT/TO FILE]
_________________________________________________________________________________________
LOCATE [] [FOR/WHILE ] - searches for record that matches condition
_________________________________________________________________________________________
MENU TO - used with @ r,c Promt for light bar menus
_________________________________________________________________________________________
PACK - Permanently removes marked records (dele()) from current DBF
_________________________________________________________________________________________
PARAMETERS - param list for proc and from DOS command line
_________________________________________________________________________________________
PRIVATE - makes memvars private to all other progs, proc and functions
_________________________________________________________________________________________
PROCEDURE - declares the followng code as a proc (subprogram)
DO NOT name a proc OPEN to open files, it will cause lock up
RETURN OPEN_ or OPENF_ is Ok
_________________________________________________________________________________________
PUBLIC/CLIPPER - makes memvar public for all other progs, proc and func
_________________________________________________________________________________________
QUIT - Closes all files and exits to DOS
_________________________________________________________________________________________
READ [SAVE] - read user data entry into gets
_________________________________________________________________________________________
RECALL [] - removes deleted mark from records
[FOR/WHILE]
_________________________________________________________________________________________
REINDEX - rebuilds existing active index file(s)
_________________________________________________________________________________________
_________________________________________________________________________________________
RELEASE [] - erase current memvars from memory
[ALL [LIKE/EXCEPT]]
_________________________________________________________________________________________
RENAME TO - renames any type of file, not allowed
use Run Ren instead
_________________________________________________________________________________________
REPLACE [] - replace old field data with new field data (exp)
WITH
[alias-> WITH ]
[, WITH ]
[FOR/WHILE]
_________________________________________________________________________________________
REPORT FORM - generates report using the specified
[] report form file (see Report utility)
[FOR/WHILE]
[PLAIN]
[HEADING]
[NOEJECT]
[TO PRINT/TO FILE]
_________________________________________________________________________________________
RESTORE FROM [ADDITIVE] - reads memvars from disk file
_________________________________________________________________________________________
RESTORE SCREEN [FROM] - restores saved screen
_________________________________________________________________________________________
RUN / ! - executes a program outside of your clipper program
RUN COMMAND - executes COMMAND.COM for user DOS commands
_________________________________________________________________________________________
SAVE SCREEN [TO] - saves screen image, optionally to memvarC
_________________________________________________________________________________________
SAVE TO - saves memvar to file.mem, will now also save
[ALL [LIKE/EXCEPT]] screens saved to memvars, will not save arrays
_________________________________________________________________________________________
SEEK - rapid find on index key (& macro not needed spaces allowed)
_________________________________________________________________________________________
SELECT - SELECT 0 selects first unused work area
_________________________________________________________________________________________
SKIP [ALAIS ] Note: skip 0 will write out updated current
disk buffer
_________________________________________________________________________________________
SORT TO /A = Assending (default) up to 10 fields can be
ON [/A/C/D] /C = Case sensitive used in Sort
[, [/A/C/D]...] /D = Desending
[FOR/WHILE]
_________________________________________________________________________________________
_________________________________________________________________________________________
STORE TO - assigns exp to memvar(s)
_________________________________________________________________________________________
SUM TO - adds up field_list into memvar_list
[FOR/WHILE]
_________________________________________________________________________________________
TEXT - sends a block of text to the screen, printer or file
[TO PRINT/TO FILE]
ENDTEXT
_________________________________________________________________________________________
TOTAL TO ON - creates a summary database of a
Hello from MG
The follow 33 pages were put together to aid us in our program developement.
We were very tired of having to search through 3 manuals, a dBase book or two,
and quite a few Read Me and .Prg files to find the proper syntax and misc
notes about a particular command or function. That is what brought about this
file, it is all of the information we could find or have discovered about
Clipper Autumn 86, the Tom Rettig library, the Dbu library, the Memo library
and the Extenddb.prg functions.
We've tried to make it as accurate as possible, but as with everything else to
do with computers, we are sure there is plenty of room for improvements,
additions, corrections and your discoveries. Please write and let us know!
We would like you to help us distribute this file to every Clipper programmer,
or soon to be, that you know. Yes, its Freeware or ShareWare or whatever you
want to call it. And, yes, we would appreciate some remuneration for the work.
Print out this file, use it for awhile and IF you find it to be a useful
Reference Guide then please send us what you feel it is worth to you, based
on the amount of use you are getting out of it and the time it saves you from
having to search for those other docs! Thanks!!!
______________________________________________________________________________
To print this file, simply use the DOS PRINT command, i.e. PRINT CLIPDOCS.TXT
The rest of this file has been formatted for 12 CPI with the proper form feeds
and a left hand margin of 5 characters. This will allow you to easily punch it
and put it in a notebook with some dividers.
The divider sections that we are using are:
GENERAL INFO
TIMING
COMMANDS
SET COMMANDS
FUNCTIONS - ALPHABETICALLY
FUNCTIONS - BY GROUP
MISC - utilities and dbiii notes
NOTES - for blank paper
We hope you enjoy it and that it makes your programming jobs go smoother and
quicker!!
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_______ ____ _________ ____ ______ ______ ____ _______
______ ____ _________ ____ _____ _____ _____ _____ ____ _____ ______
_____ _________ _________ ____ ______ ____ ______ ____ __________ ______ _____
_____ __________ _________ ____ ______ ____ ______ ____ __________ ______ _____
_____ __________ _________ ____ _____ _____ _____ _____ ______ _____ ______
_____ __________ _________ ____ ______ ______ ______ _______
_____ __________ _________ ____ ____________ ____________ __________ __ _________
_____ _________ _________ ____ ____________ ____________ __________ ___ ________
______ ____ ____ ____ ____________ ____________ ____ ____ _______
_______ ____ ____ ____ ____________ ____________ ____ _____ ______
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
D O C U M E N T A T I O N N O T E S A N D T I M I N G
Including
The Tom Rettig Library
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
CLIPPER COMMANDS AND FUNCTIONS Written By MG
DOCUMENTATION AND TIMING as of 09/10/87 1475 W. Cypress Ave
San Dimas, CA 91773
Clipper - AUTUMN 86 Version with Dbu.Lib & Memo.Lib
Tom Rettig Library - Version 1.04/1.05 Tr86.Lib
_________________________________________________________________________________________
_________________________________________________________________________________________
General Info
Max No of Variables 64,000 (2048 by default, 44K - 22 bytes per variable)
Max Variable Name Len 10 (longer names ok but clipper only uses first 10 chars)
Max No of DBF Fields 1,024
Max No of DBF Records - limited to available disk space
Max No of Relations 1 parent and up to 8 children
Max No of Open DBF 10
Max No of NTX per DBF 7
Max Index Key Len 100 characters
Max No of DOS Open Files 20 (5 reserved for DOS, 15 for clipper)
DOS 2.0 or greater required for non network systems
DOS 3.1 or greater required for networked systems
.DBF - Database File
.DBT - Database Memo Field File
.FRM - Report Form File
.FMT - Screen Format File
.LBL - Label Style File
.MEM - Memory Variable File (can now include saved screen memvar(s))
.NTX - DBF Index File
.PRG - Source Code File
.TXT - DOS Text File (default ext for set alternate to)
_________________________________________________________________________________________
_________________________________________________________________________________________
Operators
= equal
== exact equal
# not equal
<> not equal
!= not equal
< less than
> greater than
<= less than or equal
>= greater than or equal
'' string delimiters
"" string delimiters
[] string delimiters
$
+ string concantination - exact concantination including spaces
- string concantination - trailing blanks moved to end of combined strings
+ plus
- minus
* multiply
/ divide
% modulus (remainder only)
^ power
** power
! same as .not.
.NOT. x=.Not.x or x=!x toggles x between .t. and .f.
.OR.
.AND.
Dos Redirection
>PRN, >LPT1 - The 1st parallel printer port
>LPT2 - The 2nd parallel printer port
>LPT3 - The 3rd parallel printer port
>AUX >COM1 - The 1st serial port
>COM2 - The 2nd serial port
>CON - Keyboard input / Screen output
>NUL - used to eliminate Dos messages
>filenameS - file I/O
>>filenameS - file I/O, on, output append to file if it exists, else create it
_________________________________________________________________________________________
_________________________________________________________________________________________
Definitions
Note: In the docs items
that end in: Examples _________________________________________________
C = expC filenameC = "Myfile.dbf" or Mfile when Mfile="Myfile.dbf"
N = expN startN = 12 or X when X=12
D = expD dateD = 09/23/87 or Mdate when Mdate=Date()
L = expL L = .T. or .F. or Meof when Meof=Eof()
S = expS processS = Myproc or &Mp_ when Mp_="Myproc"
array - name of clipper array i.e. Myarr
elem - element number of clipper array variable i.e. Myarr[3]
- bottom right row,col
Next
Rest - not in clip - use While .T.
All
no: - no colon should follow the drive letter i.e. C not C:
noext - no .ext should follow the filename i.e. Myfile not Myfile.xyz
dateD - 09/23/87 - same as expD
dateC - "09/23/87"
date_stringC - "19870923"
time_stringC - "00:00:00" thru "23:59:59"
_________________________________________________________________________________________
_________________________________________________________________________________________
Timing Tests
_________________________________________________________________________________________
The following items were timed on a 10 MHz AT Clone with an 80287. The
times shown in the right hand column are in seconds for 1,000 iterations.
This was done to compare different commands and functions, not to figure
out the exact execution time since Seconds() is not accurate enough (+-.06).
Note: The time for the For...Next loop has been subtracted from each test.
@ 2,2 ................................ - 4.35
@ 2,2 Say " <78 spaces> " ............ - 4.65
@ 2,2 Say Space(78) .................. - 4.95
@ 2,2 Clear To 2,79 .................. - 15.35
Call Scroll with 2,2,2,79,0,'d' ...... - 2.15
@ 2,2 Clear To 24,2 .................. - 5.45
For r=2 to 24
@ r,2 Say " "
Next ................................. - 56.25
Call Scroll with 2,2,24,2,0,'d' ...... - 2.70
Clear ................................ - 97.70
@ 0,0 Clear .......................... - 97.75
@ 0,0 Clear To 24,79 ................. - 299.90
@ 0,0,24,79 Box "" ................... - 299.90
Call Scroll with 0,0,24,79,0,'d' ..... - 10.15
Call Rombios with 16,regs,flag ....... - 15.90 * regs and flag pre-setup
rgs='070000000000184F0000000000000000' * this is the same as the
flg=0 * above Call Scroll
Call Rombios with 16,rgs,flg ......... - 17.00 * regs and flags setup in loop
Asc(
Chr(
Len(
Lower(
Upper(
Trim(
Ltrim(
Alltrim(
Trim(Ltrim(
Ljust(
Subs(Trim(x)+Space(n),1,Len(x)) ...... - 3.68
Substr(
Substr(
Left(
Right(
Substr(
Space(10) ............................ - .12
Space(50) ............................ - .12
Val(
Trim(
"ff"$
Chrfound("ff",
At("f",
Atlast("f",
Atnext("f",
_________________________________________________________________________________________
Timing Tests Cont.
Abs(
Exp(
Int(
Log(
Min(
Max(
If(
If
Round(
Sqrt(
Str(
Str(
Str(
Transform(
Do While i<1000 ...................... - 1.59
For i=1 to 1000 ...................... - 1.54
For i=1 to 1000 Step 1 ............... - 1.92
If .t. ............................... - .16
If .f. ............................... - .11
If a=b ............................... - .54 * Trues return approx the same
If a<>b .............................. - .60 times i.e. ab !a=b etc.
Do While .t. (with Exit) ............. - .55 * Do While .t. Exit Enddo
Do While .f. ......................... - .49 * Do While .f. Enddo
Do Proc_ ............................. - .39 * Proc pname Return
Do Proc_ with i ...................... - .71 * Proc pname Param P1 Return
Do Proc_ with (i) .................... - .93 * Proc pname Param P1 Return
Func_() .............................. - .66 * Func fname Return ""
Func_(i) ............................. - 1.21 * Func fname Param P1 Return ""
Do Case Case .t. ................... - .21 * Do Case Case .t. Endcase
Do Case Case .f. ................... - .21 * Do Case Case .f. Endcase
Save Screen .......................... - 8.07
Rest Screen .......................... - .06
Save Screen to memvar ................ - 12.19
Rest Screen from memvar .............. - 10.98
Store 1 to a ......................... - .33 * Longer variable names also
a=1 .................................. - .33 return these same times
Store 1 to a,b,c,d ................... - .98
a=1 .. b=1 .. c=1 .. d=1 ............. - 1.32
Keyboard "" .......................... - .50
Keyboard "a" ......................... - .62
Keyboard Chr(13) ..................... - 1.10
Keyboard "a"+Chr(13) ................. - 1.60
Keyboard
Keyboard
Clear Typeahead ...................... - .50
Inkey() .............................. - .50
Last() ............................... - .28
Updated() ............................ - .18
_________________________________________________________________________________________
_________________________________________________________________________________________
Commands
_________________________________________________________________________________________
_________________________________________________________________________________________
* - comment line
NOTE - comment line
&& - trailing comments
_________________________________________________________________________________________
? - print (new line)
?? - print (continue same line)
_________________________________________________________________________________________
&
max macro len() seems to be 2048
commands are not allowed, i.e. Use, List Display etc.
commas are not allowed except for Set Color macros
_________________________________________________________________________________________
_________________________________________________________________________________________
@
[PICT
[GET
[PICT
[RANGE
[VALID
@
leaves cursor at r,c not at end of screen
@ r,c - clears to end of line - leaves cursor at r,c
@ r,c Say "" - moves cursor to r,c - no chars written to screen
@ 24,79 Say " " - hides cursor for Inkey(x), watch out for incorrect set color @ 24,79
or use:
Call Cursor With "Off"
Set Cons Off
Wait
Set Cons On
_________________________________________________________________________________________
_________________________________________________________________________________________
Picture Templates and Functions For Say, Get and Transform
_________________________________________________________________________________________
Templates
9 - digits + - and . if in pict
# - digits + - spaces and . if in pict
A - only alpha characters
L - only T F Y N t f y n
Y - only Y N y n
N - only alphanumeric
X - any character
! - convert to upper case (alphanumeric)
$ - replace leading zeros with $
* - replace leading zeros with *
. - forces a decimal point
, - displays commas if over 999.99
Functions
@B - numbers are left justified
@Z - numeric zero is displayed as a blank
@E - European numeric pict (999,99 not 999.99)
@A - accept only alpha characters
@! - convert to upper case
@R - used to place non data characters into the picture
@K - clear field if not a cursor key press first
@Sn - scroll data in window n wide
@( - negative number in brackets ( 125.60)
@) - negative number in brackets - no leading spaces (125.60)
Exapmles
pict "@K !!!!" pict '@K @! AAA99AA999'
pict "@K @!" pict '@! Y'
pict "@K @S40" pict '@) 999,999.99"
pict "@!" pict '@Z'
pict "999,999.99"
_________________________________________________________________________________________
_________________________________________________________________________________________
@
If t=b - horizontal line clear - leaves cursor at b,r+1
If l=r - vertical line clear - leaves cursor at b,r+1
@
@
If t=b - horizontal line - leaves cursor at b,r+1
If l=r - vertical line - leaves cursor at b,r+1
SET MESSAGE TO [
@
MENU TO
it is Always! turned back on after Menu To
__________ Undocumented items about Clear To / To / Box _________________________
@ 12,12 Clear To 8,4 - only clears 4 corners - leaves cursor at b+1,r+1
@ 12,12 Clear To 8,20 - only clears 2 rows - leaves cursor at t+1,l+1
8,12 to 8,20 and 12,12 to 12,20
@ 8,20 Clear To 12,12 - only clears 2 columns - leaves cursor at b+1,r+1
8,12 to 20,12 and 8,20 to 20,20
@ 8,20 Clear To 25,40 - clears rectangle and - leaves cursor at t+1,l+1
clears (r-l)*b-24 chars on 24th line starting at b,r+1
Tom Rettig's Call Scroll t,l,b,r,0,"d" is much faster! and it leaves the cursor
wherever it was before
@ 12,12 To 8,4 - leaves cursor at t+1,l+1
or
@ 12,12,8,4 Box "."
@ 12,12 To 8,20 - leaves cursor at t+1,l+1
or
@ 12,12,8,20 Box "."
@ 8,20 To 12,12 - leaves cursor at t+1,l+1
or
@ 8,20,12,12 Box "."
@ 20,20 To 25,40 - leaves cursor at t+1,l+1
or ...
@ 20,20,25,40 Box "." ...
@ 20,20 To 25,79 - leaves cursor at t+1,l+1
or ..........
@ 20,20,25,79 Box "." ..........
@ r,c To - Compiles ok but generates runtime error!
_________________________________________________________________________________________
_________________________________________________________________________________________
ACCEPT [
quotes are not needed and if included they will be
stored in memvarC - null entry returns null memvarC
_________________________________________________________________________________________
APPEND [
FROM
[FOR/WHILE
[SDF/Delimited]
_________________________________________________________________________________________
APPEND BLANK - adds blank record to current DBF
_________________________________________________________________________________________
AVERAGE
TO
[FOR/WHILE
_________________________________________________________________________________________
CALL
[WITH WORD
_________________________________________________________________________________________
CANCEL - Closes all files and exits to DOS
_________________________________________________________________________________________
CLEAR - clears CRT
CLEAR ALL - clears CRT and erases the current memvars
CLEAR GETS - releases current gets from read list
CLEAR MEMORY - ereases current memvars
CLEAR TYPEAHEAD - clear keyboard buffer, same as Keyb ""
_________________________________________________________________________________________
CLOSE - close just the current DBF and its DBT,NTX files
CLOSE ALTE - close the alternate output file
CLOSE DATA - close all DBFs and their DBT,NTX files
CLOSE FORM - close format file
CLOSE INDE - close current NTX files (same as set index to)
CLOSE PROC - close an external procedure file
_________________________________________________________________________________________
CONTINUE - continues the last Locate command - finds next match
_________________________________________________________________________________________
COPY FILE
COPY FILE
the output to Nul without a space, i.e.
Copy File myfile.ext To newfile.ext>Nul
COPY STRUCTURE TO
[FIELDS
COPY TO
[
[FIELDS
[FOR/WHILE
[SDF/DELIMITED [WITH BLANK/
COPY TO
_________________________________________________________________________________________
_________________________________________________________________________________________
COUNT [
[FOR/WHILE
TO
_________________________________________________________________________________________
CREATE
Field_name, Field_type, Field_len, Field_dec
CREATE
FROM
_________________________________________________________________________________________
DECLARE
[,
_________________________________________________________________________________________
DELETE [
[FOR/WHILE
DELETE FILE
Run Del
_________________________________________________________________________________________
DIR [
at last r,c (also see Adir function)
Dos redirection is allowed
_________________________________________________________________________________________
DISPLAY [OFF] [
[FOR/WHILE
[TO PRINT/TO FILE
_________________________________________________________________________________________
DO
[WITH ] - passed by ref - original params can be changed by proc
[WITH (
[WITH
[WITH
- Notes: regular memvars and arrays can be mixed in param list
by ref and by value can be mixed in param list
param list entries are separated by commas
when an expression is passed, X+1, instead of just the
memvar name, X, it is always passed by value
_________________________________________________________________________________________
DO CASE - set up conditional processing based on case conditionS
CASE
CASE
[OTHERWISE
ENDCASE
_________________________________________________________________________________________
_________________________________________________________________________________________
DO WHILE
[LOOP] - goes back to top of the current loop
[EXIT] - exits loop
ENDDO - end of loop when conditionS is no longer true
_________________________________________________________________________________________
EJECT - send formfeed char to printer with or without SET PRINT ON!
_________________________________________________________________________________________
ERASE
_________________________________________________________________________________________
EXTERNAL
_________________________________________________________________________________________
FIND
_________________________________________________________________________________________
FOR
NEXT
_________________________________________________________________________________________
FUNCTION
RETURN
_________________________________________________________________________________________
GO / GOTO
_________________________________________________________________________________________
HELP - see Set Key 28
_________________________________________________________________________________________
IF
[ELSE
ENDI
IF(
before the value is assigned, i.e.
IFF(
when x=0 even though a/x is the Else expression
_________________________________________________________________________________________
INDEX ON
_________________________________________________________________________________________
INPUT [
user must put quotes around string entries, 256 chars max
if null or space entry, last value for memvar is retained
Note: Input will evaluate an expression i.e Log(1.234)
Ltrim(" xxxx"), 2*3+1 etc. including functions
like Inkey(x), handy for checking some items!
_________________________________________________________________________________________
_________________________________________________________________________________________
JOIN WITH
[FOR
[FIELDS
_________________________________________________________________________________________
KEYBOARD
subtracts 256 from val(expC) if it is greater than 255
Keyb Chr(19) WILL pause your system (^S)
_________________________________________________________________________________________
LABEL FORM
[SAMPLE] [
[FOR/WHILE
[TO PRINT/TO FILE
_________________________________________________________________________________________
LIST [OFF] [
[FOR/WHILE
[TO PRINT/TO FILE
_________________________________________________________________________________________
LOCATE [
_________________________________________________________________________________________
MENU TO
_________________________________________________________________________________________
PACK - Permanently removes marked records (dele()) from current DBF
_________________________________________________________________________________________
PARAMETERS - param list for proc and from DOS command line
_________________________________________________________________________________________
PRIVATE
_________________________________________________________________________________________
PROCEDURE
RETURN OPEN_ or OPENF_ is Ok
_________________________________________________________________________________________
PUBLIC
_________________________________________________________________________________________
QUIT - Closes all files and exits to DOS
_________________________________________________________________________________________
READ [SAVE] - read user data entry into gets
_________________________________________________________________________________________
RECALL [
[FOR/WHILE
_________________________________________________________________________________________
REINDEX - rebuilds existing active index file(s)
_________________________________________________________________________________________
_________________________________________________________________________________________
RELEASE [
[ALL [LIKE/EXCEPT
_________________________________________________________________________________________
RENAME
use Run Ren
_________________________________________________________________________________________
REPLACE [
[alias->
[,
[FOR/WHILE
_________________________________________________________________________________________
REPORT FORM
[
[FOR/WHILE
[PLAIN]
[HEADING
[NOEJECT]
[TO PRINT/TO FILE
_________________________________________________________________________________________
RESTORE FROM
_________________________________________________________________________________________
RESTORE SCREEN [FROM
_________________________________________________________________________________________
RUN / !
RUN COMMAND - executes COMMAND.COM for user DOS commands
_________________________________________________________________________________________
SAVE SCREEN [TO
_________________________________________________________________________________________
SAVE TO
[ALL [LIKE/EXCEPT
_________________________________________________________________________________________
SEEK
_________________________________________________________________________________________
SELECT
_________________________________________________________________________________________
SKIP
disk buffer
_________________________________________________________________________________________
SORT
ON
[,
[FOR/WHILE
_________________________________________________________________________________________
_________________________________________________________________________________________
STORE
_________________________________________________________________________________________
SUM
[FOR/WHILE
_________________________________________________________________________________________
TEXT - sends a block of text to the screen, printer or file
[TO PRINT/TO FILE
ENDTEXT
_________________________________________________________________________________________
TOTAL TO