Hello friends!
I am totally new to both HTML and CFML but not to programming. In the pass, I learned that you MUST close all functions or routines as you make your way out thus keeping your nested routines properly paired.
example:
if [ -s /tmp/filename ];
then
if [ -d /tmp/directory ];
then
for X in `cat /tmp/filename`
do
echo $X
done
fi
fi
Above you can notice a simple shell script with two if statements, one for/next loop and a do/while loop. Notice that they are all paired and closed in the way out of the nexted statemets.
I am playing around with some CFML/HTML and came across a sample where this rule does not seem to apply, which quite frankly, it throws me out of balance.
Sample (questionable) code:
<cfoutput ....>
<table .... >
<tr>
<td> .... </td>
</tr>
</cfoutput>
<tr>
<td> .... </td>
</tr>
</table>
How is it that <cfoutput> block can be closed before the <table> block? Is it a miracle that it worked? What are the chances that code like this will work a few year from now?
thank you all in advance;
josel
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
I am totally new to both HTML and CFML but not to programming. In the pass, I learned that you MUST close all functions or routines as you make your way out thus keeping your nested routines properly paired.
example:
if [ -s /tmp/filename ];
then
if [ -d /tmp/directory ];
then
for X in `cat /tmp/filename`
do
echo $X
done
fi
fi
Above you can notice a simple shell script with two if statements, one for/next loop and a do/while loop. Notice that they are all paired and closed in the way out of the nexted statemets.
I am playing around with some CFML/HTML and came across a sample where this rule does not seem to apply, which quite frankly, it throws me out of balance.
Sample (questionable) code:
<cfoutput ....>
<table .... >
<tr>
<td> .... </td>
</tr>
</cfoutput>
<tr>
<td> .... </td>
</tr>
</table>
How is it that <cfoutput> block can be closed before the <table> block? Is it a miracle that it worked? What are the chances that code like this will work a few year from now?
thank you all in advance;
josel
If you have the knowledge, consult and educate those who need it! - Jose Lerebours