V4MD Info about setBlank()
info at vallemediatime.com
info at vallemediatime.com
Thu Oct 6 22:51:53 CDT 2005
----- Original Message -----
From: "Ruslan Zasukhin" <sunshine at public.kherson.ua>
To: <valentina at lists.macserve.net>
Sent: Thursday, October 06, 2005 10:09 PM
Subject: Re: V4MD Info about setBlank()
> On 10/6/05 10:56 PM, "info at vallemediatime.com" <info at vallemediatime.com>
> wrote:
>
> > Hi list,
> > I need to better understand the use of Table.setBlank method
> >
> > I've tried this:
> >
> > on CreateTable_Person
> > Person = gDb.createTable("Person")
> > Person.createUShortField("fPerson_ID", [#fUnique])
> > Person.createStringField("fPerson_Name", 20)
> > Person.createByteField("fPersonType_Ref")
> > end
> >
> > on AddRecordsTo_Person
> > Person = gDb.table(Person)
> > fPerson_ID = Person.field("fPerson_ID")
> > fPerson_Name = Person.field("fPerson_Name")
> > fPersonType_Ref = Person.field("fPersonType_Ref")
> > curTable.setBlank()
> > curTable.addRecord()
> > end
> >
> > When I add a record I want to set all Person.fields to EMPTY... is this
> > script right or is better someother code?
>
> Of course it will be empty! :-)
>
> Look what you do:
>
> 1) you enter new values for fields
> > Person = gDb.table(Person)
> > fPerson_ID = Person.field("fPerson_ID")
> > fPerson_Name = Person.field("fPerson_Name")
> > fPersonType_Ref = Person.field("fPersonType_Ref")
>
> 2) then you do SetBlank()
>
> OOOOOOOOOOPS
>
> You have erase all your new values !
>
> The correct code is:
>
> --------------------------------------
> on AddRecordsTo_Person
>
> Person = gDb.table(Person)
>
> Person.setBlank()
>
> fPerson_ID = Person.field("fPerson_ID")
> fPerson_Name = Person.field("fPerson_Name")
> fPersonType_Ref = Person.field("fPersonType_Ref")
>
> curTable.addRecord()
>
> end
> --------------------------------------
>
> Wait wait wait wait.
>
> Paolo, you have even double mistake.
>
> fPerson_ID = Person.field("fPerson_ID")
> fPerson_Name = Person.field("fPerson_Name")
> fPersonType_Ref = Person.field("fPersonType_Ref")
>
> This only give you fields. But I do not se any line to add new values.
Ivan wrote me now about the addRecord logical procedure:
for me addRecord mean create a new emptyRecord and after write into it's
field and at the end update it
for you addRecord mean update the current record with the filled fields and
after create a newRecord in the first lofical position of DB.
Two various ways to think... now I've understand this step.
> --
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
>
>
> --
> Internal Virus Database is out-of-date.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
>
>
More information about the Valentina
mailing list