Can someone explain the usage of VAR to me?

BlitzMax Forums/BlitzMax Programming/Can someone explain the usage of VAR to me?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

In the manual we have two demonstrations of the Var keyword:
Function ReturnMultiplevalues(a Var,b Var,c Var)
	a=10
	b=20
	c=30
	Return
End Function

Local x,y,z

ReturnMultipleValues(x,y,z)

Print "x="+x	'10
Print "y="+y	'20
Print "z="+z	'30

and
Local c[]=[1,2,3,4]
Local p:Int Ptr

p=c
Print "var p="+Var p	'1

p:+1
Print "var p="+Var p	'2

p:+1
Print "var p="+Var p	'3

p:+1
Print "var p="+Var p	'4

Firstly, why does Var come after the variable in the first example and before the variable in the second example?

In the first example, it looks like the variables are being passed "By Reference" so that the actual variables passed are affected by the function call.

In the second example, 'p' is pointing to the first element of the array 'c' and adding 1 to the pointer simply jumps to the next entry (which is one integer 'further up' in this case).

I basically get it, but just wonder if there's some significance as to why Var is not consistantly used in the two examples.

Thanks,
Russell