Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Speedreading books.
#24
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
Reply


Messages In This Thread
Speedreading books. - by justsomeguy - 11-27-2023, 06:19 AM
RE: Speedreading books. - by SpriggsySpriggs - 11-27-2023, 06:24 AM
RE: Speedreading books. - by justsomeguy - 11-27-2023, 06:33 AM
RE: Speedreading books. - by SpriggsySpriggs - 11-27-2023, 12:07 PM
RE: Speedreading books. - by bplus - 11-27-2023, 03:38 PM
RE: Speedreading books. - by SpriggsySpriggs - 11-27-2023, 06:04 PM
RE: Speedreading books. - by justsomeguy - 11-28-2023, 11:56 AM
RE: Speedreading books. - by SMcNeill - 11-28-2023, 12:22 PM
RE: Speedreading books. - by bplus - 11-28-2023, 01:56 PM
RE: Speedreading books. - by justsomeguy - 11-29-2023, 10:08 PM
RE: Speedreading books. - by SpriggsySpriggs - 11-30-2023, 12:23 PM
RE: Speedreading books. - by euklides - 12-01-2023, 03:17 PM
RE: Speedreading books. - by SMcNeill - 12-01-2023, 03:22 PM
RE: Speedreading books. - by SpriggsySpriggs - 12-01-2023, 03:59 PM
RE: Speedreading books. - by SMcNeill - 12-01-2023, 04:08 PM
RE: Speedreading books. - by SpriggsySpriggs - 12-01-2023, 05:52 PM
RE: Speedreading books. - by SMcNeill - 12-01-2023, 06:10 PM
RE: Speedreading books. - by SpriggsySpriggs - 12-01-2023, 07:58 PM
RE: Speedreading books. - by SMcNeill - 12-01-2023, 08:13 PM
RE: Speedreading books. - by grymmjack - 12-01-2023, 10:44 PM
RE: Speedreading books. - by grymmjack - 12-01-2023, 10:49 PM
RE: Speedreading books. - by justsomeguy - 12-01-2023, 11:43 PM
RE: Speedreading books. - by grymmjack - 12-05-2023, 05:08 AM
RE: Speedreading books. - by justsomeguy - 12-05-2023, 12:19 PM



Users browsing this thread: 2 Guest(s)