12-05-2023, 12:19 PM
Quote:What does getArrayLong and setArrayLong do?It is currently being used for an array within the '__g' UDT that contains the handles for all the font sizes. I could have well used a normal array but, I'm trying to limit the number of global variables.
Here is an example of the code usage.
Code: (Select All)
' String Array Test
' Arrays must start at index 1
TYPE tUDT
longArray AS STRING * 1028 ' arraysize * 4 + 4
END TYPE
DIM udt AS tUDT
DIM iter AS LONG
FOR iter = 1 TO 256
setArrayLong udt.longArray, iter, iter * 2000000
PRINT iter; ": "; getArrayLong(udt.longArray, iter)
NEXT
FUNCTION getArrayLong& (s AS STRING, p AS LONG)
IF p > 0 AND p * 4 + 4 <= LEN(s) THEN getArrayLong = CVL(MID$(s, p * 4, 4))
END FUNCTION
SUB setArrayLong (s AS STRING, p AS LONG, v AS LONG)
IF p > 0 AND p * 4 + 4 <= LEN(s) THEN MID$(s, p * 4) = MKL$(v)
END SUB
2D physics engine https://github.com/mechatronic3000/fzxNGN
Untitled Rouge-like https://github.com/mechatronic3000/Untitled-Rougelike
QB Pool https://github.com/mechatronic3000/QBPool
Untitled Rouge-like https://github.com/mechatronic3000/Untitled-Rougelike
QB Pool https://github.com/mechatronic3000/QBPool