• Free Pascal Question

    From Chad Adams@1:19/37 to All on Tue Jan 9 17:47:01 2018
    I have a program that just displays a line of text.
    My question is:

    When running locally, if i use writeln('My Text') it works fine.
    the next writeln('test') writes left justified on the second line.

    When I run the same program over a telnet connection (in linux xinetd), the second write line doesnt left justify. I am sure it has to do with ANSI
    control characters but I cant find the unit, library, or info to reset the columns, and also enable ANSI color.

    Anyone know how?



    -Nugax

    --- Mystic BBS v1.12 A38 2018/01/01 (Linux/64)
    * Origin: -=The ByteXchange BBS : bbs.thebytexchange.com=- (1:19/37)
  • From mark lewis@1:3634/12.73 to Chad Adams on Tue Jan 9 20:19:04 2018

    On 2018 Jan 09 17:47:00, you wrote to All:

    When running locally, if i use writeln('My Text') it works fine. the
    next writeln('test') writes left justified on the second line.

    that's correct... writeln sends the CRLF which moves the cursor down one line and returns it to the left margin...

    When I run the same program over a telnet connection (in linux
    xinetd), the second write line doesnt left justify.

    what terminal are you using? check your terminal settings... i forget what it is called but there is generally a setting for LF or CRLF... it sounds like you
    just have LF which will simply move the cursor down a line but keep it in the same column position...

    I am sure it has to do with ANSI control characters

    what makes you think this? especially if you are not sending any ANSI stuff...

    but I cant find the unit, library, or info to reset the columns, and
    also enable ANSI color.

    based on this is why i say "not sending ANSI stuff" above... if you don't have a unit or whatever for ANSI then it shouldn't come into play...

    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it wrong...
    ... Caltitude: Height cat's back can arch to meet the hand stroking it
    ---
    * Origin: (1:3634/12.73)
  • From Chad Adams@1:19/37 to All on Tue Jan 9 21:19:55 2018
    I viewed it with netrunner and I don't see any settings that should cause it. Also does it with regular telnet in Linux

    On 14:19 09/01 , mark lewis wrote:

    On 2018 Jan 09 17:47:00, you wrote to All:

    When running locally, if i use writeln('My Text') it works fine. the
    next writeln('test') writes left justified on the second line.

    that's correct... writeln sends the CRLF which moves the cursor down one line >and returns it to the left margin...

    When I run the same program over a telnet connection (in linux
    xinetd), the second write line doesnt left justify.

    what terminal are you using? check your terminal settings... i forget what it >is called but there is generally a setting for LF or CRLF... it sounds like you
    just have LF which will simply move the cursor down a line but keep it in the
    same column position...

    I am sure it has to do with ANSI control characters

    what makes you think this? especially if you are not sending any ANSI stuff...

    but I cant find the unit, library, or info to reset the columns, and
    also enable ANSI color.

    based on this is why i say "not sending ANSI stuff" above... if you don't have >a unit or whatever for ANSI then it shouldn't come into play...

    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it >wrong...
    ... Caltitude: Height cat's back can arch to meet the hand stroking it
    ---
    * Origin: (1:3634/12.73)


    --
    yrNews Usenet Reader for iOS
    http://appstore.com/yrNewsUsenetReader

    --- Mystic BBS/NNTP v1.12 A38 2018/01/01 (Linux/64)
    * Origin: -=The ByteXchange BBS : bbs.thebytexchange.com=- (1:19/37)
  • From Gene Buckle@1:138/142 to Chad Adams on Thu Jan 11 07:39:38 2018
    Re: Free Pascal Question
    By: Chad Adams to All on Tue Jan 09 2018 05:47 pm

    When running locally, if i use writeln('My Text') it works fine.
    the next writeln('test') writes left justified on the second line.

    When I run the same program over a telnet connection (in linux xinetd), the second write line doesnt left justify. I am sure it has to do with ANSI control characters but I cant find the unit, library, or info to reset the columns, and also enable ANSI color.
    Your telnet client may be expecting both a carriage return and a line feed character.

    I suspect that if you do something like this:
    writeln('one');
    writeln('two');
    writeln('three');

    The output would be:
    one
    two
    three

    If that's the case, try this:
    writeln('one'#13);
    writeln('two'#13);
    writeln('three'#13);

    You should get:
    one
    two
    three

    g.
    --- SBBSecho 2.27-Win32
    * Origin: The Retro Archive (1:138/142)