Must imperative block start with variable declaration?

image

the only difference is that I declared a value in the second one. Is this a rule for imperative scripting?

Also below doesn’t work. It’s pointless but I’m setting up for something else. why doesn’t the iteration add each plane into my collection “l”?
image

The declaration for the list( “L = {}”) is wrong. It should be “L = []”.
Hope, it helps you out. Likes are always appreciated.

Thanks,
Nainoor

1 Like

umm…like this? throws an error at me.
image

1 Like

@visualizor You’ll have to have plns within the Imperative block for it to work …
20170910-1a

Otherwise, you’ll need to define a function to feed plns from outside …
20170910-1b

EDIT: @visualizor I stand corrected.
@Organon shows below that Imperative blocks can access outside variables.

3 Likes

So I guess the answer to my title question is yes. All the imperative codes with for loops start with a variable declaration. They must, except for a conditional.

image

This one worked. A conditional, no for loops.