2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations
2021-01-27 07:08 PM - last edited on 2021-09-14 01:27 PM 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 09: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 10:06 PM
2021-01-27 10: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 10: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 11: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 11: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 11:42 PM
2021-01-27 11:58 PM
2021-01-28 12:08 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 ELSE NEXT J NEXT I