REM --- String and Math Function Test ---

GREETING$ = "   Hello, World!   "
PRINT "Original: '"; GREETING$; "'"
PRINT "Trimmed: '"; TRIM$(GREETING$); "'"
PRINT "Length of trimmed: "; LEN(TRIM$(GREETING$))
PRINT

PRINT "LEFT 5: "; LEFT$(TRIM$(GREETING$), 5)
PRINT "RIGHT 6: "; RIGHT$(TRIM$(GREETING$), 6)
PRINT "MID from 8 for 5: "; MID$(TRIM$(GREETING$), 8, 5)

PRINT "LOWER: "; LCASE$("THIS IS A TEST")
PRINT "UPPER: "; UCASE$("this is a test")
PRINT

PRINT "ASCII for 'A' is "; ASC("A")
PRINT "Character for 66 is "; CHR$(66)
PRINT

HAYSTACK$ = "the quick brown fox jumps over the lazy dog"
PRINT "Position of 'fox' is "; INSTR$(HAYSTACK$, "fox")
PRINT "Position of 'the' after pos 5 is "; INSTR$(5, HAYSTACK$, "the")
PRINT

PRINT "--- Math Test ---"
X = 90
PRINT "The square root of ";X;" is "; SQR(X)

' Note: SIN/COS/TAN work in radians, not degrees
PI = 3.14159
PRINT "The sine of PI/2 is roughly "; SIN(PI / 2)

PRINT "--- TEST COMPLETE ---"
