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

Username:   Password: 
 RegisterRegister   
 gui calculator
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Prince




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Mar 27, 2003 11:15 pm   Post subject: (No 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
hey_joe42




PostPosted: Tue Apr 01, 2003 10:05 am   Post subject: (No subject)

I'd like to see this calculator program
Prince




PostPosted: Tue Apr 01, 2003 10:47 am   Post subject: (No 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
Tubs




PostPosted: Mon Apr 07, 2003 11:55 am   Post subject: (No subject)

just upload the gui version to a post Rolling Eyes
Prince




PostPosted: Tue Apr 08, 2003 7:28 pm   Post subject: (No subject)

meh, cant bother... too lazy Rolling Eyes
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  [ 6 Posts ]
Jump to:   


Style:  
Search: