Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Issues with procedures, making a battle sim.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
nine90nine




PostPosted: Thu Nov 05, 2020 1:23 pm   Post subject: Issues with procedures, making a battle sim.

What is it you are trying to achieve?
Trying to make a program for a fighting sim (like Pokémon kind of)


What is the problem you are having?
Having a procedure run at the end of another procedure. I try to run a proc that will put a GUI to select moves, but no matter where i put it, it will have issues with having something declared


Describe what you have tried to solve this problem
I tried with forward procedure, and body procedure but i had no luck, still possible i didn't implement it properly.

Please specify what version of Turing you are using
4.1.1 (if i got name wrong its the latest version lol)

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
BooHoo prepare for the worst program you have ever laid your eyes on



RPG.T
 Description:
code

Download
 Filename:  RPG.T
 Filesize:  21.69 KB
 Downloaded:  181 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
scholarlytutor




PostPosted: Thu Nov 05, 2020 7:23 pm   Post subject: RE:Issues with procedures, making a battle sim.

Looks like you know that you need both of these:

forward procedure enemyturn
forward procedure startgame

Put them before writing any of your other procedures (I put them on lines 34 and 35 of your code). Basically, procedures must be declared before they're used, so anytime you want to use the 'forward' technique to reference procedures that are written later in your program, put those forward statements right near the top of your program.

Also, don't forget to write body when writing the procedure you forwarded! (I believe you forgot to write body for your startgame function).
nine90nine




PostPosted: Fri Nov 06, 2020 8:49 am   Post subject: Re: RE:Issues with procedures, making a battle sim.

scholarlytutor @ Thu Nov 05, 2020 7:23 pm wrote:
Looks like you know that you need both of these:

forward procedure enemyturn
forward procedure startgame

Put them before writing any of your other procedures (I put them on lines 34 and 35 of your code). Basically, procedures must be declared before they're used, so anytime you want to use the 'forward' technique to reference procedures that are written later in your program, put those forward statements right near the top of your program.

Also, don't forget to write body when writing the procedure you forwarded! (I believe you forgot to write body for your startgame function).


Thank you so much! My program is saved yahoooo

i wasnt sure hwo to properaly use the forward and body command thanks for clearing that up for me Mr. Green
scholarlytutor




PostPosted: Fri Nov 06, 2020 12:53 pm   Post subject: RE:Issues with procedures, making a battle sim.

No problem! Happy to help.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: