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

Username:   Password: 
 RegisterRegister   
 Action procedure declared after the fact...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Geminias




PostPosted: Wed Jan 11, 2006 4:51 am   Post subject: Action procedure declared after the fact...

okay say you are using a widget, for instance:

GUI.CreateTextFieldFull

In the parameters of this procedure you have to specify an action procedure for if the user presses enter inside the text field. Now, what if the action procedure had to be after the GUI.CreateTextFieldFull declaration, and somehow, before the action procedure?

What i need is a "goto" or a pointer to the procedure I think. Any idea's? here's the source:

[code]
proc urlFieldProc (text : string)

searchButtonProc %I need this to call the searchButtonProc, but to do that i'll have to force the program to jump to it.

end urlFieldProc


searchField_ID := GUI.CreateTextFieldFull (200, 873, 690,
"Enter the word or phrase to be sought", searchFieldProc,
GUI.INDENT, 0, 0)
urlField_ID := GUI.CreateTextFieldFull (200, 853, 690,
"Enter the url here", urlFieldProc, GUI.INDENT, 0, 0)

var search_label := GUI.CreateLabelFull (195, 873, "Find", 0, 0, GUI.RIGHT, 0)
var url_label := GUI.CreateLabelFull (195, 853, "URL", 0, 0, GUI.RIGHT, 0)
%end textfields---------------------------------------
%buttons----------------------------------------------
proc searchButtonProc
search := GUI.GetText (searchField_ID)
url := GUI.GetText (urlField_ID)
searchProc (search, url)
end searchButtonProc
[code]
Sponsor
Sponsor
Sponsor
sponsor
do_pete




PostPosted: Wed Jan 11, 2006 9:57 am   Post subject: (No subject)

You would have to go like this:
code:
forward procedure ProcName

% The other stuff goes here

body procedure ProcName
    % Code goes here
end ProcName
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  [ 2 Posts ]
Jump to:   


Style:  
Search: