8-Bit Software Online Conversion

Wordwrap Experiment - Listing

10 REM *** TextFmt Version 1.1 *** 20 REM Wordwrap program to show effec t 30 REM of column width on layout of t ext 40 REM DP-J 29Nov90. Update Nov93 50 REM Change Lines 80,130,410,420 to suit Mode 60 REM Text must not contain commas 70: 80 MODE3:VDU14 90 PRINT'"Input the required text (no commas)" 100 PRINT"(OR Q/q to quit)" 110 INPUT'A$ 120 IF A$="Q" OR A$="q" PRINT''"OK ... .I QUIT":END 130 FOR i%=10 TO 40 140 PRINT';" "i%;" Columns" 150 Col%=i%+1:PROCwrap(A$) 160 NEXT 170 INPUT'"See it again Yy/Nn ? "g$ 180 IF g$="Y" OR g$="y" THEN130 190 PRINT'"Preferred number of columns " 200 INPUT"(OR 0 to quit/alter text) ? "i%' 210 IF i%=0 PRINT'A$: GOTO90 220 PROCwin 230 VDU23;8202;0;0;0; 240 END 250: 260 DEF PROCwrap(text$) 270 LOCAL sp% 280 text$=text$+" ":row%=1 290 REPEAT 300 sp%=INSTR(text$," ") 310 IFPOS+(sp%-1)>i% VDU13,10:row%=row %+1 320 PRINTLEFT$(text$,sp%); 330 text$=MID$(text$,sp%+1) 340 UNTIL LEN(text$)<2 350 VDU13,10 360 ENDPROC 370 : 380 DEF PROCwin 390 PROCwrap(A$): REM calc row% for ch osen no. of cols 400 PRINT'"Locate Text Window :-" 410 PRINT'"Left Margin: 0 to ";(79-i%) ;:INPUT" "l% 420 PRINT"Top Margin: 0 to ";(24-row%) ;:INPUT" "t% 430 CLS:VDU28,l%,t%+row%,l%+i%,t% 440 PROCwrap(A$) 450 ENDPROC