Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 19th, 2005, 10:15 AM
Authorized User
 
Join Date: Oct 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default Array & Collections, Option Private Module

Hi,

My questions are:
1. Diff. b/w Array and Collections? Which will be faster in which circumstances?
2. What is the use of Option Private Module and where it should be used efficiently?
3. What is the use of Option Compare and where it should be used efficiently?

A.D.Ramkumar
__________________
Ramkumar A D
 
Old January 19th, 2005, 01:06 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Except for an array of variants, each element of an array is of the same type.
Each item in a given collection can be anything.

Arrays are referenced by a numeric index.
Collection items can be referenced by their key, or by a numeric reference. (The number for a particular item can change, if items are deleted from the collection.)

Arrays can be multi-dimensional, collections cannot.

I believe array elements are always faster to reference, but they are often not as useful as collections.




Option Compare sets how strings will be compared to each other.
With Option Compare Text, "AbC" is = to "abc".
With Option Compare Binary, "AbC" is not = to "abc".
If you need explicit text comparisons, where case-sensitivity matters, use Option Compare Binary.
If you find yourself using . . . UCase(x) = UCase(y) . . . types of conversions all over the place to make your code work, think about setting Option Compare Text to ease the case-checking rules.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Option Group Variables (from Form to Module) emanuele.musa VB How-To 1 July 20th, 2007 03:58 PM
Passing an array from module to form ftm Excel VBA 2 March 8th, 2007 07:39 AM
Option Button & Macro jvanhalderen Excel VBA 2 November 28th, 2004 04:09 PM
How to pass option button array? John Pennington Classic ASP Professional 2 March 8th, 2004 04:41 PM
How do I pass a option button array John Pennington Beginning VB 6 1 March 5th, 2004 03:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.