Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What extra features does VARPTR provide?
#4
(06-22-2023, 01:44 PM)a740g Wrote: VARPTR$ can come in handy when using DRAW or PLAY inside tight loops where you want to avoid the overhead and speed penalty of say string concatenation or other string ops.

Like in the example below, we avoid a string concatenation inside the FOR loop by using VARPTR$ for DRAW. This still works in QB64, thanks to the length Galleon went to emulate such things.

This is probably the only reason I'd use VARPTR$. Else, it is better to avoid such legacy commands.
That's a valid point I should have addressed. When using STR$() more concatenation then comes into play slowing things down considerably.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
RE: What extra features does VARPTR provide? - by TerryRitchie - 06-22-2023, 11:45 PM



Users browsing this thread: 2 Guest(s)