cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
JGoode
Expert

if statement script line is too long??

I have an if statement which includes 15 different variables however it is saying the script line is too long. So the logical thing to do it separate the single line into multiple lines...well I can't seem to figure out a way of doing this.
if (overall_frame=0)and(frame_1_mvo=0)and(frame_2_mvo=0)and(frame_3_mvo=0)and(frame_4_mvo=0)and(frame_5_mvo=0)and(frame_6_mvo=0)and(frame_7_mvo=0)and(frame_8_mvo=0)and(frame_9_mvo=0)and(frame_10_mvo=0)and(frame_11_mvo=0)and(frame_12_mvo=0)and(frame_13_mvo=0)and(frame_14_mvo=0)then
Any help would be appreciated!
ArchiCAD 27

Windows 10
2 Replies 2
either "," or "\" can be a breaker here ("," only if a command accepts "," like list of parameters...list of put's and so on)

and use "&" instead of "and", "|" instead of "or" - lilttle shorter and less typing...

Your line can end on "&\" and the next will start with the rest after ....(can be of ourse more...)

maybe like this:
if 	(overall_frame=0)&\
	(frame_1_mvo=0)&\
	(frame_2_mvo=0)&\
	(frame_3_mvo=0)&\
	(frame_4_mvo=0)&\
	(frame_5_mvo=0)&\
	(frame_6_mvo=0)&\
	(frame_7_mvo=0)&\
	(frame_8_mvo=0)&\
	(frame_9_mvo=0)&\
	(frame_10_mvo=0)&\
	(frame_11_mvo=0)&\
	(frame_12_mvo=0)&\
	(frame_13_mvo=0)&\
	(frame_14_mvo=0) then
Piotr
sinceV6
Expert
Hi.
You could also look for another way to script it when there are comparisons like the one in your script. Looks like you check mvo for certain values (from a library global I assume), so you could store all these values in an array, an check values in a FOR loop. This might be easier to maintain in the long run.

Best regards,

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!