-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think in Java this is fine, but it leads to confusion in CF which is
why Macromedia suggests against it
(http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000186.htm).

One question though; if you define a function hash(), does this override
CF's hash function? I guess I'm just being lazy and not wanting to try
this...

Wayne

Bill Rawlinson wrote:
> Creating an object 
> hash = createObject("java","java.util.Hashtable");
> should NOT cause any problems unless your saying hash is a function
> name in CF that I have never heard of.  However, having hash as a
> function name in the util package won't cause any conflicts as there
> is nothing wrong with referencing hash.hash(); though it may be odd to
> read for some people.
> 
> It is actually pretty common to define a new instance of
> java.util.Hashtable as hash:
> 
> import java.util.*;
> ...
> ...
> Hashtable hash = new Hashtable(4);
> ...
> ...
> 
> 
> 
> On Tue, 1 Mar 2005 11:23:28 +1000, Barry Beattie <[EMAIL PROTECTED]> wrote:
> 
>>ahhh...
>>
>>my bad.
>>
>>thanx
>>barry.b
>>
>>
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
>>Behalf Of Roland Collins
>>Sent: Tuesday, 1 March 2005 10:57 AM
>>To: [email protected]
>>Subject: RE: [CFCDev] Using Structures to handle navigation (order
>>problems)
>>
>>It's case sensitive and "util" ;).  Also, hash is a function name, so
>>I'd
>>play it safe:
>>
>><cfscript>
>>ht = createObject("java", "java.util.Hashtable");
>>ht.put( "f", "fred" );
>>ht.put( "b", "barney");
>>ht.put( "w", "wilma");
>>
>>writeOutput(ht.get("b")); // should be "barney"
>></cfscript>
>>
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
>>Behalf
>>Of Barry Beattie
>>Sent: Monday, February 28, 2005 7:16 PM
>>To: [email protected]
>>Subject: RE: [CFCDev] Using Structures to handle navigation (order
>>problems)
>>
>>
>>>>You might also try using one of Java's ordered collections.
>>
>>interesting. how? like this?
>>
>><cfscript>
>>hash = createObject("java", "java.utils.hashtable");
>>hash.put( "f", "fred" );
>>hash.put( "b", "barney");
>>hash.put( "w", "wilma");
>>
>>writeOutput(hash.get("b")); // should be "barney"
>></cfscript>
>>
>>... Uh oh...
>>
>>Object Instantiation Exception.
>>Class not found: java.utils.hashtable
>>
>>(disclaimer: java in CF is still new to me)
>>
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
>>Behalf Of Roland Collins
>>Sent: Tuesday, 1 March 2005 7:27 AM
>>To: [email protected]
>>Subject: RE: [CFCDev] Using Structures to handle navigation (order
>>problems)
>>
>>You might also try using one of Java's ordered collections.
>>
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
>>Behalf
>>Of Daniel Short
>>Sent: Monday, February 28, 2005 2:56 PM
>>To: [email protected]
>>Subject: RE: [CFCDev] Using Structures to handle navigation (order
>>problems)
>>
>>Yep, I have it all working with a query now. The query remembers the
>>order
>>things were added, which is exactly what I'm after. This way the user
>>can
>>add navigation items as they please, in the order they please, without
>>any
>>problems.
>>
>>Thanks everyone.
>>
>>Dan
>>
>>
>>>You can of course order a query, using ORDER BY in the sql.
>>>If you don't
>>>have a column to sort by already, you can add one to your QueryNew()
>>>function and set the value (perhaps the index of your loop?) with
>>>QuerySetCell()
>>
>>----------------------------------------------------------
>>You are subscribed to cfcdev. To unsubscribe, send an email to
>>[email protected] with the words 'unsubscribe cfcdev' as the subject of
>>the
>>email.
>>
>>CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
>>(www.cfxhosting.com).
>>
>>An archive of the CFCDev list is available at
>>www.mail-archive.com/[email protected]
>>
>>----------------------------------------------------------
>>You are subscribed to cfcdev. To unsubscribe, send an email to
>>[email protected] with the words 'unsubscribe cfcdev' as the subject of
>>the email.
>>
>>CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
>>(www.cfxhosting.com).
>>
>>An archive of the CFCDev list is available at
>>www.mail-archive.com/[email protected]
>>
>>----------------------------------------------------------
>>You are subscribed to cfcdev. To unsubscribe, send an email to
>>[email protected] with the words 'unsubscribe cfcdev' as the subject of
>>the
>>email.
>>
>>CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
>>(www.cfxhosting.com).
>>
>>An archive of the CFCDev list is available at
>>www.mail-archive.com/[email protected]
>>
>>----------------------------------------------------------
>>You are subscribed to cfcdev. To unsubscribe, send an email to
>>[email protected] with the words 'unsubscribe cfcdev' as the subject of
>>the email.
>>
>>CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
>>(www.cfxhosting.com).
>>
>>An archive of the CFCDev list is available at
>>www.mail-archive.com/[email protected]
>>
>>----------------------------------------------------------
>>You are subscribed to cfcdev. To unsubscribe, send an email to 
>>[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
>>email.
>>
>>CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
>>(www.cfxhosting.com).
>>
>>An archive of the CFCDev list is available at
>>www.mail-archive.com/[email protected]
>>
>>
> 
> 
> 


- --
Wayne Graham
Earl Gregg Swem Library
PO Box 8794
College of William and Mary
Williamsburg, VA  23187
757.221.3112
http://support.swem.wm.edu/wayne/blog
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCJIh5PfSkOZBClrURAvk9AKDApVjbsoLRz/G4fNEsxNwkHoEZWQCg7ZcI
f1cp76wFxWgepHPCn43oh5M=
=/PeB
-----END PGP SIGNATURE-----

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]

Reply via email to