What happens with RESULT value
RinksCustoms
Posts: 531
·Ok, this is my first attempt at an actual spin application, i know the code may not even work and will need revision, all i would like to know is how do i assign the return value of a mehod from another object to a variable in my application. Do i even need to do this? The manual doesn't really explain this (bookmarks would be nice).
Iv'e tried :·
OBJ
pc··· : "pc_interface"
VAR
long··· distance
long··· okay
PUB· main
·· pc.start(30,31) : okay
·· if okay
····· more code...
I've also tried the following two variants:
·· pc.start(30,31) okay :=
and,
·· pc.start(30,31) | okay
attempting to store the methods result in the global var "okay"
and hit F9 and i get "expected end· of line" error. Am i just supposed to go about the prog and not worry about this as if the object reference call automatically stores the results in the global variables? for example, when i use ping.inches (obj.method), which references another object (ping), does the result from ".inches" get stored in the global distance variable for use by my app?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Definetly a E3 (Electronics Engineer Extrodinare!)
"I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
Iv'e tried :·
OBJ
pc··· : "pc_interface"
VAR
long··· distance
long··· okay
PUB· main
·· pc.start(30,31) : okay
·· if okay
····· more code...
I've also tried the following two variants:
·· pc.start(30,31) okay :=
and,
·· pc.start(30,31) | okay
attempting to store the methods result in the global var "okay"
and hit F9 and i get "expected end· of line" error. Am i just supposed to go about the prog and not worry about this as if the object reference call automatically stores the results in the global variables? for example, when i use ping.inches (obj.method), which references another object (ping), does the result from ".inches" get stored in the global distance variable for use by my app?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Definetly a E3 (Electronics Engineer Extrodinare!)
"I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
spin
657B
Comments
assigns the return value of pc.start to okay
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Parallax Forums - If you're ready to learn, we're ready to help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Definetly a E3 (Electronics Engineer Extrodinare!)
"I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"