[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

2521.0. "PUBLIC Array?" by LEXSS1::GINGER (Ron Ginger) Thu Mar 20 1997 09:34

    I need an array  of strings that is global to my entire application.
    I assumed a simple PUBLIC FOO(100) as String in my global declarations
    section of the first form would work, but that gets a runtime error
    that says public arrays are not allowed.
    
    How can I declare a PUBLIC array for use anywhere in my app?
T.RTitleUserPersonal
Name
DateLines
2521.1Global, not public?TURRIS::twuwuv.zko.dec.com::howerThu Mar 20 1997 10:345
Declaring an array as
	Global foo(100) as string 
still seems to work.. Maybe Public only applies to routines? (docs to 
the contrary, if I recall :-}
		Helen
2521.2suggestionXSTACY::PATTISONA rolling stone gets the wormMon Mar 24 1997 11:438
You might consider using a Collection instead, its often easier
to work with than an array.

(Members of a collection don't have to be OLE objects, they may
be variants)

Dave
2521.3LEXSS1::GINGERRon GingerMon Mar 24 1997 15:098
    I had to put the declaration into a general module. Neither PUBLIC or
    GLOBAL is accepted in Form code.
    
    I think I could have left it in the Form module and refered to it as
    Form.foo(x) as well. But I need some general basic code anyway, so I
    Put the PUBLIC there.
    
    Thanks for the tips.