[Logo] smithproject.org
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
cfscript  XML
Forum Index -> CFML, CFSCRIPT, CFC
Author Message
jorgepereira



Joined: 18/01/2008 17:14:34
Messages: 1
Offline

Smith seems to have trouble with
Code:
for(i ; i LT endStr; i=i+1){


and
Code:
for (fb_.aCircuitin fb_.application.fusebox.circuits) {

I found a work around for this by changing it to
Code:
 for (circuit in fb_.application.fusebox.circuits) {
 		fb_.aCircuit = circuit;


Any ideas how to fix these issues?
orcus



Joined: 22/01/2007 16:10:52
Messages: 136
Offline

In your first sample, you have not initialized variable 'i'.
I tested this and it works fine:

Code:
 <html>
 <cfscript>
 	text = '';
 	for (i = 1; i LTE 10; i = i + 1) {
 		text = text & ' ' & i; 
 	}
 	WriteOutput(text);
 </cfscript>
 


This also works:
Code:
 <html>
 <cfscript>
 	text = '';
 	i = 1;
 	for ( ; i LTE 10; i = i + 1) {
 		text = text & ' ' & i; 
 	}
 	WriteOutput(text);
 </cfscript>
 


Both examples have output:
1 2 3 4 5 6 7 8 9 10



In your second example, keyword 'in' is missing. It is not optional in smith.

 
Forum Index -> CFML, CFSCRIPT, CFC
Go to:   
Powered by JForum 2.1.6 © JForum Team