
-----------------------------------
nate
Mon Apr 14, 2003 5:45 pm

REALLY LONG TEXT &quot;Formatting&quot;
-----------------------------------
I am wondering what how you would use a procedure and make a 3 - 5 not have anywords cut off when they reached the end of the run window. I want the text to wrap after the 40th character?
How do I do that?
What is the code?

Any help would be greatly apreciated

-Nate

-----------------------------------
Blade
Mon Apr 14, 2003 5:48 pm


-----------------------------------
it auto-wraps for me.... like if i went
put "mumbo jumbo blah blah blah blah choclolate milk with sweet bunnies and carried on like this for hundreds and hundreds of characters damn i cant think of anything to ramble on about ok i'm done"
if that isnt what you mean, then please specify

-----------------------------------
nate
Mon Apr 14, 2003 5:51 pm


-----------------------------------
No becuase when you type something very long it will cut off some of the words if they are near the end. I wan't it to cut off after 40 characters. Do you know how 2 do that?

-Nate
LOOK BELOW FOR REAL QUESTION!!!!

-----------------------------------
nate
Mon Apr 14, 2003 5:53 pm

MY MISTAKE
-----------------------------------
How do you make sure that text (words) is not cut off at the end off each line?

ex.
Hello this is just an example becuase you might not understand me but thi
s has been cut off like what would happen in turing I want to make sure that is does not happen.


"THIS" WAS CUT off how do u make that not happen?
using a procedure

SRY
-Nate

-----------------------------------
Blade
Mon Apr 14, 2003 6:55 pm


-----------------------------------
ooh i understand hahah.... use multiple puts

-----------------------------------
Tony
Mon Apr 14, 2003 7:07 pm


-----------------------------------
ahh... I suppose you use a counter for each line and see if there's enough space left for the next word. If not you use put "" which moves cursor onto the next line and you reset the counter.

-----------------------------------
Mephi
Mon Apr 14, 2003 7:55 pm

Wrap
-----------------------------------
how do you put a counter? cuz i wanna do the same thing....tony i added you to my msn, chann23@hotmail.com thats me...plz explain, i really need to know!!

-----------------------------------
Ancalagon The Black
Mon Apr 14, 2003 8:19 pm


-----------------------------------
Or you could use locate statements just befor the put statement to centre it or watever.

-----------------------------------
DarkHelmet
Mon Apr 14, 2003 8:28 pm


-----------------------------------
The following coding will wrap text at the fortieth character. This is just in case the program isn't supposed to know what text it is outputting before it is run. The only problem is that if you somehow give it a word with more than 40 characters, it will never finish. 


var strtext : string
var intwords : int
var intcounter : int
get strtext : *
var intcount : int
var strline : string
var intline : int
intwords := 0
for i : 1 .. length (strtext)
    if i > 1 then
        if strtext (i - 1) not= " " then
            if strtext (i) = " " then
                intwords += 1
            end if
        end if
    end if
    if i = length (strtext) then
        if strtext (i) not= " " then
            intwords += 1
        end if
    end if
end for
var strwords : array 1 .. intwords of string
for i : 1 .. intwords
    strwords (i) := ""
end for
intcounter := 1
for i : 1 .. length (strtext)
    if i > 1 then
        if strtext (i - 1) not= " " then
            if strtext (i) = " " then
                intcounter += 1
            end if
        end if
    end if
    if strtext (i) not= " " then
        strwords (intcounter) += strtext (i)
    end if
end for
intcounter := 0
intcount := 0
intline := 1
cls
strline := ""
loop
    intcount += 1
    if intcounter + length (strwords (intcount))  1 then
        if strtext (i - 1) not= " " then
            if strtext (i) = " " then
                intwords += 1
            end if
        end if
    end if
    if i = length (strtext) then
        if strtext (i) not= " " then
            intwords += 1
        end if
    end if
end for
var strwords : array 1 .. intwords of string
for i : 1 .. intwords
    strwords (i) := ""
end for
intcounter := 1
for i : 1 .. length (strtext)
    if i > 1 then
        if strtext (i - 1) not= " " then
            if strtext (i) = " " then
                intcounter += 1
            end if
        end if
    end if
    if strtext (i) not= " " then
        strwords (intcounter) += strtext (i)
    end if
end for
intcounter := 0
intcount := 0
intline := 1
cls
strline := ""
loop
    intcount += 1
    if intcount > intwords then
        put strline
        exit
    end if
    if intcounter + length (strwords (intcount)) 