Computer Science Canada procedures in procedures/functions/process |
Author: | equs [ Thu Apr 08, 2004 8:36 pm ] |
Post subject: | procedures in procedures/functions/process |
im having a problem.IM trying to make a frid for my game Snake and i cant declare proc or functions or processes in my array. I heard you can call procedures inside a procedures and etc. Does anyone know the comand and how to do this? ty |
Author: | Dan [ Thu Apr 08, 2004 8:54 pm ] |
Post subject: | |
u are trying to call a futtion in a array? arrays are things that holed more then one of the same data type and futtions are like miny progames. so u can't put fucttions in arrays. u call a procedure in a procedure the same way u whould a procedure that is not in a procedure. just do not put the code for a procedure in a procedure, put it above it like u ushely whould |
Author: | Delos [ Thu Apr 08, 2004 9:03 pm ] | ||
Post subject: | |||
I believe that the poster is saying this:
This is not possible in Turing. Do not attempt to do it. Arrays work like this: var nameOfArray : array 1..# of [type] Procedures: procedure procName [contents] end procName More info? Rite here. http://www.compsci.ca/v2/viewtopic.php?t=407 |
Author: | Catalyst [ Thu Apr 08, 2004 9:10 pm ] | ||
Post subject: | |||
you actually can have arrays of functions
probably not was he needs tho |
Author: | equs [ Thu Apr 08, 2004 9:24 pm ] |
Post subject: | |
i misspelled it. IM not trying to call functions in arrays but like proceudre sin procedures and functins in procedure and so forth and so forth |
Author: | AsianSensation [ Thu Apr 08, 2004 10:47 pm ] |
Post subject: | |
Catalyst wrote: you actually can have arrays of functions
Fo' the Shiznit?!?!?!?!?! that is pretty cool. Though do you have to initialize the array of functions like that? (Just can't be satisfied ) |
Author: | Tony [ Fri Apr 09, 2004 12:13 am ] |
Post subject: | |
eh? well this is exactly how turing's GUI works. You know how you specify which procedure gets called when you create a button? That procedure gets passed as an argument and is saved in one of internal variables of the button module (or w/e GUI element). In fact - you could write and export a method that could change the procedure to be called, so same button could do multiple functions depending on various conditions |
Author: | equs [ Fri Apr 09, 2004 11:40 am ] |
Post subject: | |
but can i call procedures in procedures. Is there a command? or like functions in procedures. Beucase i have a button and when i pres start the game is suppoed to start which is snake. And i cant make the grid without functions or processes or procedures. And i have to cal them inside the start button procedures so the game wil start. Any help? ty Joshua |
Author: | Catalyst [ Fri Apr 09, 2004 12:37 pm ] | ||
Post subject: | |||
like this?
|
Author: | equs [ Sun Apr 11, 2004 11:49 am ] |
Post subject: | |
no something like this procedure start code with procedures/functions/processes end start start button code whenever i try to put procedures/functions/processes in a procedure it says it has ot be at the monitor level. Is there a comand i can call procedures in procedures and so forth or at least put them in 1 procedure? |
Author: | Catalyst [ Sun Apr 11, 2004 12:14 pm ] |
Post subject: | |
why do want other procedures in another procedure? |
Author: | AsianSensation [ Sun Apr 11, 2004 1:46 pm ] |
Post subject: | |
if you really want to do procedures in another procedure, use modules, it's not technically proc in proc, but it's close enough. Though I agree with Catalyst, why would you? |
Author: | Tony [ Sun Apr 11, 2004 2:37 pm ] |
Post subject: | |
the reason you can't declear a procedure within another procedure is because each time that outter procedure is called, inner one would have to be decleared again But even if you could do that, I fail to see the reasoning behind it... |
Author: | equs [ Sun Apr 11, 2004 7:18 pm ] |
Post subject: | |
the reason is that i have a start button on a menu screen. Its a sanke game. When i press the start button the game is supposed to start. When the game start all the code should start. Now the button has a procedure. And the game has a procedure. So i have to call procedures for the game inside the start button procedure. Ill look into modules. But if anyone can figure this out it would be helpful. ty Joshua |
Author: | Catalyst [ Sun Apr 11, 2004 7:27 pm ] | ||
Post subject: | |||
calling a procedure inside another isnt the same as declaring it inside another why wouldnt something like this work?
|
Author: | Catalyst [ Sun Apr 11, 2004 7:28 pm ] | ||
Post subject: | |||
calling a procedure inside another isnt the same as declaring it inside another why wouldnt something like this work?
|
Author: | equs [ Mon Apr 12, 2004 10:11 am ] |
Post subject: | |
ty very much i finnally get it. ty Joshua |