Article View: borland.public.vdbase.data.sql
Article #1212Re: Ver 7.01 => Rowset.fields["***"].value - problem
From: Romain Strieff [TeamB]
Date: Wed, 08 Apr 1998 00:00
Date: Wed, 08 Apr 1998 00:00
79 lines
3404 bytes
3404 bytes
In article <6gebug$odk2@forums.borland.com>, tinzi@iafrica.com grudgingly
admits...
> True as well; I think I know what to do (make use of add() and delete the
> variable contents on exit of form.
------
That won't work. Variables are scoped to procedure and your form are no
program, even if 50 forms are onscreen waiting for user entry, no
programm is running. Every private and local variable would be out of
scope and public ones will overwrite each other forms variables.
Just create custom properties of the form, that's what encapsulation is
all about, each instance of the form has its own set of properties.
> Have seen something like that in the
> definition of array class... <oref>name = new array()...
------
Don't need that.
just:
f=new form()
f.myprop="whatever"
f.onopen={;msgbox(form.myprop)}
f.open()
> >Yes, written for 5.# but most of it should still work in 7.
>
> Is an update in the pipeline?
-------
Most of us have problems to get the needed time since we need to get
accustomed to this new stuff too.<G>
> Do you have an idea why I always get an Invalid Subscript Reference Error
> for the following code?
>
> function CUSTOMERGROUPNAMECOMBOBOX_onChange
> this.rowset = form.cstgrpdl1.rowset
> form.SelectedGroup = this.rowset.fields["CustomerGroup"].value
> this.form.MainNotebook.EntryField4.value = form.SelectedGroup
> return
--------
This is executed in the Combobox context. THIS means the combobox which
_has_ _no_ rowset! so checking the fields array of a nonexisting rowset
generates this error.
use FORM.rowset..... instead.
> I have applied the changes as recommended by you before. I have tried also
> other versions where I defined SelectedGroup as public in the form_on_open
> event. This lead to undefined variable error msg's.
------
Don't use PUBLICs _ever_.<G>
Just:
Procedure Form_OnOpen
form.selectedGroup="MY group"
> I have the impression that I am missing a basic key (to unlock quite a few
> doors for me) which would enable me to really progress with VdB.
-------
Yes, you mix up THIS and FORM, they are interchangeable _only_ for form
events, in control events, THIS means the control that triggered the
event.
> I see that you are a member of TeamB. I have a suggestion to Borland (maybe
> you can suggest it to them): Why not start a newsgroup for newbies <like me>
> that are starting to learn VdB / dBase.
------
We are _all_ newbees as far as VdB7 is concerned, it's only out a couple
of months.
--
Romain Strieff [TeamB]
Want quick help? Check previous Q and A at:
http://forumsearch.borland.com:88/ and TIs at
http://www.borland.com/VdBASE/vdbprod.html
Technical Details
Message-ID:
<MPG.f9589f691167ec398ab93@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6garpt$kna2@forums.borland.com> <MPG.f942400466c19e698ab7f@forums.borland.com> <6gdjtj$nha8@forums.borland.com> <MPG.f9476687b33bdc498ab8b@forums.borland.com> <6gebug$odk2@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,f0d0f8bab29d096a X-Google-Attributes: gidff5a1,public From: Romain@Do.not.reply.via.e-mail (Romain Strieff [TeamB]) Subject: Re: Ver 7.01 => Rowset.fields["***"].value - problem Date: 1998/04/08 Message-ID: <MPG.f9589f691167ec398ab93@forums.borland.com> X-Deja-AN: 342074843 References: <6garpt$kna2@forums.borland.com> <MPG.f942400466c19e698ab7f@forums.borland.com> <6gdjtj$nha8@forums.borland.com> <MPG.f9476687b33bdc498ab8b@forums.borland.com> <6gebug$odk2@forums.borland.com> Organization: TeamB Reply-To: teamb@opto-pps.com Newsgroups: borland.public.vdbase.data.sql