Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $CONSOLE
- _DEST _CONSOLE
- ZCorrection = 36.037
- OPEN "6.ngc" FOR INPUT AS 1
- OPEN "6o.ngc" FOR OUTPUT AS 2
- DO UNTIL EOF(1)
- LINE INPUT #1, a$
- ua$ = UCASE$(a$)
- IF INSTR(ua$, "G53") > 0 THEN
- outa$ = a$
- ELSE
- uai = INSTR(ua$, "ZMIN=")
- IF uai > 0 THEN
- 'PRINT "+" + a$
- 'Zword = INSTR(a$, z$)
- z0$ = RTRIM$(LEFT$(a$, uai + 4))
- z1$ = MID$(a$, uai + 5)
- z11 = 1
- ' PRINT "zL1 = ";
- IF INSTR("-+1234567890.", MID$(z1$, z11, 1)) > 0 THEN
- DO
- 'z11 = zL1
- zL1 = INSTR("-+1234567890.", MID$(z1$ + " ", z11, 1))
- z11 = z11 + 1
- ' PRINT zL1,
- LOOP UNTIL zL1 = 0
- ' PRINT
- ZVal = VAL(LEFT$(z1$, z11))
- z2$ = LTRIM$(MID$(z1$, z11 + 1))
- b$ = "(val = " + STR$(ZVal) + " Corrected = " + STR$(INT(ZVal * 1000 + INT(ZCorrection * 1000)) / 1000) + ")"
- PRINT #2, b$
- PRINT b$
- ' PRINT a$
- outa$ = RTRIM$(z0$ + RTRIM$(LTRIM$(STR$(INT(ZVal * 1000 + INT(ZCorrection * 1000)) / 1000))) + " " + z2$)
- ' PRINT outa$
- ' PRINT "====================="
- 'SLEEP 1
- END IF
- ELSE
- uai = INSTR(ua$, "Z")
- IF uai > 0 THEN
- 'PRINT "+" + a$
- 'Zword = INSTR(a$, z$)
- z0$ = RTRIM$(LEFT$(a$, uai))
- z1$ = MID$(a$, uai + 1)
- z11 = 1
- ' PRINT "zL1 = ";
- IF INSTR("-+1234567890.", MID$(z1$, z11, 1)) > 0 THEN
- DO
- 'z11 = zL1
- zL1 = INSTR("-+1234567890.", MID$(z1$ + " ", z11, 1))
- z11 = z11 + 1
- ' PRINT zL1,
- LOOP UNTIL zL1 = 0
- ' PRINT
- ZVal = VAL(LEFT$(z1$, z11))
- z2$ = LTRIM$(MID$(z1$, z11 + 1))
- b$ = "(val = " + STR$(ZVal) + " Corrected = " + STR$(INT(ZVal * 1000 + INT(ZCorrection * 1000)) / 1000) + ")"
- PRINT #2, b$
- PRINT b$
- outa$ = RTRIM$(z0$ + RTRIM$(LTRIM$(STR$(INT(ZVal * 1000 + INT(ZCorrection * 1000)) / 1000))) + " " + z2$)
- END IF
- ELSE
- outa$ = a$
- END IF
- END IF
- END IF
- PRINT outa$
- PRINT #2, outa$
- LOOP
- CLOSE
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement