dim pa as long ptr
dim a, ap as long
a=42
&pa= &a 'pa becomes a reference of a
print "address of a: " + str(@a) + " pa: " + str(@pa)
print "value of a: " + str(a) + " pa: " + str(pa)
print "a + 10 = " + str(a + 10) + " pa + 10 = " + str(pa + 10)
print "*&pa " + str(*&pa) + " is the same as @pa " + str(@pa)
ap = &a 'ap = the address of a"
print "address of a stored in ap " + str(ap)
ap = @a 'another way to say ap = the address of a
print "address of a stored in ap " + str(ap)
print "the value at ap " + str(*ap)
'so when you see &a or @a you read that as: The address of a
'when you see *ap it is the value at ap
'when you use references, &pa = &a, then pa refers directly to the value of a
'again this can be written as &pa = @a also