Function Conversion Charts
The following charts show the equivalent functions between Basic syntax and Crystal syntax. Though many are the same, each table does have a few variations listed. The tables use the same table numbers so that you know where they are in the book and you can reference the sections if you need more information.
Table 6-1. String Analysis Functions
Basic Syntax | Crystal Syntax |
---|---|
Asc(str) | Asc(str) |
Chr(val) | Chr(val) |
Len(str) | Length(str) |
IsNumeric(str) | IsNumeric |
InStr(start, str1, str2, compare) | InStr(start, str1, str2, compare) |
InStrRev(start, str1, str2, compare) | InStrRev(start, str1, str2, compare) |
StrCmp(str1, str2, compare) | StrCmp(str1, str2, compare) |
Val(str) | Val(str) |
Table 6-3. String Parsing Functions
Basic Syntax | Crystal Syntax |
---|---|
Trim(str) | Trim(str) |
LTrim(str) | TrimLeft(str) |
RTrim(str) | TrimRight(str) |
Mid(str, start, length) | Mid(str, start, length) |
Left(str, length) | Left(str, length) |
Right(str, length) | Right(str, length) |
Table 6-4. String Manipulation Functions
Basic Syntax | Crystal Syntax |
---|---|
Filter(str, find, include, compare) | Filter(str, find, include, compare) |
Replace(str, find, replace, start, | count, compare) |
Replace(str, find, replace, start, | count, compare) |
StrReverse(str) | StrReverse(str) |
ReplicateString(str, copies) | ReplicateString(str, copies) |
Space(val) | Space(val) |
Join(list, delimiter) | Join(list, delimiter) |
Split(str, delimiter, count, compare) | Split(str, delimiter, count, compare) |
Picture(str, template) | Picture(str, template) |