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

Username:   Password: 
 RegisterRegister   
 error trap : "THE QUOTATION"
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cool




PostPosted: Sun May 15, 2005 4:10 pm   Post subject: error trap : "THE QUOTATION"

how do u error trap this input:

"
Sponsor
Sponsor
Sponsor
sponsor
Notoroge




PostPosted: Sun May 15, 2005 4:16 pm   Post subject: (No subject)

Huh? Eh
Update: I'll assume you're talking about the ' " '. As far as I know, there's no need to error trap quotation marks when getting it from a user's input. Only when out-putting hard-coded text. And in that case, you can go:
code:
put '"Hello," said Mr. Timothy'
MysticVegeta




PostPosted: Sun May 15, 2005 4:32 pm   Post subject: (No subject)

uhhh actually
code:
put "'Hello,' said Mr. Timothy"
Notoroge




PostPosted: Sun May 15, 2005 4:34 pm   Post subject: (No subject)

I know that. I just tested it in 4.0.5 and apperantly what I posted doesn't work. But in the old 4.0.x it was perfectly possible to post standard *"* in the middle of the sentence using my method. Confused
Update: Or maybe it was 3.11? Bah, who knows.
cool




PostPosted: Sun May 15, 2005 4:42 pm   Post subject: (No subject)

yo

when the program asks for an input, and the user types in just a quotation:
"
then the program freezes, and the error message is:
No terminating quote for quoted string
Notoroge




PostPosted: Sun May 15, 2005 4:44 pm   Post subject: (No subject)

code:
var asdf : string
get asdf : *
put asdf
Works for me. Confused
Cervantes




PostPosted: Sun May 15, 2005 4:45 pm   Post subject: (No subject)

If you've got a string of unnacceptable inputs and you're indexing to see if the user's input is in there, you can use \"
code:
put "\""

The \ basically says that the next character is what it is and doesn't do anything special. So doing \" actually puts the " there, instead of ending the string. Or if you're linking to a file, using \\ actually says use the \, as opposed to making the next character what it is.
In any case, you need to be more specific in your question. I still don't know what you mean.
EDIT: Aah, thanks for the clarification cool. I see what you mean now. It seems the get : * works fine. Smile
Notoroge




PostPosted: Sun May 15, 2005 4:47 pm   Post subject: (No subject)

Cervantes wrote:
Or if you're linking to a file, using \\ actually says use the \,
Or you can just use a "/" for that. Very Happy
Update: Oops, wrong key.
Sponsor
Sponsor
Sponsor
sponsor
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  [ 8 Posts ]
Jump to:   


Style:  
Search: