Jump to content
IGNORED

Some questions about functions


Recommended Posts

Hello all,

 

I continue to learn but i've got, again, some questions about functions

If i understand a function can be called in a program by name_of_function(); and used return(); to go where this function had been called, right ?

now in my example i wrote a function called randomize, She's just randomize a number between 1 to 4 and calling anothers functions to display something on screen by the result of randomize.

in the end a return command must return to randomize function. But it's doesn'nt work. Can you tell me why ?

Thanks all.

Maybe it's not clear for you, if you want i can post the code...

Edited by FredTheFred
Link to comment
Share on other sites

Hello all,

 

I continue to learn but i've got, again, some questions about functions

If i understand a function can be called in a program by name_of_function(); and used return(); to go where this function had been called, right ?

now in my example i wrote a function called randomize, She's just randomize a number between 1 to 4 and calling anothers functions to display something on screen by the result of randomize.

in the end a return command must return to randomize function. But it's doesn'nt work. Can you tell me why ?

Thanks all.

Maybe it's not clear for you, if you want i can post the code...

It seems you're really new at this so we need to establish some ground rules for posting in this sub-forum:

 

1) When you want to ask a question, you MUST include your actual source code, not a code snippet taken from an example you found somewhere on the internet. Don't wait for people to ask you to post your code, do it in the very first post of the thread.

 

2) When posting parts of your source code, use the "code" tags, to get this result:

 

if (you like the Coleco) {
    Clap your hands
}

3) When you describe your problem or question, you should always refer to the code you posted. If you feel the need to talk about another piece of code which you didn't post, then you should include that piece of code as well. Otherwise you will leave everyone in the dark, especially considering English is not your first language.

 

Following the above guidelines will help the rest of us just as much as it will help you. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...