gaslouk
Full Member
Hi from beautiful Greece.
Posts: 130
|
Post by gaslouk on Feb 10, 2023 13:19:00 GMT -5
Hi.
What is "RetVal=0"?
RetVal is return Value? Where i can useit?
Gaslouk.
|
|
|
Post by Rod on Feb 10, 2023 13:41:53 GMT -5
When you call an API routine it usually returns a value that tells you whether it succeeded or failed. Some API calls do something obvious but even so you still need a way to know it succeeded. Say drawing to a screen, did it succeed or did it fail you cannot see the screen programatically but you can read the return value.
|
|
gaslouk
Full Member
Hi from beautiful Greece.
Posts: 130
|
Post by gaslouk on Feb 11, 2023 12:11:58 GMT -5
Thank you very much Rod but I would like a more specific answer. Let's say "RetVal = FN.somthing()". Is it a command or something else? What other uses does it have?
Thank you very much for your time.
|
|
|
Post by Rod on Feb 11, 2023 12:28:44 GMT -5
It is simply a variable named RetVal. Unless you can set its use in better context. Most API calls return a flag saying true or false, programmers store that response in a variety of variable names.
|
|
|
Post by Walt Decker on Feb 11, 2023 16:08:06 GMT -5
Thank you very much Rod but I would like a more specific answer. Let's say "RetVal = FN.somthing()". Is it a command or something else? What other uses does it have? Thank you very much for your time. In the above "RetVal" is the return from "FUNCTION FN.something()".
For example: ' GLOBAL SomeNumber SomeNumber = 36 RetVal = FUNCTION FN.something()
PRINT RetVal WAIT
'-------------------------------- '--------------------------------
FUNCTION FN.something()
SomeNumber = SomeNumber^1/3 FN.something = SomeNumber END FUNCTION '
In other instances it may be the return value from an API or second party DLL call. In these instances "RetVal" may be boolean (zero, not zero); in others "RetVal" may contain 2 numbers since some API functions return a value containing two separate numbers, perhaps coordinates. Some second party DLLs do the same thing. Sometimes the return value is the address or pointer to a block of memory the API or second party DLL created in response to calling the function.
|
|
gaslouk
Full Member
Hi from beautiful Greece.
Posts: 130
|
Post by gaslouk on Feb 13, 2023 11:37:13 GMT -5
Thank you Walt Decker Thank you very much Rod but I would like a more specific answer. Let's say "RetVal = FN.somthing()". Is it a command or something else? What other uses does it have? Thank you very much for your time. In the above "RetVal" is the return from "FUNCTION FN.something()".
For example: ' GLOBAL SomeNumber SomeNumber = 36 RetVal = FUNCTION FN.something()
PRINT RetVal WAIT
'-------------------------------- '--------------------------------
FUNCTION FN.something()
SomeNumber = SomeNumber^1/3 FN.something = SomeNumber END FUNCTION '
In other instances it may be the return value from an API or second party DLL call. In these instances "RetVal" may be boolean (zero, not zero); in others "RetVal" may contain 2 numbers since some API functions return a value containing two separate numbers, perhaps coordinates. Some second party DLLs do the same thing. Sometimes the return value is the address or pointer to a block of memory the API or second party DLL created in response to calling the function.
|
|