Click to See Complete Forum and Search --> : Please help me with VB syntax!!!


dmile
November 26th, 1999, 06:40 AM
Hello!

Could you possibly help me with VB syntax? To be more exactly I work in MS Access 97 VBA.

I just want to do the following:

1. Declare an array of CONST STRINGs and initialize all strings in the same declaration.
2. Pass this array as a ParamArray in the function with the following prototype:

Public Function DropTables(ParamArray myArray()) As Boolean


Is this impossible?

I'm a C/C++ programmer, for me it is very difficult to understand VB syntax.

Thanks in advance.
Dmile.


Dmitry Leonov.

czimmerman
November 26th, 1999, 06:24 PM
1. In VB, you can't initialize all strings in the same declaration in an array. When you declare your string array, all strings will be initialized to "".

2. You don't need to declare the parameter of your function as a string. You can just have it be a string array. Change the declaration to:

Public Function DropTables(myArray() as string) As Boolean

Charlie Zimmerman
http://www.freevbcode.com

dmile
November 27th, 1999, 10:40 AM
Thank you for you reply.

Dmitry Leonov.