Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XBase Command List 1

Status
Not open for further replies.

richardy

IS-IT--Management
Oct 24, 2002
397
GB
ACCDATE(<string>)
returns a date value for <string>, where string is a valid GoldMine AccountNo.
example: ACCDATE(Contact1->ACCOUNTNO)
returns: 4/20/99


AGE(<date>)
returns the age in years since <date>
example: AGE(Contact2->UBDATE)
returns: 32


ALLTRIM(<string>)
returns a string value with both leading and trailing spaces from <string>
example: &quot;[&quot;+ALLTRIM(&quot; This is a test &quot;)+&quot;]&quot;
returns: [This is a test]


ASC(<char>)
returns the ASCII decimal value for <char>
example: ASC(&quot;A&quot;)
returns: 65


AT(<string1>,<string2>)
returns the first position of <string1> in <string2>.
example: AT(&quot;a&quot;, &quot;once upon a time&quot;)
returns: 11


CEILING(<number>)
returns the nearest integer that is greater than or equal to the numeric expression
example: CEILING(3.1)
returns: 4


CHR(<byte>)
returns the ASCII character value for <byte>
example: CHR(65)
returns: A


COUNTER(<string>, <inc>, <start>, <action>)
returns a sequence of consecutive numbers each time the expression is evaluated. The counter <name> must be unique and up to 10 character long. Each evaluation of the function increments the counter by the <inc> value. The <start> and <action> parameters are optional. When <action> is 1, the <start> value is used to reset the counter. The counter is deleted when <action> is 2. COUNTER works similarly to the SEQUENCE function. The key difference is that COUNTER stores the count value between GoldMine sessions, and is shared by all GoldMine users. The SEQUENCE counter is local to the operation, and its count is lost at the end of the operation. Since the COUNTER function updates a database counter, it is much slower than SEQUENCE which updates a memory counter.
GoldMine can track and unlimited number of counters, each with a unique name. The counter values are stored in the LOOKUP table.
example: COUNTER(&quot;InvoiceNo&quot;, 1, 1000)
returns: 1000


CTOD(<string>)
returns a date value based on <string>. <string> should be in the format: mm/dd/yy
example: CTOD(&quot;4/20/99&quot;)+5
returns: 4/25/99


DATE()
returns today's date i3n date format.
example assuming todays date is 4/20/99: DATE()+7
returns: 4/27/99


DAY(<date>)
returns that day of the month for the specified <date>
example: DAY(DATE())
returns: 18


DOBINDAYS(<date>)
returns the number of days until the month/day in <date>
example: DOBINDAYS(STOD(&quot;19681024&quot;))
returns: 232


DOW(<date>)
returns the day of the week in numeric format. sunday = 0, monday = 1, etc..
example: DOW(STOD(&quot;19990909&quot;))
returns: 4


DOY(<date>)
returns the number of days elapsed from the beginning of the year in <date> up to the month/day in <date>
example: DOY(Contact2->UDATE)
returns: 220


DTOC(<date>)
returns a character string (MM/DD/YY format) derived from <date>
example: DTOC(Contact2->UDATE)
returns: 10/24/98


DTOS(<date>)
returns a character string (YYYYMMDD format) derived from <date>
example: DTOS(Contact2->UDATE)
returns: 19981024


FLOOR(<number>)
returns the nearest integer that is less than or equal to the numeric expression
example: FLOOR(2.8)
returns: 2


FMTTIME(<time>)
returns a character string (hh:mmap format) derived from <time>
example: FMTTIME(TIME())
returns: 2:28p


HTTPSTR(<string>)
returns <string> with all non-letter/number characters replaced with %values.
example: HTTPSTR(&quot; dir/&quot;)
returns:

INT(<number>)
returns the integer part of a number without rounding
example: INT(123.95)
returns: 123


LEFT(<string>, <length>)
returns the leftmost <length> characters from <string>
example: LEFT(&quot;Four score and seven&quot;,10)
returns: Four score


LEN
see LENGTH


LENGTH(<string>)
returns the length of <string>
example: LENGTH(&quot;This is a test&quot;)
returns: 14


LOWER(<string>)
returns <string> in lower case
example: LOWER(&quot;TEST THIS FUNCTION&quot;)
returns: test this function


