Christian,
> > String str1Arr [] = str.split("~");
>
> The split function was introduced in 1.4.1 and most versions of CFMX
Yes you are right.
Pre 1.4.0.. yes you had to use StringTokenizer Class. I am running CFMX
using J2SE 1.4.1_04. I can return 2 Dimentional ArrayLists back to CFMX
from the JavaBean fine and it acts like CFMX Type Vector
i.e i can use array Notation to get the 2D Array Items back.
> myArrayList = createObject("java", "java.util.ArrayList");
I am trying to move the above usage OUT of CFMX.. ie JavaBean..
Processing Data Structures/Collections Natively.
Here is the INTERESTING Part.
<cfscript>
xObj = createObject("Java","DevCollectionObjs");
xAlist = xObj.get2DArray(str); //ArrayList return type...
//if you call xAList.indexOf("objectElem").. it WONT WORK!
//NOW loop over xAlist and create a CFMX Vector Type
//BELOW CODE WORKS
tmpArray = arrayNew(1);
for(i=1;i < arrayLen(xAlist);i=i+1)
tmpArray[i]=xAlist[i];
xIdx = tmpArray.indexOf("searchString");// This works.
//NOW if you just have a reference.. tmpArray=xAlist; This WONT Work with
.indexOf()
</cfscript>
I think the above might have to do with some kind of CFMX Internal
Collection type casting.
Thanks again.
Joe Eugene
> -----Original Message-----
> From: Christian Cantrell [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2003 12:27 AM
> To: Joe Eugene
> Subject: Re: [CFCDev] Java Vector/ArrayList Methods within CFMX
>
>
>
> On Monday, July 7, 2003, at 11:01 PM, Joe Eugene wrote:
>
> > Yes, the above works.. since xArray is a Vector..
>
> I was trying to draw your attention to this code, which both works and
> uses an ArrayList:
>
> // This is an ArrayList
> myArrayList = createObject("java", "java.util.ArrayList");
> myArrayList.add("a");
> myArrayList.add("b");
> myArrayList.add("c");
> writeOutput(myArrayList.indexOf("b"));
>
> Anyway, I don't think that has anything to do with your problem. My
> current theory is that your problem is this line:
>
> > String str1Arr [] = str.split("~");
>
> The split function was introduced in 1.4.1 and most versions of CFMX
> are running with 1.3.1. Is it possible that you are compiling your
> Java source with 1.4.1, then trying to run it within ColdFusion with
> 1.3.1? What platform are you on, and how are you compiling?
>
> If this isn't it, I'll take another stab.
>
> Christian
>
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).