Is there anyway.. If not it would be a nice wishlist feature.

John Hemmer hemmerjohn at hotmail.com
Mon Jul 19 22:37:41 PDT 2004


----- Original Message ----- 
From: "Jerry Rains" <jmrains at peoplepc.com>
To: <filepro-list at lists.celestial.com>
Sent: Sunday, July 18, 2004 12:29 AM
Subject: Re: Is there anyway.. If not it would be a nice wishlist feature.


> On Saturday 17 July 2004 19:17, John Hemmer wrote:
> > I have a field number in a dummy variable.
> >
> > I would like to update the field value. not the
> > field number. something like the inverse of
> > using FIELDVAL to obtain the field value
> > when you have the field number in a dummy
> > variable.
> >
> > Given that F contains the field number and
> > V is the new value to put in the field, I was
> > hoping I could update he field by codes such
> >
> > as:  (F)=V ,   but I get a syntax error when I
> > do a syntax check with dcabe.
> >
> > I know I can accomplish what I want to do
> > with MID commands and by equivalencing
> > the real fields to an array, but I was hoping
> > I would not need that much code.
> >
> > Is there a simpler way to accomplish this.
> 
> I'm not sure why you would need mid() commands to 
> do this.  Setup an array that maps the real fields then
> use F to write V.
> 
> Then:  DIM Ary[NUMFIELDS]:1
> 
> Then:  Ary[F]=V
> 
> Jerry
> >
> > TIAA
> >
> > John

Jerry,

Thanks, that works.

What I did not realize is the Full Power of the filepro DIM statement.  
Though I have used it a lot,  I was under the impresession that one 
had to explicitly define the field lenght and edit type of each field 
aliased.   So in the past I have used DIM for part of a file where I had 
several contigous like fields, or counted the number of bytes in the
section of the file I needed and defined an array with one field of 
many bytes, and then used the MID command to pick out the data.

Filepro in many ways is a very powerful language.

John


PS  Ken and Jay, thanks for your interest.


  


More information about the Filepro-list mailing list