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

Username:   Password: 
 RegisterRegister   
 Why can't you call a function as input to your proc?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TokenHerbz




PostPosted: Wed Nov 01, 2006 5:24 am   Post subject: Why can't you call a function as input to your proc?

Example the code i attempted:

code:

proc setBoxText (var input := font_get (100, 100, Font.New ("times new roman:12:bold"), red): string)
        BoxText := input
    end setBoxText


The input fcn in itself works perfectly, though i wanted to call it when you make a new word for your box, as a proc parameter.

kinda like a type as you go deal, and it will finish the proc after your fcn (which is basicly like "get" with features)

I suppose i could just put it in the proc, but i was wondering why it wont call the fcn in its parameter.
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Wed Nov 01, 2006 9:05 am   Post subject: (No subject)

because in Turing you can't assign parameters default values, or assign a parameter any kind of value in the declaration (you can in Ruby though!).

Personally, I don't see what's wrong with having your function being called from within the procedure itself anyways
Tony




PostPosted: Wed Nov 01, 2006 9:38 am   Post subject: (No subject)

because a parameter is a placeholder for the value you pass (actually you could pass a function and execute that internally).

havin a constant function there does not make sense
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: