Hey Dudes and Dudets,

The program I'm writing requires a string of 200 char, the max for a string is 255, so everything works fine, if I readln the text more than 80 charecters (wich is eol) then it truncates and goes to next line, cool, but if I put in 100 char, and after a 100 I realize that I made a mistake and want to delete to char example, 26(any under 80) then it deletes the inputted data but does not bounce back to top line, how could I correct this?

Help pls!

Recommended Answers

All 12 Replies

You can post the code, only to see, because i need to see your code to solve your problem.

Hey Nathan, thanx for reply heres my problem: (just remember that I use Turbo Pascal and not Delphi, since I have no clue how to use Delphi.

Just a quick sample program:

Program Help_me;

uses crt;

var total : byte;
Verse : array[1..6] of string[250];
begin
clrscr;
writeln('please enter the amount of verses the song has, may not exceed 6');
readln(Total);{here I would write a small step to exclude "-", >6 and so on}
for total := 1 to total do
begin
writeln('please enter song verse here');
Writeln('do not use "enter" for next line of verse, use "." and "," to
end lines);
readln(Verse[total]); {this can only read +-150char, and if I go past 80 char and the line jumps, I can't delete the first line}
end;{and so on and so forth}
end.

First of all post your code like this:

Program Help_me;
uses crt;

var total : byte;
Verse : array[1..6] of string[250];
begin
clrscr;
writeln('please enter the amount of verses the song has, may not exceed 6');
readln(Total);{here I would write a small step to exclude "-", >6 and so on}
for total := 1 to total do
begin
writeln('please enter song verse here');
Writeln('do not use "enter" for next line of verse, use "." and "," to
end lines);
readln(Verse[total]); {this can only read +-150char, and if I go past 80 char and the line jumps, I can't delete the first line}
end;{and so on and so forth}
end.

Remove the [ ] from the string method, like this:

Verse : array[1..6] of string;

Remove the [ ] from the string method, like this:

Verse : array[1..6] of string;

I'm just do not understand that why need to delete the [[/B] and the [B]] ? :'( cause a string's max length is 255 char,or not?

It's just a test, if it solves the problem, because one person that i know(is my friend) here in Brazil, was having a a problem like this, then he do this and the problem solves.

doesn't help, the problem in not with the string length, but with the line, If I only do Readln then it doesn't work, same thing happens.

huh, this problem is much more complex!

And read your question about MP3 Player in Pascal, i post the source code!

I asked some of my friends about this weird problem,they said it is the DOS' fault... :'( ...but it can be fix.We need to write our reader
This program written by KAROGY.(hungary)

program karakterszamlalo;{character counter}

uses crt;

var
 c : char;
 s : string;
 i : byte;

BEGIN
   clrscr;
   i:=0;
   while i < 256 do
   begin
     c:=readkey;
     if c = chr(13) then break;
     if c = chr(8) then begin
        i:=i-1;
        if i < 0 then i:=0;
        s:=copy(s,1,i);
    end
    else begin
               i:=i+1;
              s:=s+c;
           end;
    clrscr;
    gotoxy(1,1);
    writeln(s);
    gotoxy(1,5);
    writeln(i);
   end;
END.
{copy and paste,and try it}

solved, in my original program I used a window wich made the line to short, when I removed the window the problen was solved.

Thanx Anyway Nathan

As for flaming claw, This is a main problem, All I did previously was to write it in 2 sections if I was writing more than 156 char, the line break Idee is cool though, my orig program had a bug that if after the 80 (in my actual case 78 since the window ran inside a frame wich I didn't mention, My bad) char and it would jump the line, is I delete then it wouldn't show the delete of the top line, but it's fixed now. Thanx anyway for you input and help, I copied your example as it could help me later if I deside to write something like tyhat again, hope it's ok.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.