> Looking for cfscript guru...
>
> I know the answer to this is sooooo simple, but I have tried
> everything...I think...
> and the next step right now seems to be... asprin, chicken soup
> and medication.
>
> I tried:
> switch abc; switch 'abc', switch '#abc#', switch #abc#;
> switch (abc); switch ('abc'), switch ('#abc#'), switch (#abc#);
>
> and in the output, when the program doesn't get caught up in errors due
> to ' or " or #, abc = r and txt_status always = Unknown
>
> I just don't know what to do next.
>
> What is the secret? how do i script the switch "???abc???" so it works?
>
> <CFSCRIPT>
> abc = 'r';
> switch (???abc???) {
> case "s":{txt_status = 'Initial Submission';}
> case "r":{txt_status = ' Revision';}
> case "a":{txt_status = 'Administration Revision';}
> case "j":{txt_status = 'Previously Rejected';}
> case "p":{txt_status = 'Processed and updated';}
> case "d":{txt_status = 'Previously Deleted';}
> default:{txt_status = 'Unknown';}
> }
>
> </CFSCRIPT>
> <CFOUTPUT>#abc#<BR>#txt_status#</CFOUTPUT>
CFScript is very like C++ in it's switch - you must break; out of each
option;
<cfscript>
switch (abc)
{
case "s":
{ txt_status="Initial Submission";
break;
}
case "r":
{ txt_status="Revision";
break;
}
}
HTH
Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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