I'm a newbie in python, and I'm fighting against nested blocks in psp.
Thats a little example with a funny behaviour:
In my intention, the for instruction have to run two operation:
first: the if instruction
second: to print the option tag on the html page.
Instead, the real behaviour is depending on the result of the control
in the if:
if the control is true, the option tag is not printed, and the for
instruction goes to the successive step.
if the control is false, the option is correctly printed.
I don't understand the reason of this behaviour.
Which is the right way to control the nested block instructions in psp?
Thats a little example with a funny behaviour:
Code:
<html> <form> <select name="List"> <!--makes a list with a loop --> <% for i in range(50, 350, 50): if 'List' in form and int(form['List'])==i: sel="selected" else: sel="pippo" %><option value="<%=i%>" <%=sel%> ><%=i%> </option> <% %> </select> <input type="submit" value="return"/> </form> </html>
first: the if instruction
second: to print the option tag on the html page.
Instead, the real behaviour is depending on the result of the control
in the if:
if the control is true, the option tag is not printed, and the for
instruction goes to the successive step.
if the control is false, the option is correctly printed.
I don't understand the reason of this behaviour.
Which is the right way to control the nested block instructions in psp?
Comment