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

Username:   Password: 
 RegisterRegister   
 Can Procedures Be Disabled?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Banished_Outlaw




PostPosted: Fri Apr 13, 2007 10:34 pm   Post subject: Can Procedures Be Disabled?

Is there any command in Turing that can disable a procedure.

I have an if condition in my program and when the if condition is true, I want all the procedures that follow it, to be disabled or not to show on the run screen.

I would really appreciate any suggestions. Neutral
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Apr 14, 2007 12:31 am   Post subject: RE:Can Procedures Be Disabled?

You could do something like
Turing:

procedure foo()
if global_flag then
   return
end if
...
end foo
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
ericfourfour




PostPosted: Sat Apr 14, 2007 1:13 am   Post subject: RE:Can Procedures Be Disabled?

Or, you can only call the procedure if a certain condition is true.

Turing:
if condition then
    procedure_call()
end if
Superskull85




PostPosted: Sat Apr 14, 2007 7:10 pm   Post subject: Re: Can Procedures Be Disabled?

I'd go the condition option.

P.S. This is off topic but, what does "..." do in Turing?
Clayton




PostPosted: Sat Apr 14, 2007 8:10 pm   Post subject: RE:Can Procedures Be Disabled?

It does nothing... have you ever tried running code with ... in Turing? It just means "put your code here"
neufelni




PostPosted: Sat Apr 14, 2007 8:33 pm   Post subject: RE:Can Procedures Be Disabled?

I think that he may mean .. which causes the next line of output to be put on the same line rather than a new line.
Superskull85




PostPosted: Sat Apr 14, 2007 9:53 pm   Post subject: Re: RE:Can Procedures Be Disabled?

Clayton @ Sat Apr 14, 2007 8:10 pm wrote:
It does nothing... have you ever tried running code with ... in Turing? It just means "put your code here"


I have and it just gives me an error. I just wanted to know because I've seen it around a lot and I wanted to know maybe I was using it wrong. I was putting it by itself, but there are other words/symbols like; and, or, of, end, exit, (,), .., : etc. that need to be accompanied by other words/symbols to work properly. I just wanted to know if this was one of them, but now I know it isn't.
Tony




PostPosted: Sat Apr 14, 2007 10:01 pm   Post subject: RE:Can Procedures Be Disabled?

Indeed ... is usually a placeholder for more text. It often represents silence when speech is expected, such as in Final Fantasy games Wink Here it could be read as "your code goes here".
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
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  [ 8 Posts ]
Jump to:   


Style:  
Search: