Where can I find information regarding functions
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Where can I find information regarding functions
Where can I find information regarding functions? I'm looking on how to use them, when to use them, etc for a complete beginner.
Thanks.
Thanks.
Re: Where can I find information regarding functions
Hi Shawnbic,
There is some infos into the dictionary with one example
Here is a very simple to get the result of an addition
on mouseUp
put AddTwoValue(1,2)
end mouseUp
function AddTwoValue pVal1,pVal2
return pVal1 + pVal2
end AddTwoValue
Best regards
There is some infos into the dictionary with one example
Here is a very simple to get the result of an addition
on mouseUp
put AddTwoValue(1,2)
end mouseUp
function AddTwoValue pVal1,pVal2
return pVal1 + pVal2
end AddTwoValue
Best regards
https://alternatic.ch
Re: Where can I find information regarding functions
Shawn...
Have a read of p.134 of the User Guide... 'Custom Commands & Functions'
Dixie
Have a read of p.134 of the User Guide... 'Custom Commands & Functions'
Dixie
Re: Where can I find information regarding functions
Excellent. Thank you Dixie.Dixie wrote:Shawn...
Have a read of p.134 of the User Guide... 'Custom Commands & Functions'
Dixie
I knew I saw something on it before, but couldn't remember where I saw it, the user guide is exactly where I saw it. Gonna read it again now. Thanks again.
-
- Posts: 15
- Joined: Sat Jul 28, 2012 6:48 pm
Re: Where can I find information regarding functions
which is the link to the user guide 
I'm puzzled.
I have added a function to my CARD script, the card is call "mycard"
The function is called "myfunction"
function myfunction
put "hello world" into field "status"
end myfunction
When I use an image script to call myfunction, all variations complain they can't find it (except dispatch which shows no errors)
//dispatch "myfunction" to card "myCard"
//send "myfunction" to "myCard"
//send to "myfunction" of card "myCard"
//call "myfunction"
call "myfunction" to card "myCard"
As you can see, i am not sure of the correct syntax, but I seem to have tried all of the examples.
This must be so simple I can not see it
Any ideas?

I'm puzzled.
I have added a function to my CARD script, the card is call "mycard"
The function is called "myfunction"
function myfunction
put "hello world" into field "status"
end myfunction
When I use an image script to call myfunction, all variations complain they can't find it (except dispatch which shows no errors)
//dispatch "myfunction" to card "myCard"
//send "myfunction" to "myCard"
//send to "myfunction" of card "myCard"
//call "myfunction"
call "myfunction" to card "myCard"
As you can see, i am not sure of the correct syntax, but I seem to have tried all of the examples.
This must be so simple I can not see it

Any ideas?
Re: Where can I find information regarding functions
what are u trying to do?
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
-
- Posts: 15
- Joined: Sat Jul 28, 2012 6:48 pm
Re: Where can I find information regarding functions
What I said.
I'm just trying to call a function in the card scripts, from a button/image in the main stack.
I'm just trying to call a function in the card scripts, from a button/image in the main stack.
Re: Where can I find information regarding functions
Hi SimpleLife,
You open the user guide with the help menu.
A function return a value
Try this:
In the cd or stack script
function myfunction
return "hello world"
end myfunction
In the control script
on mouseup
put myfunction() into fld "status"
end mouseup
Best regards
Jean-Marc
You open the user guide with the help menu.
A function return a value
Try this:
In the cd or stack script
function myfunction
return "hello world"
end myfunction
In the control script
on mouseup
put myfunction() into fld "status"
end mouseup
Best regards
Jean-Marc
https://alternatic.ch
-
- Posts: 15
- Joined: Sat Jul 28, 2012 6:48 pm
Re: Where can I find information regarding functions
HUGE THANKS Jean-Marc 
that was the clue I needed!
It was just the missing brackets for the function
call myfunction()
now works - YAY!

that was the clue I needed!
It was just the missing brackets for the function
call myfunction()
now works - YAY!