Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 2345

programming • Re: Simple Word Wrap procedure

$
0
0
Hey All,

I'd cobbled together a word wrap procedure for the beebs message editor, which up until yesterday I though was working pretty well; but I've noticed if you press enter to move on to a new line and only have one character on the previous line the cursor isn't moving down a line and instead is over writing the previous character...but if there is more than one character it's fine. It has started to drive me a little crazy so I was hoping someone might have a solution?

I think this is enough of the code to replicate the problem:

Code:

   10 REM   20 A$="":L=0:eom%=FALSE:DIM T$(40)   30 REPEAT   40   A=FNG:IF A=13 PROCnl   50   IFA=21ORA=24PRINTSTRING$(LENA$,CHR$8);:A$="":A=0   60   IF(A=8 OR A=127) AND LENA$>0:A$=LEFT$(A$,LENA$-1):VDU 8:A=0   70   IFA=127ORA<32   80   A$=A$+CHR$A:IFLENA$>40 PROCwrap(A$)   90   VDUA:UNTIL L>40 OR eom%=TRUE  100 IF eom%=TRUE eom%=FALSE GOTO 10  110 IF L>40 PROCendmsg  120 ENDPROC  130 DEFFNG:LOCALA%:A%=INKEY18E3:IFA%>=0THEN=A%  140 PRINT"++KEY TIMEOUT++":PROCDC  150 DEFPROCnl:LOCAL B  160 T$(L)=A$:IF L<40 L=L+1:PRINT';:A$=""  170 IFL>40 PROCendmsg:GOTO 10:ENDPROC  180 B=FNG:IF B=10 GOTO 180  190 IF B<>47 A$=A$+CHR$B:PRINTA$;:A=FNG:ENDPROC  200 PROCcom  210 ENDPROC
To recreate type test on a line and then return (fine), on the next line just type t and then press return (cursor doesn't move down) then overwrites the t with whatever you write next. :?

Cheers,
Ed

Statistics: Posted by vela025 — Tue Aug 20, 2024 7:06 pm



Viewing all articles
Browse latest Browse all 2345

Trending Articles