Functions

bool isControlCode bool isNumber bool isAlphabetic bool isAlphaNumeric bool isHex bool isUpperCase bool isLowerCase int UpperToLower int LowerToUpper int ConvertCase void memset int memcpy int memmove void arrayset void strcpy void strncpy void remchr void remnchr int strlen int strcat int strncat int strchr int strrchr int strstr int strspn int strcspn int strcmp int strncmp int atoi int ilen int xtoi int xlen float atof int flen float aton int nlen int itoa int ftoa int ntoa int strcatf int strncatf void sprintf void printf
Back to Top
Pages: Global | FFC | Link | Screen | Item | Weapon | Itemdata | Game | NPC | std | string

string Documentation

Functions and Properties

Return Type Function Information
boolisControlCode(int chr)
Returns true if 'chr' is in the control code range of ascii characters
boolisNumber(int chr)
Returns true if 'chr' is in the range of ascii characters '0' to '9'
boolisAlphabetic(int chr)
Returns true if 'chr' is an alphabetic character
boolisAlphaNumeric(int chr)
Returns true if 'chr' is an alphanumeric character
boolisHex(int chr)
Returns true if 'chr' is in the set { '0'-'9', 'A'-'F' , 'a'-'f' }
boolisUpperCase(int chr)
Returns true if 'chr' is an upper-case character
boolisLowerCase(int chr)
Returns true if 'chr' is a lower-case character
intUpperToLower(int chr)
Converts all upper case characters to lower case, leaving non-alphabetic
characters unchanged
intLowerToUpper(int chr)
Converts all lower case characters to upper case, leaving non-alphabetic
characters unchanged
intConvertCase(int chr)
Converts lower case to upper case and upper case to lower case
voidmemset(int ptr[], int value, int n)
Memory Set
Sets block of memory of size 'n' pointed by 'ptr' to 'value'
intmemcpy(int dest[], int src[], int n)
Memory Copy
Copys block of memory pointed by 'src' of size 'n' to 'dest' and returns
'dest'
intmemmove(int dest[], int src[], int n)
Memory Move
As memcpy, but uses a buffer so memory space can overlap
voidarrayset(int a[], int a0, int a1, int a2, ...)
Array Set
Assign all elements of array 'a'. Overloaded for up to 16 elements
voidstrcpy(int dest[], int src[])
String Copy
Copys string 'src' into string 'dest' without checking for overflow in 'dest'
As strcpy, but only takes the first 'n' characters from src
voidstrncpy(int dest[], int src[], int n)
String Copy
Copys string 'src' into string 'dest' without checking for overflow in 'dest'
As strcpy, but only takes the first 'n' characters from src
voidremchr(int string[])
Remove Characters
Remove all characters starting from pointer 'string'
Remove 'n' characters and shift the rest of the string back to pointer 'string'
voidremnchr(int string[], int n)
Remove Characters
Remove all characters starting from pointer 'string'
Remove 'n' characters and shift the rest of the string back to pointer 'string'
intstrlen(int string[])
String Length
Returns the length of string 'string'
intstrcat(int dest[], int src[])
String Concatenate
Appends string 'src' onto string 'dest' (assuming dest has enough extra memory
allocated to allow the operation)
strcat for the first 'n' characters in src
intstrncat(int dest, int src, int n)
String Concatenate
Appends string 'src' onto string 'dest' (assuming dest has enough extra memory
allocated to allow the operation)
strcat for the first 'n' characters in src
intstrchr(int string[], int character)
String Character
Returns the position of the first occurence of 'character' in 'string',
or -1 if none are found
intstrrchr(int string[], int character)
String Reverse Character
Returns the position of the last occurence of 'character' in 'string'
starting from the end, or -1 if none are found
intstrstr(int string[], int sub[])
String Sub-String
Returns the position of the first occurence of sub-string 'sub' in 'string,
or -1 if sub is not found
intstrspn(int str[], int keys[])
String Span
Returns the length of characters in 'str' before a character not contained in
'keys' is found
intstrcspn(int str[], int keys[])
String Complement Span
Returns the length of characters in 'str' before a character contained in
'keys' is found
intstrcmp(int str1[], int str2[])
String Compare
Iterates through str1 and str2 until a character is found which is not the same in
both strings, and then returns > 0 if the character is larger in str1, and < 0 if it is
larger in str2. Returns 0 if the strings are equal
strcmp up to 'n' characters
intstrncmp(int str1[], int str2[], int n)
String Compare
Iterates through str1 and str2 until a character is found which is not the same in
both strings, and then returns > 0 if the character is larger in str1, and < 0 if it is
larger in str2. Returns 0 if the strings are equal
strcmp up to 'n' characters
intatoi(int string[])
ASCII to Integer
Returns the decimal integer pointed by 'string'
intilen(int string[])
Integer Length
Returns the length of characters of the decimal integer pointed by 'string'
intxtoi(int string[])
Hexadecimal ASCII to Integer
Returns the (positive) hexadecimal integer pointed by 'string'
intxlen(int string[])
Hexadecimal Length
Returns the length of characters of the (positive) hexadecimal integer pointed by 'string'
floatatof(int string[])
ASCII to Float
Returns the floating point number pointed by 'string'
intflen(int string[])
Float Length
Returns the length of characters of the floating point number pointed by 'string'
floataton(int string[])
ASCII to Number
 Returns the number pointed by 'string', calling either atoi or atof depending on context
intnlen(int string[])
Number Length
Returns the length of characters of the number pointed by 'string', calling either
ilen or flen depending on context
intitoa(int string[], int num)
Integer to ASCII
Places integer 'num' into string 'string' without checking for overflow,
and returns the number of characters used
intftoa(int string[], float num, bool printall)
Float to ASCII
Places float 'num' into string 'string' without checking for overflow,
and returns the number of characters used. If 'printall' is true, it will add 4 decimal places
regardless of the most significant digit
intntoa(int string[], float num)
Number to ASCII
Checks whether 'num' is an integer or not, and calls the appropriate function
intstrcatf(int dest[], int arg, int format)
String Concatenate Format
Appends 'arg' onto 'dest' as the MF_ constant passed into 'format'
As strcatf, using only 'n' characters of 'arg'
intstrncatf(int dest[], int arg, int format, int n)
String Concatenate Format
Appends 'arg' onto 'dest' as the MF_ constant passed into 'format'
As strcatf, using only 'n' characters of 'arg'
voidsprintf(int ret[], int formatstr[], int a0, int a1, int a2, ...)
String Print Format
Prints string 'formatstr' into 'ret' according to the arguments inputted (see C function for reference),
returning the number of characters used. Does not check for overflow in 'ret'
Overloaded up to a maximum of 16 arguments. Enter the right number of arguments for your format string;
there is (currently) no way to check how many arguments have been entered or of what type they are
Currently supported arguments:
'%s' - String
'%i' - Integer
'%f' - Float
'%d' - Number (Integer/Float depending on context)
'%n' - Nothing
'%p' - Pointer Address
'%c' - Single character
'%x' - Hexadecimal Integer (lower case)
'%X' - Hexadecimal Integer (upper case)
'\n' places a line feed ASCII character into the string
voidprintf(int formatstr[], int a0, int a1, int a2, ...)
Print Format
Uses a buffer to print the results of sprintf(formatstr,...) straight to allegro.log
Overloaded up to a maximum of 16 arguments