home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
CLIPMSG.ARC
/
BBSCLIP.MSG
Wrap
Text File
|
1980-01-03
|
23KB
|
813 lines
CLIPPER WINTER '85 UPDATE HIGHLIGHTS
3/2/86
Compliments of Rudolph Schmidt
(I hope I'm not breaking any laws)
For those of your interested here is an abbreviated copy of CLIPPER
Read_me.1st file for the latest release of the Clipper Compiler.
Highlights include:
Separately compilable modules - (extern definitions)
UDF's - user definable functions written in any language which
supports Intel OBJ code format. (full parameter passing)
Call by reference option on DO command -- parameters may be
passed by reference to allow changing values.
Memo variable editing - "best of both worlds" memo still treated
like strings only now there is a function to edit memo fields
in a user-defined window. Full array of editing keys available
Memory variable arrays - array of any memo var type supported.
NOTE: problems with private memovars seem to be solved - hopefully
Also LABEL command now strips blank lines from output -- just like
dBase III.
NOTE II: Clipper still is using proprietary index structure
I have talked with some of TECH staff at Nantucket and they
gave no hint of a change in this strategy. I am currently
writing C code to convert Clipper indexes of arbitrary size
to dBase III indexes without re-reading data files. This
utility will be available sometime within the next 2-3 months
for a reasonable price. Anyone interested can leave me a
Email message on this BBS [I'm Rudolph Schmidt].
************************* READ_ME.1ST **************************
* C L I P P E R - W I N T E R ' 8 5 *
****************************************************************
This file is organized in the following manner.
I. LIST OF FILES - [deleted]
II. ADDITIONAL COMMANDS
Commands added to Clipper not included in the documentation.
III. ADDITIONAL FUNCTIONS
Functions added to Clipper not included in the documentation.
IV. ADDENDUM TO THE DOCUMENTATION
1. Differences between dBASE and Clipper (Chapter 3)
2. Clipper Commands and Functions (Chapter 4)
V. dBASE III PLUS Compatability and the Extend library
******************** ADDITIONAL COMMANDS ***********************
>>> &&
NOTES: Comments may placed on the same line as commands if
preceded with two ampersands.
&&memvar is not supported as a macro but Clipper supports
? &x where x = "&y" and y = "&z"
>>> @ ... SAY ... GET - New PICTURE
NOTES: Function "@)" in PICTURE clause behaves as "@(" except that
leading blanks are not displayed within the parenthesis.
EXAMPLE:
@ 5,10 SAY net_loss PICTURE "@)"
Produces (125.50)
>>> <scope>
NOTES: <scope> is now compatible with dBASE III PLUS, except for
REST, (use WHILE .T.).
FOR and WHILE are no longer exclusive. This allows
conditional operations within a scope.
EXAMPLE: With a file indexed by state:
SEEK "CA"
LIST FOR Balance <> 0 WHILE State = 'CA'
>>> 3 New menu building commands
SYNTAX: SET MESSAGE TO <expN> && designate line 1 - 24 to
&& display messages for prompts
@ <row,col> PROMPT <expC> [MESSAGE <expC>]
MENU TO <memvar> && similar to READ
NOTES: The @...PROMPT command is used to place menu selections on
the screen. MENU TO <memvar> highlights the first prompt,
allows cursoring from prompt to prompt, and places in memvar
the numeric value of the prompt selected. 32 PROMPTs per
MENU are allowed. SET MESSAGE TO allows a related message
for each prompt to be displayed. Messages will appear
on line <expN>. If 0 or TO nothing messages will not
display.
Return, PgUp, or PgDn will store in the memvar the relative
number of the prompt selected. Escape will return 0.
The first character of a PROMPT will highlight and
select that selection.
Help can be activated and is passed the memvar name.
That is, if function key one is pressed to call Help.prg
the parameter passed as input_var is the memvar created
by MENU TO.
Menus can be nested (i.e. inside help) without CLEARing
GETS (unlike GET/READ). However, if the same memvar is
used for nested menus, the memvar retains the previous
value. Therefore, it is best to use different memvars
for each menu.
>>> Debugger - new options
C Clears the screen
R Run a DOS program. For example, run Line.exe
or your editor to check code on a line that causes
an error.
D Display status. Shows current selection and SET
commands status.
Memory variables passed by reference now display "@" as their
type.
>>> DECLARE - Arrays
SYNTAX: DECLARE <memvar>[<expN>] [, <array list> ]
NOTES: Creates an array of <expN> elements. Elements may be of
mixed type in usage. Arrays are always private.
The brackets surrounding <expN> do not indicate optional
syntax in this one case. They are required when
declaring and referencing arrays.
Elements of the array are used by placing the index
number of the desired element in the brackets.
The LEN() function will return the number of elements in
an array if the array name only is the parameter. In the
example below, LEN(up_alpha) would return 26.
The TYPE() function will return "A" for an array.
Assigning a value to a memory variable with the same name
as an array will destroy the array and release the values
stored.
Arrays and array elements cannot be SAVEd in .MEM files
and cannot be passed by reference as parameters with the
DO and CALL commands.
Array expressions can be used with macros, but assignment
is restricted to the following conventions.
ma = "A"
mx = "A[1]"
* legal
declare &ma[1]
&mx = 100
? &ma[1], &mx
&ma[1] = 100
* illegal
declare &mx
Example:
To create two arrays of 26 elements each, one containing
the uppercase alphabet, one the lowercase alphabet.
DECLARE up_alpha[26], low_alpha[26]
FOR i = 1 TO 26
up_alpha[i] = CHR(64+i)
low_alpha[i] = CHR(96+i)
NEXT
>>> The following rules apply when passing arrays and memory
variables to functions, procedures, and CALLed procedures.
1. Parameters are always passed to functions by value.
2. Parameters are passed to PROCEDUREs and CALLed programs
by reference only if the identifier is passed. If an
expression is passed, then the parameter is passed by
value. Elements of arrays can only be passed by value.
A parameter passed by reference can be changed by the
called routine. A parameter passed by value, is a
duplicate of the original parameter. Changing this
duplicate does not change the original.
EXAMPLES:
This syntax passes the memory variable "mem1" to the procedure
PROC1 by reference. Any change in the called procedure changes
the original memvar. This parameter is an identifier.
DO PROC1 WITH mem1
This syntax passes the value of the expression "mem1 + 1" and
the value of array element "up_alpha[1]" to PROC2.
DO PROC2 WITH mem1 + 1, up_alpha[1]
Placing the memvar in parentheses passes the value only.
Changing the parameter does not change the original element.
DO <proc> WITH (<memvar>)
By passing just an array identifier, the called procedure has
access to the entire array and any changes in the procedure
affect the original array.
DO SOUP WITH up_alpha
>>> EXTERNAL
SYNTAX: EXTERNAL <procedure list>
NOTES: This is used to declare a symbol for the linker.
Procedures that are declared external can then be placed
in overlays and still called with a macro.
Example:
EXTERNAL P1, P2, P3
n = "1"
DO P&n && P1 can be in an overlay
>>> KEYBOARD
SYNTAX: KEYBOARD <expC>
NOTES: Stuffs the keyboard input buffer with the given string.
Each execution of KEYBOARD flushes the type-ahead
buffer. Multiple KEYBOARD commands cannot be used to
que multiple strings. However, KEYBOARD "" can be used
to clear the buffer.
EXAMPLE:
* To return to a main menu from three menu levels deep
* with one key entry. "Q" and a carriage return exits
* each menu, simulation RETURN TO MASTER.
KEYBOARD "Q" + CHR(13) + "Q" + CHR(13) + "Q" + CHR(13)
See also MENU.PRG on the Utility disk.
>>> New operator "==" (double equal):
NOTES: Compares character types for a perfect match, i.e. same
length and same chars. Similar to (but not the same as)
SETting EXACT ON for an "=".
SET EXACT ON will ignore trailing blanks with "=". For
example;
SET EXACT OFF
? "abc" = "abc " && Returns .F.
? "abc " = "abc" && Returns .T.
SET EXACT ON
? "abc" = "abc " && Returns .T.
? "abc " = "abc" && Returns .T.
SET EXACT OFF
? "abc" == "abc " && All return .F.
? "abc " == "abc"
SET EXACT ON
? "abc" == "abc "
? "abc " == "abc"
Same as "=" for other types except for numeric
comparisons. Only the 12 most significant digits are
compared. This operator should be used when comparing
two numbers if 12 or less significant digits are used.
>>> Optional new logical operators
NOTES: "!" for .NOT.
"!=" for not equal
EXAMPLE:
* Same as "DO WHILE .NOT. .T."
DO WHILE ! .T.
>>> SET KEY
SYNTAX: SET KEY <expN> TO [<proc>]
NOTES: This command allows a procedure to be executed from any
wait state when a designated key is pressed. A wait
state being any command that pauses program execution.
WAIT
READ
ACCEPT
INPUT
MENU TO
<expN> will be the INKEY() value of the designated key.
At startup the system assumes:
SET KEY <F1-code> TO help
Like HELP.PRG, three parameters are always passed and
must be assigned to memory variables in the called
procedure (even if never used).
EXAMPLE:
See MENU.PRG on the Utility disk
********************** ADDITIONAL FUNCTIONS *********************
>>> DTOS()
SYNTAX: DTOS(<expD>)
NOTES: Returns a string in yyyymmdd day order. This can be used
to index on a date + character expression.
Example:
xmas = CTOD("12/25/85")
? DTOS(xmas) && returns "19851225"
>>> EMPTY()
SYNTAX: EMPTY(<exp>)
NOTES: TRUE if:
Character - expression is a null string or all
spaces
Numeric - expression = 0
Date - expression = empty date
Logical - expression = .F.
>>> FOUND()
NOTES: Returns .T. if a previous SEEK, FIND, LOCATE, or CONTINUE
was successful.
Example:
SEEK memvar
IF FOUND()
...<display record>
ELSE
? "Record not in file"
ENDIF
>>> LTRIM()
SYNTAX: LTRIM(<expC>)
NOTES: Trims leading blanks from a character string.
>>> MEMOEDIT() - Memo edit function
SYNTAX: <varC> = MEMOEDIT(<expC>, <expN>, <expN>, <expN>, <expN>[, <expL>])
NOTES: <varC> is the variable (or field) where the NEW memo is
to be stored.
<expC> is the begining string or memo.
<expN> are the 4 coordinates defining the edit window in the
order: top, left, bottom, right
<expL> is an update flag. This determines if a memo is to be
updated (TRUE) or merely displayed (FALSE).
EXAMPLE:
*To edit the current memo.
REPLACE memo_field WITH MEMOEDIT(memo_field, 5, 10, 20, 69, .T.)
*To display only the field without replacing or assigning it to
*a memvar.
IF "" = MEMOEDIT(memo_field, 5, 10, 20, 69, .F.)
ENDIF
CURSOR MOVEMENT KEYS:
Up arrow or ^E . . . . . . Up one line
Down arrow or ^C . . . . . Down one line
Left arrow or ^S . . . . . Left one character
Right arrow or ^D. . . . . Right one character
^Left arrow or ^A. . . . . Left one word
^Right arrow or ^F . . . . Right one word
HOME . . . . . . . . . . . Beginning of current line
END. . . . . . . . . . . . End of current line
^HOME. . . . . . . . . . . Beginning of memo
^END . . . . . . . . . . . End of memo
PgUp . . . . . . . . . . . Next edit window up
PgDn . . . . . . . . . . . Next edit window down
^PgUp. . . . . . . . . . . Beginning of current window
^PgDn. . . . . . . . . . . End of current window
EDITING KEYS:
^W . . . . . . . . . . . . Finish editing
Esc. . . . . . . . . . . . Abort edit and return original memo
^Y . . . . . . . . . . . . Delete current line
^T . . . . . . . . . . . . Delete word right
^B . . . . . . . . . . . . Reformat memo in the edit window
>>> READVAR()
NOTES: Returns the name of the current GET/MENU variable or a
null string if none is pending.
>>> SECONDS()
NOTES: Returns the system time as <seconds>.<hundreds>. The
value returned is the number of seconds elapsed since
midnight and is based on a twenty-four hour clock. The
range is 0 to 86399.
>>> SELECT()
SYNTAX: SELECT()
NOTES: Returns the numeric value of the currently selected area.
Example:
IF SELECT() = 1
@ 23,0 SAY "PLEASE ENTER MAIN DATA"
ENDIF
IF SELECT() = 2
@ 23,0 SAY "PLEASE ENTER SECONDARY DATA"
ENDIF
>>> TRANSFORM()
SYNTAX: TRANSFORM(<exp>,<picture>)
NOTES: Returns a character string with the specified picture.
Picture options are those available in the @...SAY...GET
command. Same as dBASE III PLUS.
Example:
? TRANSFORM( 123456789, "###,###,###")
*Returns 123,456,789
>>> UPDATED()
NOTES: TRUE if the last READ changed any data in the associated
GETs.
>>> WORD()
SYNTAX: CALL <process> WITH WORD(expN)
NOTES: Converts numeric parameters to a CALLed routine from data
type DOUBLE to type INT to reduce the routine's overhead.
IF the value of <expN> does not exceed +-32k, there is no
need to pass a larger parameter. Do NOT use WORD() if
the variable is beyound this range.
**************** ADDENDUM TO THE DOCUMENTATION *****************
* Differences between dBASE and Clipper *
* Chapter 3 *
>>> Filenames
Program and procedure names are evaluated by Clipper like
any other identifier (memvars, alias's, etc.). Therefore,
hyphens are not allowed in filenames. To be consistent,
use the underscore to to make identifiers more readable.
Do not begin procedures with the underscore, however.
>>> Memory variables
Clipper will allow up to 2,048 public and private memory
variables before returning an error message. An array
counts as one of these memory varibles. Each array may
contain another 2048 memory elements.
Fields always take precedence over memory variables of the
same name unless the "M" alias is used.
>>> Procedures in program files
Procedures and functions may be placed in the same file with
the calling program. Clipper imposes no limits to the
number of procedures and functions in a file.
>>> SET FORMAT TO
Clipper does not CLEAR the screen before executiing format
files. Commands, however, are allowed in format files.
This allows more flexibility when using format files.
* Clipper Commands and Functions *
* Chapter 4 *
>>> CALL
SYNTAX: CALL <proc> WITH <expr>
NOTES: Two additional features have been added to CALL to
provide more compatibility with dBASE III PLUS.
1) DX:BX and ES:BX registers point to the first parameter,
similar to the dBASE III PLUS "standard" DS:BX
(DS is reserved due to upward compatability)
The only commands to add to a LOAD module are
"PUBLIC <proc>" and
"MOV DS,DX"
2) The WORD() function converts numeric parameters from
type DOUBLE to type INT to reduce the overhead of the
CALLed routine. (See ADDITIONAL FUNCTIONS)
>>> DISPLAY [OFF] [scope] <field list> [FOR <condition>]
[WHILE <condition>] [TO PRINT/TO FILE <filename>]
NOTES: TO PRINT and TO FILE have been added to the syntax.
>>> INDEX - Indexing on the trim of a field
Index key sizes under Clipper are calculated by evaluating
the index expression on a blank record. Therefore, the
TRIM() of a field evaluates to a null string. An index can
be built on the trim of a field, however, if a number of
spaces equal to the length of the trimmed fields is added
to the end of the key expression. For example;
INDEX ON TRIM(lname) + ", " + TRIM(fname) + " ";
+ SPACE(LEN( lname + fname )) TO Trimntx
>>> LABEL
Contents of a LABEL field must be a valid expression.
Clipper will ignore anything following a comma in a label.
dBASE Clipper
----- -------
Fname,Lname TRIM(Fname) + " " + Lname
>>> LIST [OFF] [scope] <field list> [FOR <condition>]
[WHILE <condition>] [TO PRINT/TO FILE <filename>]
NOTES: TO PRINT and TO FILE have been added to the syntax.
>>> REPORT FORM
Clipper will generate a runtime error whenever an attempt is
made to divide by zero. This can sometimes occur in REPORTs
when dividing by a numeric field that has been left blank.
The following function will suppress the error and return
zero if an attempt is made to divide by zero.
FUNCTION ZERO
PARAMETERS znum1,znum2
IF znum2 <> 0
RETURN (znum1/znum2)
ENDIF
RETURN (0)
If the first expression evaluates to true, the division will
be executed. Otherwise, a zero will be returned.
>>> SET COLOR TO
NOTES: SET COLOR TO accepts numbers or letters as parameters.
Do not mix the letters with numbers. The "+" and "*"
for high intensity and flashing are only supported with
letters and only affect the foreground.
When the numbers are used, the number to the left of the
slash is written to the high order 4 bits of the color
attribute byte and the number to the right is written to the
low order 4 bits.
----------------------------
| Color | Number | Letter |
----------------------------
| Black | 0 | N |
| Blue | 1 | B |
| Green | 2 | G |
| Cyan | 3 | BG |
| Red | 4 | R |
| Magenta| 5 | RB |
| Brown | 6 | GR |
| White | 7 | W |
----------------------------
Example: To set color for SAYs flashing red on blue, GETs white
on black, with a blue border.
SET COLOR TO R*/B,W/N,B
>>> SET ESCAPE ON/off
NOTES: ON - default
Escape from GET...READ ignores VALID and Alt-C allows
program termination.
OFF
Will not allow escape to terminate a READ.
Alt-C is ignored.
>>> SET PATH TO <path list>
Continuation with semi-colon is not supported with the SET PATH
command.
SET PATH TO A:\INVENTORY,; && not ok
B:\VENDORS
* this is ok
SET PATH TO A:\INVENTORY, B:\VENDORS
>>> SKIP - New options
SYNTAX: SKIP [expN] [ALIAS <selection>]
NOTES: Allows the record pointer of an area not currently
selected to be moved.
Example:
SKIP ALIAS 4
* Same as
SELECT 4
SKIP
SELECT 1
SKIP 3 ALIAS ACCOUNTS
* Same as
SELECT ACCOUNTS
SKIP 3
SELECT 1
>>> TEXT [TO PRINT/TO FILE <filename>] ... ENDTEXT
NOTES: TO PRINT and TO FILE have been added to the syntax.
>>> TYPE <file> [TO PRINT] [TO FILE <filename>]
NOTES: DOS redirection with the ">" is no longer supported as
documented on page 4 - 42. TO PRINT and TO FILE are
new options.
* FUNCTIONS *
>>> INKEY() - New options
NOTES: Two new options have been added to the INKEY() function.
INKEY(0) && waits for a key to be pressed
INKEY(<expN>) && <n> > 0.00 waits <n> seconds for key
When zero is used as the parameter, the program halts
until a key is pressed. The numeric value returned is
the ASCII value of the key pressed.
When a number greater than zero is the parameter, the
INKEY() delays program execution for that number of
seconds or until a key is pressed. Zero is returned if a
key was not pressed and LASTKEY() is not changed. This
time value uses the operating system clock and is
independent of microprocessor speed.
The value returned from INKEY() is always the key value.
setting a function key will not change its key value.
Example:
? "Copyright 1986, EMULSIFIED SOFTWARE"
? INKEY(5) && pause 5 seconds and
CLEAR && clear the screen.
>>> SUBSTR()
The SUBSTR() function always returns a null string if the
start and length parameters point beyond the end of the
string.
*************** dBASE III PLUS COMPATABILITY *******************
The compiler now recognizes IIF() and RECCOUNT(). These are the
same as the IF() and LASTREC() functions.
The enclosed file, Extend.doc, details the use of the Extended
Library that gives Clipper compatability with most of the
functions in the Developer's Release of dBASE III and dBASE III
PLUS. It also demonstrates how to custom tailor Clipper to your
programming needs.
the numeri