
-----------------------------------
Adalias
Thu Jan 11, 2007 10:58 am

Substring error message
-----------------------------------
I am making a word processor program that takes in a chunk of text and justifies it left, center, right, full, and snake (like a newspaper). I haven’t gotten very far but here’s what I’ve got:


var justification, line, current : string := ""
var col, istart, jstart : int := 1
istart := 1
jstart := 1
put "What type of justification do you want?"
put "left, center, right, full or snake?"
get justification
if justification = "left" or justification = "right" or justification = "full" or justification= “center” then
    put "What length of line would you like?"
    get col
end if
if justification = "left" then
    put "Enter the line you would like to justify"
    get line : *
    for i : istart .. length (line)
        for j : jstart .. length (line)
            if line (j) = " " then
                if (length (current) + length (line (i .. j))) 