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

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




PostPosted: Fri Jun 06, 2003 10:19 am   Post subject: using strintok

ok for one part of my program im trying to check if a letter is entered instead of a number... i tried using strintok but it doesnt seem to b workin properly so any suggestions on how i should b usin it Confused... if u need the code jus ask
Sponsor
Sponsor
Sponsor
sponsor
tum_twish




PostPosted: Fri Jun 06, 2003 10:51 am   Post subject: (No subject)

post the code plz
PaddyLong




PostPosted: Fri Jun 06, 2003 11:06 am   Post subject: (No subject)

if you're making sure that they enter a number for input use something like this....

code:

var tempinput : string
var someint : int

loop
    put "enter the number"
    get tempinput
    exit when strintok (tempinput)
end loop
someint := strint (tempinput)


you could also add some more conditions to the exit statement on the loop... like say you wanted the number to be between 5 and 10 or something your exit statement would look something like
code:

    exit when strintok (tempinput) and strint (tempinput) >= 5 and strint (tempinput) <= 10


hope this helps you in your endeavours [/code]
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  [ 3 Posts ]
Jump to:   


Style:  
Search: