Class UtilityFunctions
java.lang.Object
com.scriptbasic.utility.functions.UtilityFunctions
Static methods in this class are registered in the interpreter when the
interpreter starts. The interpreter calls the static method
MethodRegisterUtility.registerFunctions(Class, Interpreter) and that function
registers the methods in this class with their own name so that BASIC
programs can call the functions like BASIC built in functions.- Author:
- Peter Verhas date July 15, 2012
-
Method Summary
Modifier and TypeMethodDescriptionstatic IntegerReturns an Integer representing the character code corresponding to the first letter in a string.static byte[]byteBuffer(int len) Create a new byte buffer of lengthlen.static Doublestatic StringReturns a String containing the character associated with the specified character code.static Longstatic Longstatic byte[]static Booleanstatic Booleanstatic Booleanstatic Longstatic voidstatic voidstatic voidstatic Objectstatic voidstatic StringstringifyBuffer(byte[] buffer) static Objectundef()This function returns the undef value.
-
Method Details
-
newMagicBean
-
logError
-
logInfo
-
logDebug
-
undef
This function returns the undef value.- Returns:
- the undef value
-
isUndef
- Parameters:
s- is some value or object- Returns:
- true if the parameter is undefined
-
isDefined
- Parameters:
s- is some value or object- Returns:
- true if the parameter is defined (not isUndef).
-
isNull
- Parameters:
s- is some value or object- Returns:
- true if the parameter is null
-
byteBuffer
public static byte[] byteBuffer(int len) Create a new byte buffer of lengthlen.- Parameters:
len- the length of the buffer allocated.- Returns:
- the new buffer
-
getByte
-
setByte
- Throws:
BasicRuntimeException
-
getStringBytes
-
stringifyBuffer
-
length
-
cdbl
- Throws:
BasicRuntimeException
-
clng
- Throws:
BasicRuntimeException
-
chr
Returns a String containing the character associated with the specified character code.- Parameters:
charcode- argument is a Long that identifies a character- Returns:
- character
- Throws:
BasicRuntimeException- fail if incorrect character code
-
asc
Returns an Integer representing the character code corresponding to the first letter in a string.- Parameters:
arg- string argument- Returns:
- character code corresponding to the first letter
- Throws:
BasicRuntimeException- fail on empty input
-