2021-01-27 10:08 AM - last edited on 2021-09-14 04:27 AM by Noemi Balogh
4280: FOR I=1 TO N FOR J=1 TO FK IF ABS(Q-EPS) >= EPS GOTO 4300 NEXT J ! ENDIF 4290: GOTO 4310 4300: TEXT2 0,-9-N-NS-I,I FOR H=1 TO FK TEXT2 3*H,-9-N-NS-I,Q NEXT H 4310: NEXT IThanks in advance.
2021-01-27 12:02 PM
for i=1 to n for j=1 to fk if abs(q-EPS) >= EPS text2 0,-9-n-ns-i,i endif next j for h=1 to fk text2 3*h,-9-n-ns-i,q next h next i
2021-01-27 01:06 PM
2021-01-27 01:42 PM
!!---------------------------------------------- 4280: FOR I=1 TO N FOR J=1 TO FK IF ABS(Qstep 2: removal of unnecessary subroutines and correct tabbing-EPS) >= EPS GOTO 4300 NEXT J !ENDIF !!---------------------------------------------- 4290: GOTO 4310 !!---------------------------------------------- 4300: TEXT2 0,-9-N-NS-I,I FOR H=1 TO FK TEXT2 3*H,-9-N-NS-I,Q NEXT H !!---------------------------------------------- 4310: NEXT I
!!---------------------------------------------- 4280: FOR I=1 TO N FOR J=1 TO FK IF ABS(Qthis shows the logic of your current code more easily and will help you understand what is happening.-EPS) >= EPS then TEXT2 0,-9-N-NS-I,I FOR H=1 TO FK TEXT2 3*H,-9-N-NS-I,Q NEXT H endif NEXT J NEXT I !!----------------------------------------------
gosub "subroutine name" end!!---------------------------------------------- "subroutine name": FOR I=1 TO N FOR J=1 TO FK IF ABS(QStructuring your code so you are effectively "drawing" the logic will help you write more complex logic with ease. also don't overuse subroutines; as a general rule each subroutine should encompass a complete function, unless the function has many complex parts.-EPS) >= EPS then TEXT2 0,-9-N-NS-I,I endif NEXT J FOR H=1 TO FK TEXT2 3*H,-9-N-NS-I,Q NEXT H NEXT I return!!-------------------------------------------
2021-01-27 01:53 PM
Hi A. Smith,based on this response, is this what you are after:
it seems you did not understand the loop.
if greater than 0 then run second inner loop H
if not then I (outer loop) loops and brings again the first inner loop to check again if greater than zero.
gosub "subroutine name" end!!---------------------------------------------- "subroutine name": FOR I=1 TO N FOR J=1 TO FK IF ABS(Q-EPS) >= EPS then TEXT2 0,-9-N-NS-I,I else FOR H=1 TO FK TEXT2 3*H,-9-N-NS-I,Q NEXT H endif NEXT J NEXT I return!!-------------------------------------------
2021-01-27 02:02 PM
gosub "subroutine name" end!!---------------------------------------------- "subroutine name": FOR I=1 TO N FOR J=1 TO FK IF ABS(Q-EPS) >= EPS then TEXT2 0,-9-N-NS-I,I else TEXT2 3*J,-9-N-NS-I,Q endif NEXT J NEXT I return!!-------------------------------------------
2021-01-27 02:25 PM
gosub "subroutine name" end!!---------------------------------------------- "subroutine name": FOR I=1 TO N FOR J=1 TO FK IF ABS(Q) < EPS then TEXT2 0,-9-N-NS-I,I else TEXT2 3*J,-9-N-NS-I,Q endif NEXT J NEXT I return!!-------------------------------------------
2021-01-27 02:42 PM
2021-01-27 02:58 PM
2021-01-27 03:08 PM
FOR I=1 TO N FOR J=1 TO FK IF ABS(Q) >= EPS THEN TEXT2 0,-9-N-NS-I,I FOR H=1 TO FK TEXT2 3*H,-9-N-NS-I,Q NEXT H ELSE NEXT J NEXT I
2021-01-27 03:20 PM
2021-01-27 03:33 PM
FOR I=1 TO N FOR J=1 TO FK IF ABS(Q) >= EPS THEN TEXT2 0,-9-N-NS-I,I FOR H=1 TO FK TEXT2 3*H,-9-N-NS-I,Q NEXT H ELSE J = FK !this will stop it cycling through this column and jump to the next column ENDIF NEXT J NEXT I
2021-01-28 01:30 AM
FOR I=1 TO N FOR J=1 TO FK IF ABS(Q) >= EPS THEN TEXT2 0,-9-N-NS-I,I FOR H=1 TO FK TEXT2 3*H,-9-N-NS-I,Q NEXT H J = FK !this will stop it cycling through this column and jump to the next column ELSE ENDIF NEXT J NEXT I
2021-01-28 02:26 AM