🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.basic.visual
2 messages
2 total messages Started by ccjjs@vm.cc.olem Mon, 10 Jan 1994 15:32
How do you define and dimension arrays for an entire project??
#3
Author: ccjjs@vm.cc.olem
Date: Mon, 10 Jan 1994 15:32
18 lines
933 bytes
I'm just getting into VB for DOS and want to set up an array of variables
which will be available to all the sub-procedures in the project.  How do I do
that????  This would be the equivalent of global variables in C or Pascal.

When I try to do this in the code module of the form I'm told that executable
code is not allowed there.  Help, the manual isn't of much use for this.

Thanks,

------------------------------------------------------------------------------
John J. Schuster                       ELECTRONICS ENGINEER
UNIV. OF MS.           /^^^^^^^\       OFFICE    (601)232-7206
OCIS                  <--0-/\-0->      MESSAGES  (601)232-5043
POWERS HALL, RM. 302   \ \\\\\\ /      BITNET    CCJJS@UMSVM
UNIVERSITY, MS  38677   \///////       INTERNET  CCJJS@SUN1.MCSR.OLEMISS.EDU
               <<Super   \\\\\\\  Plussss Computing>>
______________________________________________________________________________

Re: How do you define and dimension arrays for an entire project??
#29
Author: cravitma@arctic.
Date: Mon, 10 Jan 1994 22:06
36 lines
1463 bytes
In article <ccjjs.13.000F8B11@vm.cc.olemiss.edu> ccjjs@vm.cc.olemiss.edu (John J. Schuster) writes:
>I'm just getting into VB for DOS and want to set up an array of variables
>which will be available to all the sub-procedures in the project.  How do I do
>that????  This would be the equivalent of global variables in C or Pascal.
>
>When I try to do this in the code module of the form I'm told that executable
>code is not allowed there.  Help, the manual isn't of much use for this.

If your project has a .BAS file as its startup file, skip to step 3
below.

1. Create a .BAS file in your project, and make it the startup module.
2. Put in the startup module the following lines of code to show your
   first form (assuming your form is able to handle things from
   there.)

	formName.SHOW 1
	END
3. At the beginning of the .BAS file, DIM your arrays like this (I
   _think_ this is correct syntax; if not, it is pretty close and
   should get you on the right track) :

	DIM COMMON SHARED MyStringArray$(1 TO xxx)
	DIM COMMON SHARED MyNumericArray (1 TO xxx)

Hope this helps; drop me a note if not and I'll see if I can dig up
some code in which I have done this.

/Matthew

--
Matthew Cravit                      | All opinions expressed here are
Michigan State University           | my own. I don't speak for Michigan
East Lansing, MI 48825              | State, and they don't speak for me
E-Mail: cravitma@cps.msu.edu        | (thank goodness).

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads