2020-09-08 01:42 AM
!======THESE TWO LINES CANNOT BE INCLUDED IN THE LOOP====== x = 1 n = 5 !=========================================================== FOR i = 1 to n step 1 If i = 3 then x = 5 text2 y, 0, x next i
Returns: 1 1 5 5 5 Desired: 1 1 5 1 1
2020-09-08 02:07 AM
for i = 1 to n X=A if i = G then X=B endif next i
2020-09-08 02:15 AM
2020-09-08 02:41 AM
Lingwisyer wrote:
Doesn't that change the value of X for all proceeding steps?
X=10 X_orig = X X=20Then if ever I need to go back to the original value...
X= X_orig
2020-09-08 03:17 AM
x = 1 n = 5 FOR i = 1 to n step 1 If i = 3 then x = 5 endif text2 y, 0, x next i
2020-09-08 06:30 PM
Moonlight wrote:
Your error was in the conditional statement location
x = 1 n = 5 FOR i = 1 to n step 1 If i = 3 then x = 5 endif text2 y, 0, x next i
2020-09-08 06:47 PM
n = 5 FOR i = 1 to n step 1 x = 1 If i = 3 then x = 5 endif text2 i, 0, x next i
2020-09-08 06:56 PM
2020-09-08 07:02 PM
n = 5 for i = 1 to n x = 1 If i = 3 then x = 5 text2 i, 0, x next i
2020-09-08 07:08 PM
2020-09-08 08:48 PM
d = B - gs_fw_lower - gs_fw_upper - 2 * gs_int_fw !Louvre space IF louvre_over <= 0 then !If NO louvre overlap n = int(d /(gs_louvre_width - louvre_over)) dp = gs_louvre_width - louvre_over ELSE dp = gs_louvre_thk / ( cos ( atn ( ( gs_louvre_width - louvre_over) / gs_louvre_thk) ) ) n = int(d / dp) + 1 endIF
FOR i=1 to n ... IF Louvred_sealside = "Both" then IF i = 1 | i = n then gs_louvre_opening_angle = gs_louvre_opening_max gs_louvre_width = sqr((d - (dp * (n - 1) + Louvre_over))^2 - (gs_louvre_thk)^2 ) + Louvre_over endIF endIF ... cprism_ louvtopmat, louvbotmat, louvsidemat, 5, gs_louvre_thk, -a / 2 + gs_fw_side_right + gs_int_fw, -(gs_louvre_width) / 2, _status, -a / 2 + gs_fw_side_right + gs_int_fw, (gs_louvre_width) / 2, _status, a / 2 - gs_fw_side_left - gs_int_fw, (gs_louvre_width) / 2, _status, a / 2 - gs_fw_side_left - gs_int_fw, -(gs_louvre_width) / 2, _status, -a / 2 + gs_fw_side_right + gs_int_fw, -(gs_louvre_width) / 2, -1 ... next i
2020-09-09 12:17 AM
FOR i = 1 to n step 1 If i = 3 then x = 5 then text2 y, 0, x x=1 endif text2 y, 0, x next imaybe if you know precisely when it occurs just exclude from the loop? (though it looks awful)
2020-09-09 12:43 AM
A. wrote:
maybe if you know precisely when it occurs just exclude from the loop? (though it looks awful)
FOR i=1 to 2 ...
if i=3 then ...
FOR i=4 to n ...
2020-09-09 01:01 AM
Lingwisyer wrote:You just said it:
...parameterX=A, where Ais some previously defined value, is it possible to pick out when i=G then X=Bwithout needing to save Ato a new parameter so that for other steps the original value is still utilised?
if i = G then X = B else X = A
2020-09-09 01:18 AM
Peter wrote:
Lingwisyer wrote:You just said it:
...parameterX=A, where Ais some previously defined value, is it possible to pick out when i=G then X=Bwithout needing to save Ato a new parameter so that for other steps the original value is still utilised? if i = G then X = B else X = A
C = X A = X ... if i = G then C = B else C = A ... *replace X with C in all dependent macros*
2020-09-09 04:54 AM
call "macro" parameters A = something, ....The subsequent calls from "macro" will use the value of
call "macro" parameters all, A = something