Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

if statement script line is too long??

JGoode
Expert
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 23

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
Advocate
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,