Computer Science Canada

gui calculator

Author:  Prince [ Thu Mar 27, 2003 11:04 pm ]
Post subject:  gui calculator

i jus finished a non-flashy version of a simple calculator (thnx to tony's help Very Happy ) and now i wanted to make it look better wit gui but im having trouble wit 1) keeping all the numbers in my text field, and 2) getting more than one value in that text field... any ideas?

Author:  Tony [ Thu Mar 27, 2003 11:15 pm ]
Post subject: 

as for getting multiple values from a single string you can use following code

code:

var text:string := "123 456 7 8 9 10"
var i:int

loop
i:=index(text," ")
exit when i=0
put text(1..i-1)
text:= text(i+1 ..*)
end loop
put text


as you can see, using index function you find where spaces are located inside the string and cut the string in those places. you can replace " " with a math operator (+,-,*,/).

so now you can type in the whole line into a single text field.

Author:  hey_joe42 [ Tue Apr 01, 2003 10:05 am ]
Post subject: 

I'd like to see this calculator program

Author:  Prince [ Tue Apr 01, 2003 10:47 am ]
Post subject: 

ill try to get it up here (the non-gui version) as soon as i can... i dont wanna post a page full of code

Author:  Tubs [ Mon Apr 07, 2003 11:55 am ]
Post subject: 

just upload the gui version to a post Rolling Eyes

Author:  Prince [ Tue Apr 08, 2003 7:28 pm ]
Post subject: 

meh, cant bother... too lazy Rolling Eyes


: