plook
IS-IT--Management
- Apr 1, 2000
- 33
Hi Dudes !
I've got a little problem using the ArraySort function in CF. I have two books saying opposite things regarding the way to use that function.
One way says that ArraySort returns a boolean value and the other book says that the value returned is an Array !!
So I tried both ways ...
<CFSET Variable_Never_Declared_Before = ArraySort(MyArray,"textnocase","desc">
and
<CFSET MyArray = ArraySort(MyArray,"textnocase","desc">
both give me the same error. So I declared a second Array, thinking maybe I cannot sort the array and put it in the same array after...
<CFSET MyArray2 = ArraySort(MyArray,"textnocase","desc">
Same Error !!
Here is the long error message I got with all the previous attempts :
-------------------
The expression has requested a variable or an intermediate expression result as a simple value, however, the result cannot be converted
to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are
examples of complex values.
The most likely cause of the error is that you are trying to use a complex value as a simple one. For example, you may be trying to use a
query variable in a &ltCFIF> tag. This was possible under Cold Fusion 2.0 but is an error under later versions.
The error occurred while evaluating the expression:
MyArray = ArraySort(MyArray,"textnocase","desc"
The error occurred while processing an element with a general identifier of (CFSET), occupying document position (167:1) to (167:61)
------------------
Line 167 refers to the line in question..
Does anybody know what I am doing wrong here ?
This array is a two-dimension one if that matters !
Thanks a bunch in advance
Dominic
I've got a little problem using the ArraySort function in CF. I have two books saying opposite things regarding the way to use that function.
One way says that ArraySort returns a boolean value and the other book says that the value returned is an Array !!
So I tried both ways ...
<CFSET Variable_Never_Declared_Before = ArraySort(MyArray,"textnocase","desc">
and
<CFSET MyArray = ArraySort(MyArray,"textnocase","desc">
both give me the same error. So I declared a second Array, thinking maybe I cannot sort the array and put it in the same array after...
<CFSET MyArray2 = ArraySort(MyArray,"textnocase","desc">
Same Error !!
Here is the long error message I got with all the previous attempts :
-------------------
The expression has requested a variable or an intermediate expression result as a simple value, however, the result cannot be converted
to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are
examples of complex values.
The most likely cause of the error is that you are trying to use a complex value as a simple one. For example, you may be trying to use a
query variable in a &ltCFIF> tag. This was possible under Cold Fusion 2.0 but is an error under later versions.
The error occurred while evaluating the expression:
MyArray = ArraySort(MyArray,"textnocase","desc"
The error occurred while processing an element with a general identifier of (CFSET), occupying document position (167:1) to (167:61)
------------------
Line 167 refers to the line in question..
Does anybody know what I am doing wrong here ?
This array is a two-dimension one if that matters !
Thanks a bunch in advance
Dominic