QB64 Phoenix Edition
Speedreading books. - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7)
+---- Thread: Speedreading books. (/showthread.php?tid=2205)

Pages: 1 2 3


RE: Speedreading books. - grymmjack - 12-01-2023

This is very cool @justsomeguy. Hit a bug.

Line: 554 (in main module)
Subscript out of range
Continue?

Attaching the source file I was reading.

I think I would use something like this for sure. Appreciate you working on it.


RE: Speedreading books. - justsomeguy - 12-01-2023

@grymmjack

I pushed an update that will hopefully take care of the bug. Thanks, for pointing it out!

Cheers

https://github.com/mechatronic3000/speedreader


RE: Speedreading books. - grymmjack - 12-05-2023

Thanks I will check it out. What does getArrayLong and setArrayLong do? I see CVL for get and MKL for set. Can you explain what this does in your program? It looks useful possibly is why I ask.


RE: Speedreading books. - justsomeguy - 12-05-2023

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