Advertisement
RobiSydney

fixZqb64.bas

Apr 19th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. $CONSOLE
  2. _DEST _CONSOLE
  3.  
  4. ZCorrection = 36.037
  5. OPEN "6.ngc" FOR INPUT AS 1
  6. OPEN "6o.ngc" FOR OUTPUT AS 2
  7. DO UNTIL EOF(1)
  8. LINE INPUT #1, a$
  9. ua$ = UCASE$(a$)
  10. IF INSTR(ua$, "G53") > 0 THEN
  11. outa$ = a$
  12. ELSE
  13. uai = INSTR(ua$, "ZMIN=")
  14. IF uai > 0 THEN
  15. 'PRINT "+" + a$
  16. 'Zword = INSTR(a$, z$)
  17. z0$ = RTRIM$(LEFT$(a$, uai + 4))
  18. z1$ = MID$(a$, uai + 5)
  19. z11 = 1
  20. ' PRINT "zL1 = ";
  21. IF INSTR("-+1234567890.", MID$(z1$, z11, 1)) > 0 THEN
  22. DO
  23. 'z11 = zL1
  24. zL1 = INSTR("-+1234567890.", MID$(z1$ + " ", z11, 1))
  25. z11 = z11 + 1
  26. ' PRINT zL1,
  27. LOOP UNTIL zL1 = 0
  28. ' PRINT
  29. ZVal = VAL(LEFT$(z1$, z11))
  30. z2$ = LTRIM$(MID$(z1$, z11 + 1))
  31. b$ = "(val = " + STR$(ZVal) + " Corrected = " + STR$(INT(ZVal * 1000 + INT(ZCorrection * 1000)) / 1000) + ")"
  32. PRINT #2, b$
  33. PRINT b$
  34. ' PRINT a$
  35. outa$ = RTRIM$(z0$ + RTRIM$(LTRIM$(STR$(INT(ZVal * 1000 + INT(ZCorrection * 1000)) / 1000))) + " " + z2$)
  36. ' PRINT outa$
  37. ' PRINT "====================="
  38. 'SLEEP 1
  39. END IF
  40.  
  41. ELSE
  42.  
  43. uai = INSTR(ua$, "Z")
  44. IF uai > 0 THEN
  45. 'PRINT "+" + a$
  46. 'Zword = INSTR(a$, z$)
  47. z0$ = RTRIM$(LEFT$(a$, uai))
  48. z1$ = MID$(a$, uai + 1)
  49. z11 = 1
  50. ' PRINT "zL1 = ";
  51. IF INSTR("-+1234567890.", MID$(z1$, z11, 1)) > 0 THEN
  52. DO
  53. 'z11 = zL1
  54. zL1 = INSTR("-+1234567890.", MID$(z1$ + " ", z11, 1))
  55. z11 = z11 + 1
  56. ' PRINT zL1,
  57. LOOP UNTIL zL1 = 0
  58. ' PRINT
  59. ZVal = VAL(LEFT$(z1$, z11))
  60. z2$ = LTRIM$(MID$(z1$, z11 + 1))
  61. b$ = "(val = " + STR$(ZVal) + " Corrected = " + STR$(INT(ZVal * 1000 + INT(ZCorrection * 1000)) / 1000) + ")"
  62. PRINT #2, b$
  63. PRINT b$
  64. outa$ = RTRIM$(z0$ + RTRIM$(LTRIM$(STR$(INT(ZVal * 1000 + INT(ZCorrection * 1000)) / 1000))) + " " + z2$)
  65. END IF
  66. ELSE
  67. outa$ = a$
  68. END IF
  69. END IF
  70. END IF
  71. PRINT outa$
  72. PRINT #2, outa$
  73. LOOP
  74. CLOSE
  75. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement