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

Username:   Password: 
 RegisterRegister   
 Need Help With GUI Buttons
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dallasmcmahon




PostPosted: Fri May 04, 2012 5:41 pm   Post subject: Need Help With GUI Buttons

What is it you are trying to achieve?
import GUI

procedure checkBalance (currentBalance : int)
colorback (4)
locate (20, 20)
put "Your balance is : $", currentBalance
end checkBalance


var BalanceButton : int := GUI.CreateButton (200, 280, 5, "Check Balance", checkBalance)

loop
exit when GUI.ProcessEvent
end loop


What is the problem you are having?
I keep getting an error "Argument is the wrong type" where the checkBalance is int the GUI parameter. I have tried changing the the data types. I am new to GUI and it is probably an easy fix. Thanks for anyones help


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:


import GUI

procedure checkBalance ( currentBalance : int)
    colorback (4)
    locate (20, 20)
    put "Your balance is : $", currentBalance
end checkBalance


var BalanceButton : int := GUI.CreateButton (200, 280, 5, "Check Balance", checkBalance)

loop
    exit when GUI.ProcessEvent
end loop




Please specify what version of Turing you are using
<Answer Here>
Sponsor
Sponsor
Sponsor
sponsor
evildaddy911




PostPosted: Fri May 04, 2012 6:13 pm   Post subject: RE:Need Help With GUI Buttons

you need to add arguments for the checkBalance procedure
Zren




PostPosted: Fri May 04, 2012 11:33 pm   Post subject: RE:Need Help With GUI Buttons

http://compsci.ca/holtsoft/doc/gui_createbutton.html

GUI.CreateButton (x, y, width : int, text : string, actionProc : procedure x ()) : int

Note how the function you're calling accepts a procedure with no arguments. Thus, the argument is a wrong type.
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: