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

Username:   Password: 
 RegisterRegister   
 problem with string
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
shoobyman




PostPosted: Thu Nov 09, 2006 2:43 pm   Post subject: problem with string

code:

for i : 1 .. 3
    locate (i, 1)
    put "^XXXXX^"
end for

this is really wierd, i need the program to output

^XXXXX^
^XXXXX^
^XXXXX^

but it gives an error when i run. it works fine if i get rid of the "^", but i need to have those there, any help?
Sponsor
Sponsor
Sponsor
sponsor
DemonZ




PostPosted: Thu Nov 09, 2006 3:14 pm   Post subject: (No subject)

I think the problem is not with your program, but with turing. Turing has this annoying little feature that will not let you use certain characters on the keyboard (like ^ or $ and many others) so its not your fault that it wont run, blame turing.
shoobyman




PostPosted: Thu Nov 09, 2006 3:46 pm   Post subject: (No subject)

oh well, it was worth a shot, i'll just get rid of the "^"
Andy




PostPosted: Thu Nov 09, 2006 4:31 pm   Post subject: (No subject)

try \^ instead it should show only the ^
richcash




PostPosted: Thu Nov 09, 2006 4:37 pm   Post subject: (No subject)

You have to use Turing's escape sequence (or something like that!), which is a \.

code:
put "\^"


There is also \t for tab, \n for a new line, \" for a new quotation marks, \\ for a backsplash, and many others.

[edit]Andy, beat me to it, oh well at least I told you some of the other ones..
shoobyman




PostPosted: Thu Nov 09, 2006 5:33 pm   Post subject: (No subject)

thanx everyone, it works
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: