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

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




PostPosted: Thu May 01, 2003 3:36 pm   Post subject: Formatting Text

There was a previous post almost about this topic but i wanna take it a step further.
I know how do make your program not crash if the user inputs more than 255 characters but how would you make it so that if the user only typed in (lets say 30 characters) it would delete the empty space. (which is not used)

ex.
var text :string (255)

get text : 255

put text..
put "blah"

If the user only typed in a 6 letter word, the next word blah appears on the next line. How do u prevent this from happening and still make the program not crash if user types 255 words
HELP ME

-Nate
Sponsor
Sponsor
Sponsor
sponsor
Asok




PostPosted: Thu May 01, 2003 4:19 pm   Post subject: (No subject)

code:
var text :string (255)

get text : 255
cls
put text
locate (1,1+length(text))
put "blah"


blah Razz
nate




PostPosted: Thu May 01, 2003 6:47 pm   Post subject: Dont' work for long strings

ASOK IT DOESN'T work when the string you enter is greater than 80 characters.

locate (x,y)
y can only go up 2 80

can you make it work for a longer string?!!!

-Nathan
Asok




PostPosted: Thu May 01, 2003 6:54 pm   Post subject: (No subject)

This is the simpler way that I probably should've given you the first time

code:
var text :string (255)

get text : 255
cls
put text ," blah"
nate




PostPosted: Thu May 01, 2003 7:45 pm   Post subject: STILL DON:T WORK

IT STILL DOENS:T WORK, THAT WAY PUTS THE BLAH 1 Line below still.!! Try it out before you post it so that it works?
Asok




PostPosted: Thu May 01, 2003 9:04 pm   Post subject: (No subject)

that puts it right after the text, if you want something else be more specific.
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: