|
-
Apr 20th, 2023, 09:25 AM
#11
Re: TwinBasic
 Originally Posted by SearchingDataOnly
In the following code, if you add a string to an ArrayList of type vbLong, the system will report an error.
Code:
Dim AL As cArrayList
Set AL = New_c.ArrayList(vbLong)
AL.Add 100
AL.Add "Hello"
Code:
Dim AL As cArrayList
Set AL = New_c.ArrayList(vbLong, "Hello")
That is, error handling is controlled internally by the person writing the ArrayList class, not by the compiler.
Ahh, that makes sense. I still prefer the compiler support for generics but I can see the potential use for the example you gave, it is a definite step in the right direction compared to VB6's existing collection objects.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|