CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Location
    Moscow, Russia
    Posts
    25

    Please help me with VB syntax!!!

    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.

  2. #2

    Re: Please help me with VB syntax!!!

    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






  3. #3
    Join Date
    Sep 1999
    Location
    Moscow, Russia
    Posts
    25

    Re: Please help me with VB syntax!!!

    Thank you for you reply.

    Dmitry Leonov.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured