Beginner's Programming Tutorial in QBasic

(Kiana) #1

In the above example, the number 15 was stored in the computer's RAM at a certain memory
address. Then the the screen. PRINT command accessed (or looked at) that address when it printed "15" to


( NOTE: The memory address of X is not necessarily 1000000 )

ADVANCED TIP: need to, you can find the actual memory address Although you don't normally
of a variable (X, for example) by using the
VARSEG and VARPTR commands.
PRINT (VARSEG(X) * 65536) + VARPTR(X)
(For more information, see Memory .)

As in the programs above, a variable is accessed by calling its name. Variable names can have acombination of letters and numbers. The following are valid variables:


Y
num
VALUE
xYz
abc
Free download pdf