What am I doing wrong here?
cfscript
// Intialize List
FieldList =
CustEmail,CustPassword,CustPassword2,BillFirstName,BillLastName,BillAddress
,BillAddress2,BillCity,BillState,BillZip,BillPhone;
// Loop thru list and define all FORM variables
for(i=1; i LTE listlen(FieldList); i = i + 1
: Thursday, November 06, 2003 4:26 PM
To: CF-Talk
Subject: cfscript question...
What am I doing wrong here?
cfscript
// Intialize List
FieldList =
CustEmail,CustPassword,CustPassword2,BillFirstName,BillLastName,BillAddress
,BillAddress2,BillCity,BillState,BillZip,BillPhone;
// Loop thru list
I assume you want to see if form[X] is defined, were X is from
fieldList. You are missing a # sign:
if(not isDefined(form.#listGetAt(fieldlist,i)#))
form[listGetAt(fieldList,i)] = ;
Also note I switched to dot notation for the isDefined check. If you
want to use brackets, switch to
What is it not doing right?
One thing, isDefined wants a simple string.Try:
if (NOT isDefined(FORM[#listgetat(FieldList,i)#]))
Jann
-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 1:26 PM
To: CF-Talk
Subject: cfscript question...
What
Using CF5. The error is...
Parameter 1 of function IsDefined which is now
FORM[listgetat(FieldList,i)] must be a syntactically valid variable name.
-Original Message-
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 4:31 PM
To: CF-Talk
Subject: RE: cfscript
To: CF-Talk
Subject: cfscript question...
What am I doing wrong here?
cfscript
// Intialize List
FieldList =
CustEmail,CustPassword,CustPassword2,BillFirstName,BillLastName,BillAddress
,BillAddress2,BillCity,BillState,BillZip,BillPhone;
// Loop thru list and define all FORM variables
for(i=1; i
that was it Ray... btw, how do you know all of this stuff?
you must use more than 10% of your brain :)
-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 4:33 PM
To: CF-Talk
Subject: RE: cfscript question...
I assume you want to see
Hey out there?
Anyone know of a good resource for CFScript... some documentation would be
really cool!
TIA!!
Gabriel
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
http://tutorial84.easycfm.com/
also, i put together a calendar in cfscript just for the hell of it...
http://charlie.griefer.com/cfscript_calendar.cfm
- Original Message -
From: Gabriel Robichaud
To: CF-Talk
Sent: Friday, October 10, 2003 12:24 PM
Subject: cfscript
Hey out
Improving my knowledge of _javascript_ helped me a lot with CFSCRIPT.
I would learn how functions work.
Learn flow control and conditionals.
Remember you can use cf's built-in functions in cfscript.
Go to cflib.org and study a bunch of UDFs.
H
Matthew,
Thank you - that did the trick.I assumed a string, the name of the query, was what I needed, but it works perfectly without the quotes.
function timeRes(x) {
myarray = arrayNew(1);
myarray[1] = rsEquipAvail0;
rCount = myarray[x].RecordCount;
// etc.
}
Oh here's the problem:
You are
That fixed it - thanks.
Oh here's the problem:
You are placing strings in your array -- rsEquipAvail1 is a string. Try it
without the quotes.
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
myarray[x].RecordCount; chokes.
Here's a simplified version of the script:
cfscript
function timeRes(x) {
myarray = arrayNew(1);
myarray[1] = rsEquipAvail1;
myarray[2] = rsEquipAvail2; //, rsEquipAvail2, rsEquipAvail3);
rCount = myarray[x].RecordCount;
return rCount;
}
/cfscript
[Todays Threads
What happens if you write:
myQuery =myarray[x];
rCount = myQuery.recordCount
instead of
rCount = myarray[x].RecordCount;
?
-Original Message-
From: Rory Lysaght [mailto:[EMAIL PROTECTED]
Sent: Monday, 6 October 2003 10:45 a.m.
To: CF-Talk
Subject: Dynamic queryname in CFSCRIPT
What happens if you write:
myQuery =myarray[x];
rCount = myQuery.recordCount
instead of
rCount = myarray[x].RecordCount;
Good suggestion, but it generates the same error message on the
rCount = myQuery.recordCount;
line.
[Todays Threads]
[This Message]
[Subscription]
[Fast
Oh here's the problem:
You are placing strings in your array -- rsEquipAvail1 is a string. Try it
without the quotes.
-Original Message-
From: Rory Lysaght [mailto:[EMAIL PROTECTED]
Sent: Monday, 6 October 2003 10:45 a.m.
To: CF-Talk
Subject: Dynamic queryname in CFSCRIPT
I've got
I suppose rsEquipAvail1 and rsEquipAvail2 are queries?
Then try this
rCount = evaluate(myarray[x] .RecordCount);
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
Right. This is one of the fundamental reasons you can't use cfscript
that much. If you wrap Cfthrow in another function (or use the one
Raymond wrote) the error is actually throw from the throw function, not
where you called the function. So the error will always show the lines
of the throw
Adam, you can still do a try/catch inside the throw function. By using
writeoutput(excp.message);
-Original Message-
From: Adam Wayne Lehman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 17, 2003 9:05 AM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
Right. This is one
On Wednesday 17 Sep 2003 14:04 pm, Adam Wayne Lehman wrote:
Why oh why do we have try/catch but no throw? It's like we got loops
without a break command.
No point.
You can just an an extra looping condition, and change the value of that flag
if you need to break out.
--
Tom Chiverton (sorry
Thanks Tom. There is actually a 'break' command in cfscript, I was just
using it as an example to illustrate operators and commands that go hand
in hand.
Adam Wayne Lehman
Web Systems Developer
Johns Hopkins Bloomberg School of Public Health
Distance Education Division
-Original Message
You mean loops without a continue command, right? There is a break in both
CFML and CFSCRIPT, but continue only in CFSCRIPT. Quite annoying.
-Original Message-
From: Adam Wayne Lehman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 17, 2003 6:05 AM
To: CF-Talk
Subject: RE: Can
On Wednesday, Sep 17, 2003, at 08:20 US/Pacific, Adam Wayne Lehman
wrote:
Thanks Tom. There is actually a 'break' command in cfscript, I was just
using it as an example to illustrate operators and commands that go
hand
in hand.
There are a lot of folks who think that using 'break' in a loop
Andy,
I'm not sure this is what you are looking for, but I've done some pretty robust error
trapping using this type of logic:
cftry
cfscript
message = ;
errors = 0;
if ( NOT IsDefined('foo') ) {
message = You must define foo;
errors = 1;
}
/cfscript
cfif errors EQ 1
Do I have to go out of the script language to throw and error or is there a
way to do it within cf-script(without separate function call that throws
error)?
Andy
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
You can write a wrapper function for CFTHROW then call that function from
within your CFScript block...
-Original Message-
From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 2:43 PM
To: CF-Talk
Subject: Can I Throw within cfscript???
Do I have to go out
You can write a wrapper function for CFTHROW then call that function from
within your CFScript block...
yes, but you have to manage most of the error details yourself. cfscript
really needs a throw().
~|
Archives: http
no need for wrapper...throw();
http://www.mail-archive.com/[EMAIL PROTECTED]/msg145231.html for an example
doug
-Original Message-
From: Shawn Grover [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 4:48 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
You can
This won't work on my system running under NT MX.
Andy
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 3:53 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
no need for wrapper...throw();
http://www.mail-archive.com
within cfscript???
This won't work on my system running under NT MX.
Andy
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 3:53 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
no need for wrapper...throw
Raymond,
CFFunction works, what doesn't is:
cfscript
throw(type=ValidationError Message=This just wont work);
...
Andy
-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 4:50 PM
To: CF-Talk
Subject: RE: Can I Throw
]
Sent: Tuesday, September 16, 2003 4:03 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
Raymond,
CFFunction works, what doesn't is:
cfscript
throw(type=ValidationError Message=This just wont work);
...
Andy
-Original Message-
From: Raymond Camden
Create a complete page with only the following:
cfscript
throw(message=Test one);
/cfscript
When you execute it, Variable THROW is undefined is thrown.
Andy
-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 5:13 PM
To: CF-Talk
Andy you still have to init your library.
-Original Message-
From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 7:29 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
Create a complete page with only the following:
cfscript
throw(message
Huh?
-Original Message-
From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 6:45 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
Andy you still have to init your library.
-Original Message-
From: Andy Ousterhout [mailto:[EMAIL PROTECTED
You have to create a reference to the cfc before you can call a function
from the cfc in your cfml.
Example:
Test.cfm
cfscript
myCFC=CreateObject('component','mycfcfilename');
myCFC.throw(message=I've been thrown to the wall, ouch!);
/cfscript
-Original Message-
From
perfectly.
Andy
-Original Message-
From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 7:01 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
You have to create a reference to the cfc before you can call a function
from the cfc in your cfml.
Example
, 2003 7:58 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
OK, now I am totally confused. Please walk me through this...
I have a CFC called FOO with a single method called Throw Exception:
FOO:
Function ThrowException
throw(message=Test one);
what object am I instantiating
I should have read your email more closely. What you want is
cffunction name=throwException returntype=string output=false
cfscript
var throwExceptionReturn='';
throwExceptionReturn=I've been thrown to the wall,
ouch!;
/cfscript
cfreturn
Correct. Before, I was trying to simplify the problem to what I thought was
the root.
-Original Message-
From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 7:12 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
First do you have a cfc file
If your trying to throw within your cfc use
Your.cfc
cffunction name=throwException returntype=string output=false
cfargument name=theString default= required=yes
cfscript
var throwExceptionReturn='';
throwExceptionReturn=Arguments.theString
Throw within cfscript???
If your trying to throw within your cfc use
Your.cfc
cffunction name=throwException returntype=string output=false
cfargument name=theString default= required=yes
cfscript
var throwExceptionReturn='';
throwExceptionReturn
Ok, I need some more information. Please post an example of your cfc and
your cfml page
-Original Message-
From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 9:00 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
Not what I am looking to do. I
(cfcatch)#/cfoutput
/cfcatch
/cftry
cfscript
try {
test();
}
catch(Any excpt) {
writeoutput(brCFCatch Exists - #IsDefined(cfcatch)#);
}
/cfscript
cffunction name=Test
cfthrow message=This is a throw error
/cffunction
You can't.
You have to define a throw() function elsewhere that wraps the CFTHROW tag,
and include the definition before it's used. But before you go down this
road too far, I would be quite surprised if the next version of CF doesn't
have a 'throw' keyword in CFSCRIPT. I was utterly shocked
Here is the answer
cftry
!--- This line throws error ---
cfset test1()
cfcatch type=any
cfoutput#test(message=CFCatch Exists -
#IsDefined(cfcatch)#)#/cfoutput
/cfcatch
/cftry
br
cfscript
try {
test1();
}
catch
)#/cfoutput
/cfcatch
/cftry
cfscript
try {
test();
}
catch(Any excpt) {
writeoutput(brCFCatch Exists - #IsDefined(cfcatch)#);
}
/cfscript
cffunction name=Test
cfthrow message=This is a throw error
/cffunction
Andy
Yes they do. The cfscript version of the try is a custom named type. So
in your case excpt is the equiv to cfcatch you do excpt.message in
cfscript in cfcatch you use cfcatch.message
-Original Message-
From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 9:54
within cfscript???
Here is the answer
cftry
!--- This line throws error ---
cfset test1()
cfcatch type=any
cfoutput#test(message=CFCatch Exists -
#IsDefined(cfcatch)#)#/cfoutput
/cfcatch
/cftry
br
cfscript
try {
test1
-Original Message-
From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 10:03 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
Bryan,
This is not the same code. All you are doing is returning from a
function
call. You are NOT throwing an exception
You _have_ to use cfthrow within test to throw within test.
-Original Message-
From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 10:03 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript???
Bryan,
This is not the same code. All you are doing
You can not throw a custom throw within the custom throw, you will have
to use cfthrow within your custom throw function
-Original Message-
From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 10:03 PM
To: CF-Talk
Subject: RE: Can I Throw within cfscript
cfscript???)
Yes they do. The cfscript version of the try is a custom named type. So
in your case excpt is the equiv to cfcatch you do excpt.message in
cfscript in cfcatch you use cfcatch.message
-Original Message-
From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003
Anyway to easily emulate CFPARAM using CFSCRIPT (without conditional logic?)
--
Alex Sherwood
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe
No, but there is a UDF on cflib.org
-Original Message-
From: Alexander Sherwood [mailto:[EMAIL PROTECTED]
Sent: donderdag 11 september 2003 16:30
To: CF-Talk
Subject: CFSCRIPT equiv. of CFPARAM?
Anyway to easily emulate CFPARAM using CFSCRIPT (without conditional
logic?)
--
Alex
:30 AM
: To: CF-Talk
: Subject: CFSCRIPT equiv. of CFPARAM?
:
:
: Anyway to easily emulate CFPARAM using CFSCRIPT (without
: conditional logic?)
:
: --
: Alex Sherwood
:
:
~|
Archives: http://www.houseoffusion.com/lists.cfm
function cf_param(var_name, default_value) {
if(not isDefined(var_name))
SetVariable(var_name, default_value);
}
mack /
- Original Message -
From: Alexander Sherwood [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 17:29
Subject: CFSCRIPT equiv
I'm redoing my CFSCRIPT docs and one of the things I'm adding in are all the
'extra' things you can do with it in CFMX. One such thing is a CFLOCATION using
GetPageContext().forward(somefile.cfm)
I believe that there was a CFINCLUDE type code as well, but I can't seem to find
it. If anyone
I'm redoing my CFSCRIPT docs and one of the things I'm adding in are
all the
'extra' things you can do with it in CFMX. One such thing is a
CFLOCATION using
GetPageContext().forward(somefile.cfm)
I believe that there was a CFINCLUDE type code as well, but I can't
seem to find
, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax : 360.647.5351
www.audiencecentral.com
-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 3:52 PM
To: CF-Talk
Subject: CFLINCLUDE in CFSCRIPT
Perfect, thanks. I'll give you credit and a link in the docs to this (as well as
Charlie credit for his CFLOCATION portion).
Are there any solid docs on the GetPageContext() stuff?
I'm redoing my CFSCRIPT docs and one of the things I'm adding in are
all the
'extra' things you can do
I'm redoing my CFSCRIPT docs and one of the things I'm adding in are
all the
'extra' things you can do with it in CFMX. One such thing is a
CFLOCATION using
GetPageContext().forward(somefile.cfm)
I believe that there was a CFINCLUDE type code as well, but I can't
seem to find
() that might parse a
variable (that could be read from a file or created on the fly?
cfscript
// example (quick one)
Bob=I love ##BobsGirlfriend##, but this is a pound: ##.;
BobsGirlfriend=Jane;
GetPageContext().Parse(SomeString);
/cfscript
Would output: I love Jane, but this is a pound: #.
This isn't
Got that already, thanks. Do you know of any other GetPageContext() pieces that
are floating around? I only remember those 2.
For that matter, I think it's worth pointing out that cflocation and
GetPageContext().forward(somefile.cfm) are not exactly the same either.
One's a client-side
page (somefile.htm). So it has some internal parse switch to determine
whether or not to parse a relative link.
Sooo...is there some sub-function within GetPageContext() that might parse a
variable (that could be read from a file or created on the fly?
cfscript
// example (quick one)
Bob=I
General Lackey
Moonbow Software, Inc
: -Original Message-
: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
: Sent: Thursday, August 21, 2003 3:51 PM
: To: CF-Talk
: Subject: Quick cfscript if else ?
:
:
: Not done much if something is this, then set this value...
:
: How far off am I
I believe it is:
cfscript
if(form[qty#k#] IS )
newqty = 0;
else
newqty = form[qty#k#];
/cfscript
Try to avoid the evaluate if possible.
Steve
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21
Not done much if something is this, then set this value...
How far off am I? Not seeing a good tutorial directly related to this...
(ignore //) ...in essence looking for a blank value and resetting to 0 or
else use the numeric value passed...
//if
I think you want
cfscript
if(form[qty#k#] is ) newqty = 0;
else newqty = form[qty#k#];
/cfsciprt
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http
Raymond and Steven, you are correct by using if(form[qty#k#] is ). When writing
CFSCRIPT code, you use the same comparison and assignment operators that you would use
in any CF tag.
To assign a value:
variablename = value;
To check if equal:
if ( form.something eq 3 ) ...
To use modulo:
x = y
Is there a cflocation equivalent that I can use from within a cfscript block? I can't
see to find anything.
Cedric
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http
]
Sent: Tuesday, August 05, 2003 3:38 PM
To: CF-Talk
Subject: Redirect within cfscript?
Is there a cflocation equivalent that I can use from within
a cfscript block? I can't see to find anything.
~|
Archives: http
I think have done this before... can figure it out.
How do you write Domain, Path etc information , when writing
cookies in cfscript blocks.?
e.g
cfscript
myCookie = cookieValue; // Is there a way to specify domain and path
here?
/cfscript
I tried cookie.test=hello;domain=.mydomain.com
I think this is a stupid question, but is there any way to end processing of
a CF page from within CFScript similar to a CFAbort.
I know CFAbort is a tag, and tags can't be used in cfscript. However, there
have been so many other improvements to CF with the MX release that I
wouldn't
in CFScript?
I think this is a stupid question, but is there any way to
end processing of a CF page from within CFScript similar to a CFAbort.
I know CFAbort is a tag, and tags can't be used in cfscript.
However, there have been so many other improvements to CF
with the MX release that I
I know CFAbort is a tag, and tags can't be used in cfscript.
In general, nearly any CFML tag can now be used within CFSCRIPT, if you're
willing to write a wrapper for it using CFFUNCTION.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
Could someone please explain what GetPageContext() does within CFMX? I just
came across it in one of the other posts and it got me thinking about using
GetPageContext().include(somefile.cfm) for cfincludes within cfscripts,
but it doesn't seem to share the same memory/variables (which, I guess,
Subject: GetPageContext() function...cfinclude from a cfscript?
Could someone please explain what GetPageContext() does within CFMX? I just
came across it in one of the other posts and it got me thinking about using
GetPageContext().include(somefile.cfm) for cfincludes within cfscripts,
but it doesn't
I think, there are probably people who know a shit load more about than
that!
-Original Message-
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: 08 July 2003 14:03
To: CF-Talk
Subject: RE: GetPageContext() function...cfinclude from a cfscript?
I believe it is used
java.sun.com. Alternatively, look
for any JSP tutorial that mentions the context.
That should get you on your way.
André
-Original Message-
From: Tyler Silcox [mailto:[EMAIL PROTECTED]
Sent: 08 July 2003 13:56
To: CF-Talk
Subject: GetPageContext() function...cfinclude from a cfscript
.
WG
-Original Message-
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: 08 July 2003 14:06
To: CF-Talk
Subject: RE: GetPageContext() function...cfinclude from a cfscript?
I think, there are probably people who know a shit load more about than
that!
-Original Message
If you want an include function for use w/CFSCRIPT, in CFMX you could just
create a UDF that uses the CFINCLUDE tag.
-Dan
-Original Message-
From: Tyler Silcox [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 8:56 AM
To: CF-Talk
Subject: GetPageContext() function...cfinclude
I've tried that and it's a pain in the arse...
-Original Message-
From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 9:26 AM
To: CF-Talk
Subject: RE: GetPageContext() function...cfinclude from a cfscript?
If you want an include function for use w/CFSCRIPT
Message-
From: Tyler Silcox [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 8:21 AM
To: CF-Talk
Subject: RE: GetPageContext() function...cfinclude from a cfscript?
I've tried that and it's a pain in the arse...
-Original Message-
From: Dan G. Switzer, II [mailto
-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 11:01 AM
To: CF-Talk
Subject: RE: GetPageContext() function...cfinclude from a cfscript?
Really?
cffunction name=include
cfargument name=template
cfinclude template=#template#
/cffunction
I've tried that and it's a pain in the arse...
I knew I shouldn't have laid out such a empty statement, but I've tried
that
exact UDF before and it threw some crazy errors-but I, of course, have no
idea what the errors were...I'll see if I can recreate them and let you
know-
I wonder if
Hey folks.
questions regarding scripting.
I want to see YY as 0 not 0.25
and i want to use the modulus operator (or modulo, dont know what to
call it in english) so i can get the remainder. I dont know what the
operator is for cfscript. obvious answer is % but that doesnt work.
So how do i
Have you tried using MOD instead of %?
- Original Message -
From: Gabriel Robichaud [EMAIL PROTECTED]
and i want to use the modulus operator (or modulo, dont know what to
call it in english) so i can get the remainder. I dont know what the
operator is for cfscript. obvious answer
% = MOD
Int() will return a float as a whole number.
-Original Message-
From: Gabriel Robichaud [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 1:56 PM
To: CF-Talk
Subject: CFSCRIPT
Hey folks.
questions regarding scripting.
I want to see YY as 0 not 0.25
and i want to use
perfect thanks!!
Nagy, Daniel J wrote:
% = MOD
Int() will return a float as a whole number.
-Original Message-
From: Gabriel Robichaud [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 1:56 PM
To: CF-Talk
Subject: CFSCRIPT
Hey folks.
questions regarding scripting
Walker [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 10:23 PM
Subject: RE: CFSCRIPT syntax
Hi Mark,
Just to add to Raymond's comments,
I think the confusion about hashes and quotes comes about from CF tags,
where you DO need them when you are passing a numeric
Do not enclose complex expressions, such as 1 + 2, with pound signs.
Curiously enough you can do this with CFMX.
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
a cfparam inside of cfscript, I THINK
(don't hold me to this) that the only way to do this is:
cfscript
if(not isDefined(FORM.Date)) FORM.Date = Now();
/cfscript
Of course, this uses the example above and would require more code if you
wanted to ensure the type of data that was coming
Hi All,
I'm going through some code and converting CFSET commands to CFSCRIPT -- a
couple of syntax questions:
1) Where I have a cfset SESSION.ecom.storeVar = SESSION.ecom.s
Should I surround the var with quotes or not? Ie:
SESSION.ecom.storeVar = SESSION.ecom.s;
2) Similarly, where I
:
SESSION.ecom.admin = #URL.admin#;
Don't use the pound signs, you don't need them:
cfset session.ecom.admin = url.admin
cfscript
session.ecom.admin = url.admin;
/cfscript
3) With numeric values, do I need to surround with quotes, ie:
SESSION.ecom.totalCost = 0;
No.
4) Can a CFPARAM
quotes around strings, and you only
need hashes when inserting an expression into a string or cfoutputting
it More or less.
4) Can a CFPARAM statement be written in CFSCRIPT? If so, how?
Take a look at this udf:
http://www.cflib.org/udf.cfm?ID=144
Is there a way to do multiple values per case statement when doing a switch inside of
a cfscript tag?
cfscript
switch (iAnsType){
case 6 :
sAnswer = Replace(sAnswer, ,, |, ALL);
case 7 :
sAnswer = Replace(sAnswer, ,, |, ALL);
}
/cfscript
EG, I was hoping to do
This should do what you are looking for:
cfscript
switch (iAnsType){
case 6 :
case 7 :
sAnswer = Replace(sAnswer, ,, |, ALL);
}
/cfscript
-Original Message-
From: CF Dude [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 12:39 PM
To: CF-Talk
Subject: switch
I think you just use something like below, syntax might be a little(or alot)
wrong though
cfscript
switch (iAnsType) {
case 6:
case 7:
sAnswer = Replace.;
}
/cfscript
Ade
-Original Message-
From: CF Dude
Also, don't forget to put a break; after your code in the case
So, it should be;
cfscript
switch (iAnsType){
case 6 :
case 7 :
{sAnswer = Replace(sAnswer, ,, |, ALL);
break;
}
}
/cfscript
Is there a way to do multiple values per case statement when
701 - 800 of 1308 matches
Mail list logo