Formatting Issue

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
knothead1008
Coder
Posts: 10
Joined: Mon Feb 04, 2019 1:22 am

Formatting Issue

Post by knothead1008 » Thu Mar 28, 2019 1:36 pm

In the image provided, you'll notice in the highlighted where i'm having an issue. everything else seems to work.
2019-03-28_11-25-32.jpg
2019-03-28_11-25-32.jpg (712.64 KiB) Viewed 1948 times
Code below.

Code: Select all

' LACE CALCULATOR BY TOM HALL 31 APRIL 89
' RE-WRITTEN BY BRIAN KIDD TO BOTH OPTIMISE CODE & TO ADD METRICS. 15 APRIL 2019

' -------- BEGIN PRE-LOAD CONFIGS
i& = _LOADIMAGE("sources/Calculator-icon.BMP", 32) '<<<<<<< use your image file name here

IF i& < -1 THEN
    _ICON i&
    _FREEIMAGE i& ' release image handle after setting icon
END IF


' SETS TITLE IN TITLE BAR
_TITLE "Lace Calculator By Tom Hall"

' Middles or centers the app on screen at startup
_SCREENMOVE _MIDDLE
SCREEN 12
SCREEN _NEWIMAGE(880, 450)
' COLOR 0, 15
' -----END  PRE-LOAD CONFIGS

' ------------- BEGIN CODE -----------------------------
50 DIM F$(35): DIM D(35)
60 FOR X = 1 TO 30
    70 READ F$(X), D(X)
80 NEXT X
100 CLS: INPUT "ENTER WIDTH OF LACE FRACTION ie(1/8)"; L$
110 IF L$ = "" THEN L$ = "1/16"
120 FOR X = 1 TO 30
    130 IF L$ = F$(X) THEN FL = X
140 NEXT X
200 INPUT "ENTER DIAMETER OF CIRCLE TO BE CUT IN INCHES"; C
PRINT: PRINT TAB(23); "TO RE-RUN APP PRESS R OR r ON YOUR KEY BOARD":
PRINT: PRINT TAB(23);: INPUT "Save to a file? Y or y for Yes "; LP$: CLS
IF LP$ = "Y" OR LP$ = "y" THEN OPEN "LACE OUTPUT.txt" FOR OUTPUT AS #1: CLS

PRINT #1, TAB(16); "CIRCLE DIAMETER": PRINT
PRINT #1, "WIDTH OF LACE";
PRINT #1, TAB(21); C; TAB(33); C + 1; TAB(45); C + 2; TAB(57); C + 3; TAB(69); C + 4; TAB(81); C + 5
'PRINT: PRINT #1, F$(FL);
'PRINT #1, TAB(7); D(FL); TAB(16);

'IF LP$ = "Y" OR LP$ = "y" THEN PRINT #1, USING "  ###.## YDS"; TL / 36;


'CLOSE #1
SLEEP 2 'DELAYS OUTPUT FOR 2 SECONDS
' OPENS NOTEPAD KNOTOUTPUT.TXT FOR SAVING FILE
SHELL "start Notepad LACE OUTPUT.txt" 'display KNOT OUTPUT.txt contents in Notepad window


210 IF C = 0 THEN C = 3
220 CLS: PI = 3.1416: DD = C: R = 0
250 PRINT TAB(40); "CIRCLE DIAMETER": PRINT
260 PRINT "WIDTH OF LACE";

270 PRINT TAB(21); C; TAB(33); C + 1; TAB(45); C + 2; TAB(57); C + 3; TAB(69); C + 4; TAB(81); C + 5
300 IF R > 9 THEN 420
310 PRINT: PRINT F$(FL);: PRINT #1, F$(FL);
320 PRINT TAB(7); D(FL); TAB(16);: PRINT #1, TAB(7); D(FL); TAB(16);
330 FOR Y = 1 TO 6
    340 CD = C: TL = 0
    350 D = CD * PI
    360 CD = CD - (2 * D(FL))
    370 TL = TL + D
    380 IF CD > 1 THEN 350
    390 PRINT USING "  ###.## YDS"; TL / 36;: PRINT #1, USING "  ###.## YDS"; TL / 36;:
400 C = C + 1: NEXT Y
410 R = R + 1: C = DD: FL = FL + 1: GOTO 300: PRINT #1, R = R + 1: C = DD: FL = FL + 1
420 T$ = INKEY$: IF T$ = "R" OR T$ = "r" THEN 100 ELSE GOTO 420
425 T$ = INKEY$: IF T$ = "Q" OR T$ = "q" THEN SYSTEM
CLOSE #1


' -------------- END CODE -------------------------------------------------

' ------------------ BEGIN DATA SETS ----
500 DATA "1/16",0.0625,3/32,0.0938,1/8,0.125,5/32,0.1563,3/16,0.1875,7/32,0.2188,1/4,0.25,9/32,0.2813,5/16,0.3125,11/32,0.3438,3/8,0.375,13/32,0.4063,7/16,0.4375,15/32,0.4688
510 DATA 1/2,0.5,17/32,0.5313,9/16,0.5625,19/32,0.5938,5/8,0.625,21/32,0.6563,11/16,0.6875,28/32,0.71875,3/4,0.75,25/32,0.7813,13/16,0.8125,27/32,0.8438,7/8,0.875,29/32,0.9063,15/16,0.9375,31/32,0.9688

' ------------- METRIC DATA SETS -------------------------


' ----------------- END DATA SETS --------















Post Reply