Article View: comp.os.ms-windows.programmer.tools
Article #902Scoping rules in VB 2.0 ?
From: Hans-Jochen Schmitt
Date: Mon, 11 Jan 1993 12:40
Date: Mon, 11 Jan 1993 12:40
32 lines
1691 bytes
1691 bytes
The new VB 2.0 MDI support is fantastic ! True Form inheritance, autosizing toolbars etc. etc.... But: How do one manage to reference local varibales within a Form from outside ? Problem: Assume a drawing form, that contains local variables (declared in the Declaration section of the Form). These variables describes the picture that is shown on the Form. When making instances from this Form, anything works fine: every Form contains its own set of variables. But: If you want to write a save-and-load logic for these Forms, you can not reference these Form-local variables from outside the Form (eg. the MDI-Desktop). Is there any way to reference instance-variables of a Form ? Something like ActiveForm.MyArray(1).MyName ? The only workaround so far I found is a very clumsy setup: - define a Button within the MDI-child - make this Button invisible - attach the Load or Save function to this Button - "Click" this button (in the ActiveForm) from the MDI-menu option The problem still remaining is that I can't pass parameters to the Form- local procedure (execpt using the Tags from invisible controls). Any hints ? Hajo Schmitt Technical University Darmstadt
Technical Details
Message-ID:
<hajo.81.0@bwl.bwl.th-darmstadt.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!news.th-darmstadt.de!bwl.bwl.th-darmstadt.de!hajoShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!news.th-darmstadt.de!bwl.bwl.th-darmstadt.de!hajo From: hajo@bwl.bwl.th-darmstadt.de (Hans-Jochen Schmitt) Newsgroups: comp.os.ms-windows.programmer.tools Subject: Scoping rules in VB 2.0 ? Date: 11 Jan 1993 12:40:15 GMT Organization: Inform.Systems Department, University of Darmstadt Lines: 32 Message-ID: <hajo.81.0@bwl.bwl.th-darmstadt.de> NNTP-Posting-Host: bwlpc15.bwl.th-darmstadt.de