1 ' HOUSE Nelson Ford 713-721-6104 P.O.Box 35705 Houston, TX 77235-5705
2 'This program is embarrassing simple, but I have found it to be very usable
3 ' for drawing floorplans. If you make any changes in it, I would appreciate
4 ' getting a copy. To move the cursor, use the numberpad with NumLock on.
5 'The only "features" are to draw a line and to erase a line:
6 'Press S to start a line. The line will not appear, but a distance indicator
7 ' will appear. Press S again to actually draw the line, Esc to cancel. So if you just want to measure a space first press S, move the cursor, then Esc to keep from drawing a line.
8 'Press E to start erasing a line, move the cursor, then press E again. There is no cancel for E. If you change your mind, just draw it again.
9 'Since all I wanted to do was print out a floorplan, there is no provision for saving and restoring screens. Press Q to quit.
10 SCREEN 2: CLS: YES= -1: NO=0: ERAS=1
11 DIST$="###'##"+CHR$(34)
12 VIEW (1,1)-(620,180)
13 'Note: the values in the next line for Xmax and Ymax were set such that a
14 '50 by 50 foot square would print as a true square on an HPLJ using PrtSc.
15 'Unfortunately, this means the 50'x50' box does not appear square on screen.
16 'You can change the numbers to meet your own needs, taste and equipment.
17 XMAX=600: YMAX=318
18 FT.PER.HOR.PIX=.166667: FT.PER.VER.PIX=.166667
19 'The above variables are set for 2 inches per pixel. Note that 600*.16667
20 'is 100 feet across and 318*.16667 is 53 feet down. You can adjust these
21 'numbers if you want more or fewer feet per screen, but keep in mind that
22 'the ratios must be maintained to keep a square a square
23 'Note that with the above numbers, the cursor moves slowly - two inches at a time. ( 12"*.16667=2" and Xmax is really 600*.16667=100' )
24 'You can make the cursor move in bigger steps by changing FT.PER.HOR.PIX to 1 and changing Xmax to 100. You would also need to change FT.PER.VER.PIX to 1 and Ymax to 318*.166667 or 53'.
25 'To move in half-foot increments, change FT.PER.HOR.PIX=.5 and XMAX to 200 (or 100'/.5), and so on.
26 WINDOW SCREEN (0,0)-(XMAX, YMAX)
27 X=1: Y=1
100 'drawing routine:
110 C=POINT(X,Y): PSET(X,Y),1
120 X$=INKEY$: IF X$="" THEN 120
130 IF X$="q" OR X$="Q" THEN SCREEN 0: END
140 IF X$=CHR$(27) THEN START=NO: LOCATE 25,1: PRINT SPACE$(20);: GOTO 120
150 IF X$="s" OR X$="S" THEN IF START THEN GOSUB 280 ELSE START=YES: START.X=X: START.Y=Y: LOCATE 25,1: PRINT DIST$; DIST$; : GOTO 120
160 IF X$="e" OR X$="E" THEN IF ERAS=0 THEN ERAS=1: LINE (EX,EY)-(X,Y),0 ELSE ERAS=0: EX=X: EY=Y
170 PSET(X,Y),C*ERAS
180 IF X$="6" THEN X=X-(X<XMAX)
190 IF X$="4" THEN X=X+(X>1)
200 IF X$="8" THEN Y=Y+(Y>1)
210 IF X$="2" THEN Y=Y-(Y<YMAX)
220 IF X$="1" THEN X=X+(X>1): Y=Y-(Y<YMAX)
230 IF X$="3" THEN X=X-(X<XMAX): Y=Y-(Y<YMAX)
240 IF X$="7" THEN X=X+(X>1): Y=Y+(Y>1)
250 IF X$="9" THEN X=X-(X<XMAX): Y=Y+(Y>1)
260 IF START THEN LOCATE 25,1: GOSUB 310
270 GOTO 110
280 'draw line:
290 LINE (START.X,START.Y)-(X,Y): START=NO: LOCATE 25,1: PRINT SPACE$(40);