Hi, Does anyone come across "number convert"?

My problem here is: ( please see the below codes ):

The following code is embeded as template with other templates, and 
the other templates provides ( throguht query database to get 

cFail_c/runHour_cuml  etc. 

but now when I run it, it tells me that :

Can not convert number ....

According to what I understand ( I start to do CF about 2 weeks ago, please
forgive me my level .... ), CF is typeless, like variant, it suppose know
how
to convert it., do I miss anything here? 

or, how CF works?

many thanks.









------------- my code start here.... ---------------------------

<cfscript>
  // for actual failure rate --- month
   actFR_c_mon = ArrayNew(1);
   actFR_a_mon = ArrayNew(1);
   // for actual failure rate --- cumulative
   actFR_c_cuml = ArrayNew(1);
   actFR_a_cuml = ArrayNew(1);
   
   
   
   
   for(k = 1; k LTE monthLength; k=k + 1)
   {
      actFR_c_mon[k] = (( #cFail_c[k]# / #runHour_cuml[k]# ) * 1000000 );
      actFR_a_mon[k] = ( ( #aFail_a[k]#/ #runHour_cuml[k]# ) * 1000000 );
          
          actFR_c_cuml[k] = (( #cFail_c_cuml[k]# / #runHour_cuml[k]# ) *
1000000 );
          actFR_a_cuml[k] = (( #aFail_a_cuml[k]# / #runHour_cuml[k]# ) *
1000000 );
        }
        
        
</cfscript>




-------------- end of my code -------------------------------

-----Original Message-----
From: James Lawrence [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 11:47 AM
To: CF-Talk
Subject: RE: loop in <CFSCript>


Mei,

There's a good reference at :

http://www.infoboard.com/packagedoc/cfdocs41/Developing_Web_Applications_wit
h_ColdFusion/21_Using_CFML_Scripting/dwa21_2.htm

Cheers

James Lawrence,  Application Developer, Freeserve Plc
The Observatory, 36-41 Clerkenwell Close, London EC1R OAU
T: 0207 5534832, M: 0797 1024911, F: 0207 5534866


-----Original Message-----
From: Zhou, Mei Y (Mei) [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2001 16:29
To: CF-Talk
Subject: RE: loop in <CFSCript>


James:

It works !! many thanks.

By the way, do you have any resource for syntax within <CFScript>?
according to CF documentation, it just mention it is similar to
JavaScript, no more further resource found.

Thanks again.

Mei

-----Original Message-----
From: James Lawrence [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 11:13 AM
To: CF-Talk
Subject: RE: loop in <CFSCript>


Mei, try :

arrayYes=Arraynew(1);
for (x=1;x LTE varLength; x = x+1) {
        arrayYes[x] = (#SomeNum[k]#/#othernum[k]#)*100;
}

The increment needs to be x=x+1 - x++ doesn't work.

Cheers

James Lawrence,  Application Developer, Freeserve Plc
The Observatory, 36-41 Clerkenwell Close, London EC1R OAU
T: 0207 5534832, M: 0797 1024911, F: 0207 5534866


-----Original Message-----
From: Zhou, Mei Y (Mei) [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2001 16:02
To: CF-Talk
Subject: RE: loop in <CFSCript>


It won't work, besides, for CF, array start with 1 not 0.

Thanks though.

Mei

-----Original Message-----
From: Jason Lees (National Express)
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 10:45 AM
To: CF-Talk
Subject: RE: loop in <CFSCript>



cant you use a
<cfscript>
arrayYes=Arraynew(1);
for (k=0;k lte varlength;k++)
        arrayYes[k]=(#SomeNum[k]#/#othernum[k]#)*100;
</cfscript>




Jason Lees
National Express
Email : [EMAIL PROTECTED]


-----Original Message-----
From: Zhou, Mei Y (Mei) [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2001 15:33
To: CF-Talk
Subject: loop in <CFSCript>


Can someone please tell me where I can find the resource about how
to loop inside <CFSCript> instead of <CFLOOP>?

My problem is:

I have use the combination of
<CFScript>
    arrayYes = ArrayNew(1);
</CFScript>
<CFLOOP  from= 1 to = #varLength# Index="k">
  <CFSET arrayYes[k] = ( #someNum[k]# / #otherNum[k]# )* 100 )>
</CFLOOP>

// someNum and otherNum has been defined and assigned values in the same
pages
   before with template, but when I run it, it says: can not convert
number...

// when I look up CF book, it says, <CFSET can not do much
calculation...need
   to be careful....

Many Thanks.

Mei
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to