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

Username:   Password: 
 RegisterRegister   
 Creating a Simple Error Trap
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
uknown blank




PostPosted: Mon Jan 18, 2010 6:25 pm   Post subject: Creating a Simple Error Trap

What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>

How do you create an error trap.
Can someone please give me a simple example.
This is what i have so far strintok and strint but i need one for real numbers and integers
Sponsor
Sponsor
Sponsor
sponsor
TheGuardian001




PostPosted: Mon Jan 18, 2010 6:54 pm   Post subject: Re: Creating a Simple Error Trap

All valid integers can be stored as real numbers with intreal (no error check needed).

Real numbers can be safely converted to an int by rounding (no error check needed).
andrew.




PostPosted: Mon Jan 18, 2010 8:03 pm   Post subject: RE:Creating a Simple Error Trap

So to sum it up:

String -> Int check: strintok
String -> Int: strint
String -> real check: strrealok
String -> real: strreal
real -> String: realstr
Int -> String: intstr
Int -> Real: intreal
Real -> Int: round
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: