我正在尝试将 QBasic 中的旧程序“转换”为 Java。我在调试时遇到问题,我认为与此 GOTO 语句有关。我知道带有撇号的行被忽略,但在这种情况下,语句 GOTO 以该行为目标。第一次被忽略,然后用 GOTO 语句不是?撇号只涉及变量 R12 和 X12 还是 R22,X22?
这是 .BAS 文件 :)
*
4010 'R12 = R2MA + ((R2A * R2M * (R2A + R2M) + S ^ 2 * (R2A * X2M ^ 2 + R2M * X2A ^ 2)) / ((R2A + R2M) ^ 2 + S ^ 2 * (X2A + X2M) ^ 2))
4014 'X12 = X2D + ((R2A ^ 2 * X2M + R2M ^ 2 * X2A + S ^ 2 * X2A * X2M * (X2A + X2M)) / ((R2A + R2M) ^ 2 + S ^ 2 * (X2A + X2M) ^ 2))
R22 = ((R2A * XMMU ^ 2 + R2M * XAVVMU ^ 2) * S ^ 2 + R2A * R2M * RT2) / (RT2 ^ 2 + S ^ 2 * XT2 ^ 2)
X22 = (X2A * (R2M ^ 2 + S ^ 2 * X2M ^ 2) + X2M * (R2A ^ 2 + S ^ 2 * X2A ^ 2) + 2 * X2AVM * (R2A * R2M - S ^ 2 * X2AVM * XT2)) / (RT2 ^ 2 + S ^ 2 * XT2 ^ 2)
X22 = X22 + X2D
R22 = R22 / ZUN: X22 = X22 / ZUN
4016 A1 = R22 * E1 ^ 2 / (P2 * X22 ^ 2 + R22 * E1 ^ 2)
4020 S = .5 * A1 - SQR(A1 * (.25 * A1 - R22 * P2 / E1 ^ 2))
4030 G1 = (PFE / (3 * (VF * (FR / 100)) ^ 2)) * ZUN
4040 A2 = (R22 / S) ^ 2 + X22 ^ 2: B2 = R22 / (S * A2): C2 = X22 / A2: D2 = B2 + G1
4050 E2 = C2 + B1: F2 = D2 ^ 2 + E2 ^ 2: G2 = D2 / F2: H2 = E2 / F2: Z2 = SQR(G2 ^ 2 + H2 ^ 2)
4060 I2 = G2 + R11: L = H2 + X11: ZTOT = SQR(I2 ^ 2 + L ^ 2)
4070 I1 = 1 / ZTOT
4080 E3 = I1 * Z2
4090 IF ABS(E1 - E3) > P0 THEN 5800
.
.
.
5800 E1 = (E1 + E3) / 2
5810 GOTO 4010
*