fonction in a fonction ?
fonction in a fonction ?
hi all
i go to be back scripting under hollywood with sprites and fonctions
my question is : is it possible to make fonction in fonction ?
i mean without any inconenience with rapidity of compiled programm
under os 4 and morphos 3.1 and aros ?
regards to all , thanx by advance and happy new year to all
yogib33r^vitalmotion/x-men
i go to be back scripting under hollywood with sprites and fonctions
my question is : is it possible to make fonction in fonction ?
i mean without any inconenience with rapidity of compiled programm
under os 4 and morphos 3.1 and aros ?
regards to all , thanx by advance and happy new year to all
yogib33r^vitalmotion/x-men
Re: fonction in a fonction ?
Hello steff, why do you need to declare nested functions? Or you just want to call functions from inside other functions?
Example:
As you see mystuff1() calls mystuff2(), is what you are trying to ask?
Example:
Code: Select all
Function mystuff2()
...
EndFunction
Function mystuff1()
...
mystuff2()
EndFunction----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
Re: fonction in a fonction ?
Unless he means a recursive function which is also possible.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com
Re: fonction in a fonction ?
hello gentlemen !
yes i would like to execute a fonction inside another to be executed before
then my question is : is it possible ? and then is it good for pegasos 1
for example as now i sold mine
regards to you
steff
yes i would like to execute a fonction inside another to be executed before
then my question is : is it possible ? and then is it good for pegasos 1
for example as now i sold mine
regards to you
steff
Re: fonction in a fonction ?
Sorry Steff, but I'm not able to get the point, can you try to explain with a little example what are you trying to do?
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
Re: fonction in a fonction ?
hello allanon thanx for reply
the fact is that i did begun fonctions yesterday
and well seemed to understand that the main fonction
can have on itselft other fonctions declared before
in fact my questions was : is it possible to declare
a fonction inside another one ? or as i believe to declare
the first one and after make a main fonction to call it
in ?
i have to try to see and then test sprite more deeper
thanx a lot
steff
the fact is that i did begun fonctions yesterday
and well seemed to understand that the main fonction
can have on itselft other fonctions declared before
in fact my questions was : is it possible to declare
a fonction inside another one ? or as i believe to declare
the first one and after make a main fonction to call it
in ?
i have to try to see and then test sprite more deeper
thanx a lot
steff
Re: fonction in a fonction ?
Your English is hard to understand. Functions are called from within other functions.
Re: fonction in a fonction ?
hello mazze
yes my english is a pity !!
but you answered to me
i have now the way to test fonctions
thanx a lot yet
stephane
yes my english is a pity !!
but you answered to me
i have now the way to test fonctions
thanx a lot yet
stephane
Re: fonction in a fonction ?
Hi steff,
generally a program is divided in two parts, a declaration part (usually in the beginning) followed by a sequence of operations like functions call or a single function call that do all your stuff.
EXAMPLE
...or, using a main function:
As you can see main() function call my_func1() and my_func2(), that's it, a function call inside another function as Mazze as stated, functions call can be nested where the only limit is your free memory, have a look at the "Functions" chapter in the Hollywood guide, you will find many interesting things like recursive function calls.
Hope this helps
generally a program is divided in two parts, a declaration part (usually in the beginning) followed by a sequence of operations like functions call or a single function call that do all your stuff.
EXAMPLE
Code: Select all
; Function declaration
Function my_func1()
; your stuff
EndFunction
Function my_func2()
; your stuff
EndFunction
; Execute your stuff
my_func1()
my_func2()
Code: Select all
; Function declaration
Function my_func1()
; your stuff
EndFunction
Function my_func2()
; your stuff
EndFunction
Function main()
my_func1()
my_func2()
EndFunction
; Execute your stuff
main()
Hope this helps
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
Re: fonction in a fonction ?
hello my dear allanon
yes it is exactly what i wanted to know
then well no enought time to script theses days but be sure
your answer won't be lost for me
thanx yet and regards
steff
yes it is exactly what i wanted to know
then well no enought time to script theses days but be sure
your answer won't be lost for me
thanx yet and regards
steff