Customizing Features for Your Practice > Using PracticeScript > Using Functions
The Strings category contains the following functions:
Left
Function |
Left |
Location in PracticeScript |
Functions->Strings |
Purpose |
Returns the specified number of leftmost characters from a character string. |
Format |
Left(Expression, Characters) Expression specifies the character expression whose leftmost characters are returned. Characters specifies the number of characters returned from the character expression. Left( ) returns the entire character expression if Characters is greater than the length of Expression. Left( ) returns an empty string if Characters is negative or 0. |
Evaluates to |
Characters are returned beginning with the first character on the left and continuing for a specified number of characters. |
Example |
Left("Melvin Jones", 5) Left(Person.LastName, 5) |
Right
Function |
Right |
Location in PracticeScript |
Functions->Strings |
Purpose |
Returns the specified number of rightmost characters from a character string. |
Format |
Right(Expression, Characters) Expression specifies the character expression whose rightmost characters are returned. Characters specifies the number of characters returned from the character expression. Right returns the entire character expression if Characters is greater than the length of Expression. Right returns an empty string if Characters is negative or 0. |
Evaluates to |
Characters are returned beginning with the last character on the right and continuing for a specified number of characters. |
Example |
Right("Melvin Jones", 5) Right(Person.LastName, 5 |
SubStr
Function |
SubStr |
Location in PracticeScript |
Functions->Strings |
Purpose |
Returns a character string from the given character expression. |
Format |
SubStr(Expression, StartPosition, OptionalCharactersReturned) Expression specifies the character expression from which the character string is returned. StartPosition specifies the position in the character expression Expression from where the character string is returned. The first character of Expression is position 1. OptionalCharactersReturned specifies the number of characters to return from Expression. If you omit OptionalCharactersReturned, characters are returned until the end of the character expression is reached. |
Evaluates to |
A character string from a character expression, starting at a specified position in the character expression and continuing for a specified number of characters. |
Example |
SubStr("Melvin", 1, 3) SubStr("Melvin", 2, 2) SubStr("Melvin", 4) |
Char
Function |
Char |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Location in PracticeScript |
Functions->Strings |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Purpose |
Returns the character associated with the specified numeric ANSI code. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format |
Char(ANSICode). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Evaluates to |
A single character corresponding to the numeric position of the character in the ANSI character table. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example |
Char(65) returns "A". Char(49) returns "1".
|
Format
Function |
Format |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Location in PracticeScript |
Functions->Strings |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Purpose |
Returns a character string from a numeric expression in a format determined by a format code. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format |
Format(Expression, FormatCode) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Evaluates to |
Formatted character string. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example |
Integer numbers may also have the following characters in their output picture: 8 An octal digit. H A hexadecimal digit. The different number bases MAY NOT BE MIXED!
|
PadRight
Function |
PadRight |
Location in PracticeScript |
Functions->Strings |
Purpose |
Returns a string of characters from an expression, padded with spaces or other characters on the right side to a specified length. If the expression has more characters than the specified length, PadRight() drops the excess characters off of the left end. |
Format |
PadRight(Expression, ResultSize, OptionalPadCharacter) |
Evaluates to |
A character string. |
Example |
PadRight("Hello", 10, "!") Returns "Hello!!!!!" PadRight("Test", 5) Returns "Test " (note the trailing space) PadRight(Person.LastName, 8, "X") Evaluates to "SmithXXX" if the person's last name is Smith.; Evaluates to "Zebriski" if the person's last name is Zebriski. Evaluates to "gemiller" if the person's last name is Stegemiller. |
PadLeft
Function |
PadLeft |
Location in PracticeScript |
Functions->Strings |
Purpose |
Returns a string of characters from an expression, padded with spaces or other characters on the left side, to a specified length. If the expression has more characters than the specified length, PadLeft() drops the excess characters off of the right end. |
Format |
PadLeft(Expression, ResultSize, OptionalPadCharacter)Expression specifies the expression to be padded. ResultSize specifies the total number of characters in the expression after it is padded. OptionalPadCharacter specifies the value to use for padding. This value is repeated as necessary to pad the expression to the ResultSize. If you omit OptionalPadCharacter, spaces (ANSI character 32) are used for padding. |
Evaluates to |
A character string. |
Example |
PadLeft("Hello", 10, "!") PadLeft("Test'", 5) PadLeft(Person.LastName, 8, "X") |
TrimRight
Function |
TrimRight |
Location in PracticeScript |
Functions->Strings |
Purpose |
Returns a character string that results from removing the trailing blanks from a character expression. |
Format |
TrimRight(Expression) |
Evaluates to |
A character string. |
Example |
TrimRight("Hello ") |
TrimLeft
Function |
TrimLeft |
Location in PracticeScript |
Functions->Strings |
Purpose |
Returns a character string that results from removing the leading blanks from a character expression. |
Format |
TrimLeft(Expression) |
Evaluates to |
A character string. |
Example |
TrimLeft(" Hello") |
TrimAll
Function |
TrimAll |
Location in PracticeScript |
Functions->Strings |
Purpose |
Returns a character string that results from removing the leading and trailing blanks from a character expression. |
Format |
TrimAll(Expression) |
Evaluates to |
A character string. |
Example |
TrimAll(" Hello ") |