Working with strings, storing string variables, converting to/from integers.


Events: None


Str params:

"DELETE", "String" [, Start [, N]]
---------------------------------
Deletes the N characters from
String, starting Start.
@1: Result string


"LENGTH", "String"
---------------------------------
Returns the length of String
in characters.

"COPY", "String" [, Start [, N]]
---------------------------------
Copies the N characters from
String, starting Start.
@1: Result string

"STRTOINTDEF", "String", Default
---------------------------------
Returns the numeric value of
String, if possible, or Default
otherwise.

"STRTOINT", "Str1" [,"Str2" [,"Str3"]]
---------------------------------
Converts Str1, Str2, Str3 to
numbers if possible.
Otherwise returns 0.
@1,@2,@3: Result numbers

"INTTOSTR", Int1 [,Int2 [,Int3]]
---------------------------------
Converts Int1, Int2, Int3 to
strings.
@1,@2,@3: Result string

"TRIM", "Str1" [,"Str2" [,"Str3"]]
---------------------------------
Removes trailing and leading
spaces from Str1-3.
@1,@2,@3: Result string

"TRIMLEFT", "Str1" [,"Str2" [,"Str3"]]
---------------------------------
Removes leading spaces from
Str1-3.
@1,@2,@3: Result string

"TRIMRIGHT", "Str1" [,"Str2" [,"Str3"]]
---------------------------------
Removes trailing spaces from
Str1-3.
@1,@2,@3: Result string

"POS", "String", "SubString"
---------------------------------
Searches for first occurance of
Substring inside string. Returns
the position of first character,
found. Otherwise returns -1.

"ADD", "Str1" [,"Str2" [,"Str3"]]
---------------------------------
Combines the strings Str1-3, in
the order, passed.
@1: Result string

"SET", Name [, Value]
---------------------------------
Stores the Value in variable Name
If Value is empty (""), variable
is deleted.

"GET", "Name1" [,"Name2" [,"Name3"]]
---------------------------------
Retrieves the variables Name1-3.
If variable not found, empty
string returned.
@1,@2,@3: Variable values

Format, "Arg1" [,Arg2 [,Arg3]]
---------------------------------
Formats the string, specified by
Format, by replacing the %s and %d
values with Arg1-Arg3.
%s is for string variable,
%d is for number.
@1: Result string

StrCmp, "Str1", "Str2"
---------------------------------
Compares one string to another.
Returns:
If Str1 is... return value is...
less than Str2 <0
the same as Str2 =0
greater than Str2 >0


StrCmpI, "Str1", "Str2"
---------------------------------
Compares one string to another,
without case sensitivity.
Returns:
If Str1 is... return value is...
less than Str2 <0
the same as Str2 =0
greater than Str2 >0

Example:
Str( "Abc", "abc" )
t = Str( "STRCMP", @1, @2 )
#t = Str( "STRCMPI", @1, @2 )
skip( 1, t <> 0 )
OSD( "%s = %s", @1, @2 )
skip( 1, t <= 0 )
OSD( "%s > %s", @1, @2 )
skip( 1, t >= 0 )
OSD( "%s < %s", @1, @2 )


Arg1 [,Arg2 [,Arg3 [,Arg4]]]
---------------------------------
Fills @1-4 parametrs with
Arg1-4

Example for swap @1 and @2: Str( @2, @1 )