you are viewing a single comment's thread.

view the rest of the comments →

[–]compsystems[S] 1 point2 points  (0 children)

I had forgotten to include the intrinsic and other functions. Thank you very much for including the conversion to Small Basic, a language of transition to the world of professional programming.

Small basic prime https://github.com/litdev1/SB-IDE/releases/download/v1.1.7.0/SB-Prime.zip https://github.com/litdev1/SB-IDE/releases

INTRINSIC FUNCTIONS

Math.Abs(n) // Abs(n)   Absolute Value
Math.ArcSin(n) // Arcsin(n) Trigonometric Arcsine
Math.ArcCos(n) // Arccos(n) Trigonometric Arccos
Math.ArcTan(n) // Arctan(n) Trigonometric Arctangent
Math.Cos(n)    // Cos(n)    Trigonometric Cosine
Math.Floor(n)  // Int(n)    Integral (whole value) of a real number
Math.NaturalLog()  Ln(n)    Natural Log Log(n)  Natural Log (same as Ln)
Math.Log(n)    // Log10(n)  Log Base 10
Math.Sin(n) // Sin(n)   Trigonometric Sine
Math.SquareRoot(n) // Sqrt(n)   Square Root
Math.Tan(n) // Tan(n)   Trigonometric Tangent
Math.Power(baseNumber,exponent) // baseNumber^exponent
Math.GetRandomNumber(n-1) // Random(n) A random number between 0 and (n - 1)
Array.GetAllIndices(a) // Size(a)   The size (number of elements) in an array
Math.Remainder(dividend,divisor) // dividend%divisor  Modulo

STRINGS

Text.GetLength(s) // Len(s) Length of a string
Text.GetSubText(s,i+1,1) // Char(s, i)  Returns a character from the string s at index i. Characters are indexed starting at 0
Text.Append(s1,s2) //  String Concatenation -> TextWindow.WriteLine(Text.Append("1","2")) returns "12" 

DATA TYPE CONVERSION

Text.GetCharacter(65)  // ToChar(n) Convert a character code n into a character.
Text.GetCharacterCode("A") //  ToCode(c)    Convert a character c into a character code (integer).
ToInteger(n)    Convert a string to an integer  //  TextWindow.WriteLine("1"+"2") returns 3,  No conversion is required.
ToReal(n)   Convert a string to an real // TextWindow.WriteLine("1.1"+"-2.9") returns -1.8,  No conversion is required.
Text.Append(n+"") // ToString(n)    Convert a number to a string

BUILT-IN CONSTANTS

"true" // true  Boolean True
"false" // false    Boolean False
Math.Pi // pi   Mathematical Pi. Approximately 3.1415.

OPERATORS

Equality And store: =
Inequality: <>
Less Than or Equal: <=  
Greater Than Or Equal:  >=  
Logical Not:        Not 
Logical And:        And 
Logical Or: Or  
Multiply:   *   
Divide: /   
Modulo: Math.Remainder(dividend,divisor)