LTRIM(<string>)
returns <string> with all left most spaces removed
example: &quot;[&quot; + LTRIM(&quot; This is a test &quot; + &quot;]&quot;
returns: [This is a test ]
example:
returns:


LTRIMPAD(<string>, <length>, <fill>)
returns <string> with leftmost spaces removed and padded to <length> with <fill> character
example: &quot;[&quot;+LTRIMPAD(&quot; 1341&quot;, 10, &quot;0&quot; )+&quot;]&quot;
returns: 0000001341


MID(<string>, <start>, <length>)
returns the string of <length> characters starting at position <start> within <string>
example: MID(&quot;Four score and seven&quot;,6,5)
returns: score


MONTH(<date>)
returns that numeric month for the specified <date>
example: MONTH(Contact2->UDATE)
returns: 2


PAD(<string>, <length>, <mode>)
PAD(<string>, <length>, <fill>, <mode>)
returns <string> padded to <length> with the <fill> character. <fill> is optional and defaults to a space. <mode> can be 0 for right pad (the default), 1 for centered and 2 for left pad.
example: PAD(&quot;TEST&quot;, 8, &quot;x&quot;, 1)
returns: xxTESTxx


PADL(<string>, <length>, <fill>)
PADR(<string>, <length>, <fill>)
returns <string> padded to <length> with the <fill> character. <fill> is optional and defaults to a space. PADR pads the string to the right while PADL pads from the left.
example: PADL(&quot;TEST&quot;, 8, &quot;x&quot;)
returns: xxxxTEST


PROPER(<string>)
returns a string where the first letter of each word in <string> is capitalized and the rest are lower case.
example: PROPER(&quot;fighting IRISH&quot;)
returns: Fighting Irish


RANDOM(<range>)
returns a random number. <range> can be any number between 1 and 32,761. The returned random number will range between zero and <range>, not including the range limit.The <range> parameter defaults to 32,761 if not specified. Random numbers up to 2 billion can be achieved using the expression random(32761) * random(32761).
example: RANDOM(10)
returns: a number between 0 and 9


RAT(<string1>,string2>)
returns the last position of <string1> in <string2>.
example: RAT(&quot;t&quot;, &quot;this is a test.&quot;)
returns: 14


RECCOUNT()
returns the number of records in Contact1
example: RECCOUNT()
returns: 35671


RECNO()
returns the current record number (dBase) or RecID (SQL) for the active Contact1 record.
example: RECNO()
returns: 351


RECNOCOUNT()
returns the currect record number and total records. This function is not available with SQL tables.
example: RECNOCOUNT()
returns: 236 of 2204


RIGHT(<string>, <length>)
returns the rightmost <length> characters from <string>
example: RIGHT(&quot;Four score and seven&quot;,5)
returns: seven


RTRIM(<string>)
returns <string> with all right most spaces removed
example: &quot;[&quot; + RTRIM(&quot; This is a test &quot; + &quot;]&quot;
returns: [ This is a test]


SEQUENCE(<start>, <inc>)
returns a sequence of consecutive numbers each time the expression is evaluated. When the expression is first evaluated, the <start> parameter initializes the counter. Each subsequent evaluation of the function increments the counter by the <inc> value. The SEQUENCE counter is local to the operation, and its count is lost at the end of the operation.


STOD(<string>)
returns a date value based on <string>. <string> should be in the format YYYYMMDD
example: STOD(&quot;19990122&quot;)
returns: 1/22/1999


STR(<value>,<length>,<fill char>)
STR(<value>,<length>,<decimals>,<fill char>)
returns the numeric <value> formatted as a string. All parameters except <value> are optional. The <length> parameter pad the number to the left with spaces, or the with <fill char> if specified.
example: STR(456, 7, 2, &quot;0&quot;)
returns: 0456.00


STRTRAN(<string1>, <string2>, <string3>)
returns a string based on <string1> with all occurences of <string2> translated to <string3>
example: STRTRAN(&quot;A1B1C1D1&quot;, &quot;1&quot;, &quot;x&quot;)
returns: AxBxCxDx


SUBSTR(<string>, <start>, <length>)
returns the string of <length> characters starting at position <start> within <string>
example: SUBSTR(&quot;Four score and seven&quot;,6,5)
returns: score


TIME()
returns the current time
example: TIME()
returns: 14:56:22


TRIM(<string>)
see RTRIM


UPPER(<string>)
returns the <string> in uppercase.
example: UPPER(&quot;this is a test&quot;)
returns: THIS IS A TEST


VAL(<string>)
converts <string> to a numeric value
example: VAL(&quot;123.45&quot;)
returns: 123.45


WDATE(<date>, <format>)
returns the <date> formatted in variety of ways, based on the optional parameter <format>.

<format>
0 mmm dd, yy Jan 22, 97
1 ddd, mmm dd, yy Thu, Jan 22, 97
2 mmm dd Jan 22
3 Long date style Thursday, Jan 22, 1997

The Long date style format 3 is taken from the Windows Regional Settings.
example: WDATE(Contact2->UDATE, 1)
returns: Thu, Jan 22, 97


YEAR(<date>)
returns the numeric year value of <date>
example: YEAR(Contact2->UDATE)
returns: 1999
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top