What extra features does VARPTR provide?
#6
(06-22-2023, 11:45 PM)TerryRitchie Wrote:
(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.

So how's using STR$ inside draw routines bad and when does it come into play slowing things down? The speed of today's hardware really masks some of these things for me. I used to avoid DRAW because it was so darn slow but these days I've been having fun with it.
Reply


Messages In This Thread
RE: What extra features does VARPTR provide? - by James D Jarvis - 06-22-2023, 11:50 PM



Users browsing this thread: 1 Guest(s)