
-----------------------------------
Prince
Thu Mar 27, 2003 11:04 pm

gui calculator
-----------------------------------
i jus finished a non-flashy version of a simple calculator (thnx to tony's help  :D ) 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?

-----------------------------------
Tony
Thu Mar 27, 2003 11:15 pm


-----------------------------------
as for getting multiple values from a single string you can use following 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.

-----------------------------------
hey_joe42
Tue Apr 01, 2003 10:05 am


-----------------------------------
I'd like to see this calculator program

-----------------------------------
Prince
Tue Apr 01, 2003 10:47 am


-----------------------------------
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

-----------------------------------
Tubs
Mon Apr 07, 2003 11:55 am


-----------------------------------
just upload the gui version to a post  :roll:

-----------------------------------
Prince
Tue Apr 08, 2003 7:28 pm


-----------------------------------
meh, cant bother... too lazy :roll:
