
-----------------------------------
rbb
Mon Jun 09, 2003 1:29 pm

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.

-----------------------------------
Tony
Mon Jun 09, 2003 2:36 pm


-----------------------------------
thats cuz you forgot to actually declear those picture variables :?

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)

-----------------------------------
Andy
Mon Jun 09, 2003 5:29 pm


-----------------------------------
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
Mon Jun 09, 2003 7:21 pm


-----------------------------------
better programming practice.... not all languages let you be lazy :/

-----------------------------------
Andy
Mon Jun 09, 2003 7:22 pm


-----------------------------------
well they should

-----------------------------------
PaddyLong
Mon Jun 09, 2003 7:25 pm


-----------------------------------
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
Mon Jun 09, 2003 7:30 pm


-----------------------------------
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
Mon Jun 09, 2003 7:35 pm


-----------------------------------
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

-----------------------------------
Mazer
Mon Jun 09, 2003 7:52 pm


-----------------------------------

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
Mon Jun 09, 2003 7:58 pm


-----------------------------------
yeah it'd be useful... I've encountered variable overflow or whatever the error is when you exceed maxint before ...

-----------------------------------
Tony
Mon Jun 09, 2003 8:00 pm


-----------------------------------
it is twice as large... since it frees up a whole extra bit  :shock: 

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  :lol:
