LB Booster
« Line length limit for text output from console app »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:48am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Line length limit for text output from console app  (Read 252 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Line length limit for text output from console
« Reply #3 on: Jul 19th, 2017, 09:49am »

on Jul 15th, 2017, 5:50pm, CirothUngol wrote:
Is there a way to avoid this?

Actually I think there is a workaround of sorts. If you output the string in chunks of no more than (say) 80 characters I would not expect the wraparound effect to occur. Try this for example:

Code:
FOR i = 1 TO 255
    v$ = v$; "-"
    PRINT LEFT$(v$,80);
    PRINT MID$(v$,81,80);
    PRINT MID$(v$,161,80);
    PRINT MID$(v$,241,80)
NEXT i 

This will affect the output only when compiled as a console application.

Richard.
« Last Edit: Jul 19th, 2017, 4:44pm by Richard Russell » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Line length limit for text output from console
« Reply #4 on: Jul 21st, 2017, 06:40am »

on Jul 19th, 2017, 09:49am, Richard Russell wrote:
Actually I think there is a workaround of sorts.

Here's a more elegant solution which works for an arbitrary length of string:

Code:
FOR i = 1 TO 255
    v$ = v$; "-"
    CALL print v$
NEXT i
END

SUB print a$
    WHILE LEN(a$) > 80
        PRINT LEFT$(a$,80);
        a$ = MID$(a$,81)
    WEND
    PRINT a$
END SUB 

Obviously this isn't as satisfactory as modifying LBB so it doesn't wrap console output, which I will attempt in the next release, but it's a temporary fix.

Richard.
« Last Edit: Jul 21st, 2017, 06:49am by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls