Shop OBEX P1 Docs P2 Docs Learn Events
What happens with RESULT value — Parallax Forums

What happens with RESULT value

RinksCustomsRinksCustoms Posts: 531
edited 2007-06-10 19:24 in Propeller 1
confused.gif·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!"

Comments

  • CJCJ Posts: 470
    edited 2007-06-10 18:16
    okay := pc.start(30, 31)

    assigns the return value of pc.start to okay

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax Forums - If you're ready to learn, we're ready to help.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-06-10 19:24
    ooooohhhhhhh, DUHH! sorry had a DE-DEDE! moment there, thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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!"
Sign In or Register to comment.