PC Review


Reply
Thread Tools Rate Thread

cast sortedlist value as hashtable

 
 
fizzy
Guest
Posts: n/a
 
      7th Apr 2005
i have a sortedlist.
its values are hashtables.

i need to access one of these hashtables:

using option strict without a cast, i got a late binding error :

mysortedlist("key")

when i try to cast it:

directcast(mysortedlist("key"), "hashtable") or
ctype(mysortedlist("key"),"hashtable")

i get an error "type expected"

what is the correct way to perform the case? can anyone help?
thanks in advance!

 
Reply With Quote
 
 
 
 
Larry Lard
Guest
Posts: n/a
 
      7th Apr 2005

fizzy wrote:
> i have a sortedlist.
> its values are hashtables.
>
> i need to access one of these hashtables:
>
> using option strict without a cast, i got a late binding error :
>
> mysortedlist("key")
>
> when i try to cast it:
>
> directcast(mysortedlist("key"), "hashtable") or
> ctype(mysortedlist("key"),"hashtable")
>
> i get an error "type expected"
>
> what is the correct way to perform the case? can anyone help?


You are almost there!

directcast(mysortedlist("key"), HashTable)

No quotes

--
Larry Lard
Replies to group please

 
Reply With Quote
 
janine
Guest
Posts: n/a
 
      7th Apr 2005
cannot believe i missed that one!! i'm so stupid - but thanks for not
saying so larry

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generic SortedList clashes with SortedList (namespace collision) raylopez99 Microsoft VC .NET 1 30th Jan 2007 03:50 PM
Which collection object to use similar to SortedList\Hashtable Kiran Microsoft VB .NET 3 18th Feb 2006 06:55 PM
How to CAST string into object (hashtable) Peter Microsoft C# .NET 2 18th Oct 2004 05:47 PM
Collection, HashTable or SortedList? DraguVaso Microsoft VB .NET 3 6th Aug 2004 05:18 PM
Collection, HashTable or SortedList? DraguVaso Microsoft Dot NET 3 6th Aug 2004 05:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:35 AM.