Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with global UDT's

Status
Not open for further replies.

anthonykulesa

Programmer
Aug 25, 2011
1
US
I am having some trouble getting my UDT variables to be modified by functions. Maybe Im doing something wrong? Here is the code Im using to test it. Its supposed to output 1 2 but it outputs 1 1.

type myType
x as integer
endtype

global myVar as myType

myVar.x = 1
print myVar.x

increase(myVar)

print myVar.x
wait key
end

function increase( t as myType )
t.x = t.x + 1
endfunction


any help is greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top