Computer Science Canada

Procedures

Author:  PHP God [ Sat Jun 07, 2003 3:34 pm ]
Post subject:  Procedures

Ive seen procedures wher you can put brackets after.

IE textGreen ("My green text")

the procedure can take something after it and alter it. How is this done and could sum1 explain what all the things mean. It would help me alot. I'm trying to write a program with ALERT boxes, so when I go

alert ("my alert message here")

it displays it in a box with an OK button.

Author:  bugzpodder [ Sat Jun 07, 2003 3:41 pm ]
Post subject: 

in the future versions of turing, all you have to do is GUI.Alert

Author:  Andy [ Sat Jun 07, 2003 5:39 pm ]
Post subject: 

jack i think he's asking about how parameters work
when you have a procedure followed by the brackets, the procedure is given parameters, inorder to run the procedure, you have to input data into it.
code:

proc word(word:string)
put word
end word

in the above code, inorder to run the procedure word, a string have to be inserted in to the procedure. to run the procedure you'll have to do this
code:

put word("hi")


in the procedure, word is a constant and cannot be changed, inorder to change it, you'll have to put a var infront of it

code:

proc increase(var num:int)
num+=1
end increse


This increases the variable you put in the procedure by 1

code:

var number:string:=2
increase(number)
put number

the output will be 2

Author:  Homer_simpson [ Sat Jun 07, 2003 9:06 pm ]
Post subject: 

it doesn't work... for some reason GUI.Alert doesn't work or at least on my computer...=/

Author:  Andy [ Sat Jun 07, 2003 9:10 pm ]
Post subject: 

ya it doesn't work
stupid holt soft ppl

Author:  Mephi [ Sat Jun 07, 2003 10:51 pm ]
Post subject: 

is proc the same as procedure?

Author:  Homer_simpson [ Sat Jun 07, 2003 11:05 pm ]
Post subject: 

but u could create a custom one by opening a window giving a message and putting a gui button in the middle if u really need to use it...=/

Author:  void [ Sun Jun 08, 2003 10:49 am ]
Post subject: 

i think so..ive never seen any difference in the way the function...

Author:  Andy [ Sun Jun 08, 2003 12:59 pm ]
Post subject: 

ya proc is the same as procedure just as fcn is the same as function

Author:  AsianSensation [ Sun Jun 08, 2003 6:51 pm ]
Post subject: 

is there one for process, what about short form for other commands?

Author:  Andy [ Sun Jun 08, 2003 7:24 pm ]
Post subject: 

meng, ur so damn lazy, how many processes do u have?


: