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

Username:   Password: 
 RegisterRegister   
 Help with button callback procedure
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mikiehahn




PostPosted: Sat Feb 13, 2016 7:01 pm   Post subject: Help with button callback procedure

What is it you are trying to achieve?
I am having trouble getting button creation code to run.


What is the problem you are having?
I have this variable define.
I have a procedure defined that has one boolean parameter
Then I try to create a button using the procedure as a callback procedure.

Here is the code snipet (turing 4.1.1):

...
const numInPins : int := 8 % the number of input pins

var portInButton : array 0..(numInPins-1) of int

procedure buttonInBit0 (value: boolean)
portInState(0):= value
end buttonInBit0


portInButton(0) := GUI.CreateButton (425, 16, 0, "0", buttonInBit0)
....

When I try to run the program, it highlights "buttonInBit0" and the error says: "Argument is the wrong type"
I've done cut-n-paste on all the variable names so that I know there is no obvious spelling mistake.

What am I doing wrong.

Thanks,
Michael.
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Mon Feb 15, 2016 2:12 pm   Post subject: RE:Help with button callback procedure

buttonInbit0 has a parameter, but you do not pass one to it when you call it inside GUI.CreateButton.
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: