home *** CD-ROM | disk | FTP | other *** search
- (c) 1987 D. M. Sampson Consulting
- David M. Sampson, Technical Support
- Data Based Solutions, Inc.
- Publisher of the DATA BASED ADVISOR
-
- Documentation for the functions found in the DMS library.
-
- FUNCTION: APPROX
-
- SYNTAX: APPROX(<expC>,<expN>)
-
- expC = the Character expression you want to look for
- expN = the field number your data base file is indexed on
-
- DESCRIPTION: APPROX will first attempt a SEEK to find an exact match.if
- one is found then it returns with the record pointer
- looking at the correct record. The same as a straight SEEK
-
- if the SEEK is unsuccessful then the function returns
- with the record pointer looking at the record which would
- have been the next record down from the correct record
- had it been there.
-
- if the search is unsuccessful and the record you
- attempted to find would have been the last record in the
- data base then the function will return you to the top of
- the file.
-
- Only Date, Character or Numeric Fields can be used with
- this function, if any other type of field is specified
- you will get a Run Time Error: ... and the program will
- close all databases and abort to the dos prompt.
-
- APPROX returns the record number of the record found
- according to the description above. You may use this
- record number if you would like but it is not necessary.
-
- CAUTION: RECORD NUMBER ONE will be confiscated by this
- function and the information in the key field
- will be deleted.
-
- The paragraph above is NOT referring to the
- first record at the top of the file according
- to the index, which you would find by executing
- the command GO TOP, this is the actual Record
- #1, which you would find by executing the
- command GOTO 1.
-
-
-
-
-
-
-
-
- FUNCTION: FILEHERE
-
- SYNTAX: Filehere( <filename>, <expC1>, <expC2>, <exprC3> )
-
- <filename> = The name of the file you want to search for.
-
- <expC> = 3 available lines of comments to display if
- the file is not found.
-
-
- DESCRIPTION: The filename must include the file extension.
-
- Each character expression can be as long as you would
- like but the function will only display the first 50
- characters. There will be up to 4 lines displayed if a
- file is not found, the first line will be a generic
- statement indicating the file name which was searched for
- and not found. The 3 you pass will be displayed below
- it.
-
- The message will be displayed in the middle of the
- screen, will ask for a single key input, then after
- hitting a key will disappear returning the screen to what
- it looked like before the message.
-
- FILEHERE returns a .T. if the file was found and a .F. if
- it was not found.
-
-
-
- FUNCTION: PRNTON / PRNTOFF
-
- SYNTAX: Prnton() / Prntoff()
-
- DESCRIPTION: The Prntoff Function simply SETs DEVICE TO SCREEN, SETs
- PRINT OFF and SETs CONSOLE ON.
-
- The Prnton Function simply reverses the same three
- commands.
-
- They both return a .T. simply because I couldn't think of
- any thing else to return.
-
-
-
-
-
-
-
-
-
-
-
-
-
- FUNCTION: R2 / R3 / R4
-
- SYNTAX: R2( <exp1>, <exp2N>, <exp3N> )
- R3( <exp1>, <exp2N>, <exp3N>,<exp4N>, <exp5N> )
- R4( <exp1>, <exp2N>, <exp3N>, ... <exp7N> )
-
-
-
- DESCRIPTION: The purpose of these functions is to permit Clipper
- arrays to function as multi dimensinal arrays. The Number
- that is a part of the function name indicates how many
- dimensions that functin will similate.
-
- For the 2 dimensional array the last numeric expression
- represents the total number of elements in the major
- axis.
-
- For the 3 dimensional array the last 2 numeric
- expressions represent the total elements in each
- respective axis.
-
- For the 4 dimensional array the last 3 numeric
- expressions represent the total elements in each
- respective axis.
-
- EXAMPLE: Two Dimensional Array:
- store 3 to x,xe && first level
- store 30 to y,ye && lowest level
-
- declare arrayname[xe * ye]
-
- ? arrayname[r2(2,25,xe)] displays the value of the
- 25th position in the 2nd element
-
-
-
- EXAMPLE: Three Dimensional Array:
- store 4 to x,xe
- store 10 to y,ye
- store 8 to z,ze
- declare arrayname[xe * ye * ze]
- ? arrayname[r3(3,9,6,ye,ze)] displays the value in the
- 6th position of the
- 9th Y element of the
- 3rd X element.
-
-
-
-
-
-
-
-
-
-
- FUNCTION: RJUST
-
- SYNTAX: RJUST( <expN1>, <expN2>, <expC> )
-
- <expN1> = Row you want to display your justified message
- <expN2> = The column at which you want the message to be
- justified.
- <expC> = The message you want displayed.
-
-
- DESCRIPTION: This function displays any message on the screen right
- justified against the <expN2> column.
-
- EXAMPLE: chr1 = 'This message will be justified'
-
- RJUST(23,60,chr1) && This will display this:
-
- This message will be justified
- ^
- |
- Column #60 ----
-
- RJUST(23,40,chr1) && will diplay this:
-
-
- This message will be justified
- ^
- |
- Column #40 --
-
-
- FUNCTION: CENTER
-
- SYNTAX: CENTER( <expN>, <expC> )
-
- <expN> = The row you want to center your message on
- <expC> = The message you want centered
-
- DESCRIPTION: CENTER takes the expression in <expC> and displays it
- centered on row <expN>.
-
- Center assumes an 80 column screen. if you don't have an
- 80 column screen this won't work for you.
-
- EXAMPLE: CENTER(23,chr1) && This will display these on your screen
-
- chr1 = 'This will be centered'
-
- This will be centered
-
- chr1 = 'This line will also be centered on line 23'
-
- This line will also be centered on line 23
-
-
- FUNCTION: LOOKUP
-
- SYNTAX: LOOKUP( <expC1>, <expC2>, <expN> )
-
- DESCRIPTION: LOOKUP is normally attached to a VALID clause to do an
- automatic 'Lookup' after data input in a GET variable.
-
- LOOKUP saves the current work area, moves to the workarea
- with the <expC2> alias, does a SEEK on <expC1>.
-
- If the SEEK is successful then the value in FIELD(<expN>)
- is displayed 2 columns to the right of the GET variable.
-
- If the SEEK is unsuccessful then a window is displayed
- showing all possible choices and the cursor is placed back
- in the variable waiting for further input.
-
-
- EXAMPLE: Select 0
- use account index code alias wa_acc
- Select 0
- use transact alias tran
-
-
- ** The account.dbf has a structure like this:
-
- ACCTCODE C 4
- ACCTDESC C 20
-
- @ 23,20 say 'Account Code: ' get acct valid;
-
- lookup(acct,'wa_acc',2)
-
- The above source code would move to the WA_ACC work area,
- do a search with 'acct' (ie the get variable) as its
- expression and if succesful would display ACCTDESC (the
- field data) to the right of the variable ACCT then return
- to the TRAN workarea
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FUNCTION: IMPLODE / EXPLODE
-
- SYNTAX: EXPLODE( <top>, <lft>, <bot>, <rit>, <inc> )
-
- <top> = the top most row where the window will endup
- <lft> = the left most column where the window will endup
- <bot> = the bottom most row where the window will endup
- <rit> = the right most column where the window will endup
- <inc> = the number of times you want the window to increment
- as it is growing to its largest size.
-
-
- DESCRIPTION: EXPLODE starts from the center of the anticipated window
- and grows in an 'exploding' fashion until it grows to its
- ultimate size.
-
- These windows are able to be displayed anywhere on the
- screen.
-
- <inc> can not be 0 or you will get a 'DIVIDE BY 0'
- message.
-
- IMPLODE does the exact opposite. It starts where the
- window is right now and shrinks it in an 'imploding'
- fashion to the center of the window.
-
- The <inc> value in each do not have to be the same.
-
- EXAMPLE: EXPLODE(05,20,19,40,08)
-
- A window will be 'exploded' into position and end up with
- the upper left hand corner at coordinates (row 5, col 20)
- and the lower right hand corner at coordinates (row 29,
- col 40) and it will 'explode' in 08 increments.
-
-
- IMPLODE(10,01,14,78,05)
-
- A window will 'implode' (ie shrink) starting from the
- upper left hand corner at coordinates (row 10, col 01) and
- the lower right hand corner being at coordinates (row 14,
- col 78) and will 'implode' in 05 increments.
-
-
-
-
-
-
-
-
-
-
-
-
-
- FUNCTION: RESPONSE
-
- SYNTAX: RESPONSE( <expC1>, <expC2>, <expN>, <expC3> )
-
- <expC1> &
- <expC2> = 2 lines of messages to be displayed
- they will be displayed on lines 23, 24
- <expN> = A numeric value for the number of seconds you
- want the messages to appear.
- <expC3> = Character string for those keys which are valid
- responses.
-
- DESCREPTION: This function is an enhancement of the dBase WAIT command.
- <expC1> and <expC2> will both be centered on rows 23 and
- 24 respectivly. The messages will stay on the screen for
- <expN> real seconds, or until a key is pressed if <expN>
- equals 0.
-
- Only those Characters in <expC3> will return a .T., if a
- key other than those which are a part of <expC3> is
- pressed this function will return a .F. .
-
- If you do not want to specifiy which keys they have to
- press replace <expC3> with the string 'ALL' or 'all' (case
- is ignored) and it will return a .T. no matter what key
- they press.
-
- If <expN> is greater than 0 then <expC3> must be = 'all'
- or the message will wait <expN> seconds beep and display
- the message again in an endless loop.
-
- EXAMPLE: chr1 = 'Press one of the following keys'
- chr2 = '(A)bort (R)etry (I) dont know what to do!!'
-
- do while .not. RESPONSE(chr1,chr2,0,'ari')
- ?? chr(07)
- enddo
-
- The the following will be displayed on rows 23 & 24:
-
- Press one of the following keys
- (A)bort (R)etry (I) dont know what to do!!
-
- this code will beep once if any key other than a, r or i
- is pressed then return to the RESPONSE function.
-
- chr1 = 'You have just blown it and if you want to and'
- chr2 = 'don't quit you'll blow it again!!
-
- RESPONSE(chr1,chr2,10,'all')
-
- This code will display the following for 10 real seconds:
-
- You have just blown it and if you want to and
- don't quit you'll blow it again!!
- FUNCTION: NDEXDISP
-
- SYNTAX: NDEXDISP( <expN>, <expC> )
-
- <expN> = row you want your message to be displayed
- <expC> = the message you want displayed
-
-
- DESCRIPTION: One of the things wrong with commands like INDEX, DELETE
- and REINDEX is that they take over and you have no control
- over the diplay or how and when to quit in the middle of
- one of their runs, well, thanks to Nantucket those days
- are over. All you have to do is attach this little
- function onto the index expression as one of the elements
- (or onto one of the DELETE FOR/WHILE conditions) and you
- will be able to display all of what you want and even more
- during any of those command processes. This even works
- with many other commands.
-
-
- EXAMPLE: chr1 = 'Indexing Record #'
- index on lastname+frstname+NDEXDISP(24,chr1) to name.ntx
-
- During the index processing on row #24 you will see this
- displayed on your screen.
-
- Indexing Record # <cur_rec#> of <total records>
-
- <cur_rec#> will race through displaying each record number
- as it progresses.
-
- <total records> will constantly display the same number
- which will be equivilant to the total records in the data
- base.
-
- Each time the index file is accessed this will be
- displayed, even after the actual indexing is finished. In
- other words if you REINDEX, SEEK, FIND or PACK this
- message will show up on line #24 (or what ever number you
- set)
-