User Tools

Site Tools


ugbasic:user:kw:varptr
Translations of this page:


ugBASIC User Manual

VARPTR

SYNTAX

   = VARPTR(var)

PURPOSE

The VARPTR command (short for “variable pointer”) is a pretty advanced statement that lets you get the memory address of a variable. Essentially, it tells you “where” in memory the value of a specific variable is stored.

In some advanced cases, you may want to directly manipulate the contents of memory. This is useful for things like creating custom data structures or optimizing the speed of execution of certain operations.

Directly manipulating memory can lead to program errors that are difficult to detect and correct. If you are not completely sure what you are doing, it is best to avoid using VARPTR.

EXAMPLE

  address = VARPTR(x)

ABBREVIATION

 Vp

AVAILABLE ON

ANY PROBLEM?

If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!

POWERED BY