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

Username:   Password: 
 RegisterRegister   
 Problem, PictureButton isn't working.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rbb




PostPosted: Mon Jun 09, 2003 1:29 pm   Post subject: Problem, PictureButton isn't working.

Okay here, sorry but my the problem with my program is. Well I'm trying to put a little window every time you click on a button for the gameboard. Now in that little window I have a picture button that says answer. I don't know what's wrong with the problem, I hink the variables are wrong. Opinions are appreciated.


screenboard.t
 Description:

Download
 Filename:  screenboard.t
 Filesize:  14.76 KB
 Downloaded:  411 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Jun 09, 2003 2:36 pm   Post subject: (No subject)

thats cuz you forgot to actually declear those picture variables Confused

as for

var an1 : int := Pic.FileNew ("answer.bmp")

thats inside a procedure and is local to that procedure only. You need to declear that variable and the rest of them globaly (also your code looks really messed... need to organize it a bit)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Andy




PostPosted: Mon Jun 09, 2003 5:29 pm   Post subject: (No subject)

y do ppl declare a variable's type then define it rite after
its so much easier to just define it without the type, it does it by it self
PaddyLong




PostPosted: Mon Jun 09, 2003 7:21 pm   Post subject: (No subject)

better programming practice.... not all languages let you be lazy :/
Andy




PostPosted: Mon Jun 09, 2003 7:22 pm   Post subject: (No subject)

well they should
PaddyLong




PostPosted: Mon Jun 09, 2003 7:25 pm   Post subject: (No subject)

nah... I'd rather know exactly what kind of variable I am declaring rather than let it decide what kind it should be... especially when you get into languages like java or c and such where there's a couple different types of integer and real types... each one taking up a different amount of memory and giving a different range of numbers
Andy




PostPosted: Mon Jun 09, 2003 7:30 pm   Post subject: (No subject)

well in turing if you declare a variable and assign it with "", its a string, false or true and its a boolean integer and its a int and a number with decimal and its a real so technically u do know what type of variable you declared
PaddyLong




PostPosted: Mon Jun 09, 2003 7:35 pm   Post subject: (No subject)

there are also types int1 and int2 that use 1 or 2 bytes rather than the default 4 bytes so therefore int1 and int2 allow smaller ranges than int4/int
also there is a special int type that is nat that only allows positive integers
Sponsor
Sponsor
Sponsor
sponsor
Mazer




PostPosted: Mon Jun 09, 2003 7:52 pm   Post subject: (No subject)

PaddyLong wrote:

also there is a special int type that is nat that only allows positive integers


that's not what's so special about it though. maxnat is something like twice as big as maxint. i'm sure that'd be useful... never... well, maybe it would but not to me i think
PaddyLong




PostPosted: Mon Jun 09, 2003 7:58 pm   Post subject: (No subject)

yeah it'd be useful... I've encountered variable overflow or whatever the error is when you exceed maxint before ...
Tony




PostPosted: Mon Jun 09, 2003 8:00 pm   Post subject: (No subject)

it is twice as large... since it frees up a whole extra bit Shocked

you know how when you overflow an integer you get a negative number? thats because first bit is a flag for wether its negative or not. 0 = possitive, 1 = negative. This same bit is freed up when you state its positive only so you can hold numbers twice as large in same space.

btw, same would work with just negatives. You declear same way, just always use - in front of the variable Laughing
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  [ 11 Posts ]
Jump to:   


Style:  
Search: