Copying logical fields to a memo field in one database

Copying logical fields to a memo field in one database

Post by Hugh Ril » Wed, 06 Nov 1996 04:00:00



I was wondering if anyone had any suggestions on this.

I have a table with numerous logical fields and a couple of memo fields. What
I'd like to do is this:

When someone enters a false logical in a field, that field name will be added
to one of the memo fields.

I've got a form for users to enter the data, so I'm thinking that that can be
designed to do the job, but I'm not sure exactly how. I am a OPAL beginner, but
don't let that scare you away from suggesting code.

Please let me know if anyone has any ideas. Anything will be much appreciated.

Thanks in advance.

 
 
 

Copying logical fields to a memo field in one database

Post by Adrian M » Thu, 07 Nov 1996 04:00:00


If you find out the field number of the field in question, then you
can find out the name of the field from that. The field number is help
as one of the properties for a given table, and once you have
referenced this use this little snippet:

var
        tab     table
endvar

tab.atrtach(mytableframe) ;replace with your table
if not myLogicialField then
        myMemoField=tab.fieldname(myTableFrameFieldNumber)
endif

There are various other ways of retrieving the names of the fields in
a table, such as enumDatabaseStruct etc.

have a look in the help files for more information.

Simon keefe


>I was wondering if anyone had any suggestions on this.
>I have a table with numerous logical fields and a couple of memo fields. What
>I'd like to do is this:
>When someone enters a false logical in a field, that field name will be added
>to one of the memo fields.
>I've got a form for users to enter the data, so I'm thinking that that can be
>designed to do the job, but I'm not sure exactly how. I am a OPAL beginner, but
>don't let that scare you away from suggesting code.
>Please let me know if anyone has any ideas. Anything will be much appreciated.
>Thanks in advance.


 
 
 

Copying logical fields to a memo field in one database

Post by David F. Kelto » Thu, 07 Nov 1996 04:00:00


Hugh,

If you use copyToArray(arrayName),  the array will hold the values of the
fields starting with column 1 and ending with the last column in the
table.  The values can then be accessed by either field nmae or ordinate
column position: e.g.

var
 ar Array[] AnyType
 tc Tcursor
endvar

try
 tc.open(":MyAlias:MyTableName.db")
 scan tc:
  tc.copyToArray(ar)
  switch
   case tc.(1) : ;;// do something etc.
  endswitch            
 endscan        

This assumes that the first column is a logical field.

--
David
______________________________________________________________________
: Datacraft Systems, Inc. - Paradox Consulting and Training
: URL: http://www.db.com  - Multi-user Database Development and Design
: Philadelphia - New York - Washington DC


> I was wondering if anyone had any suggestions on this.

> I have a table with numerous logical fields and a couple of memo fields. What
> I'd like to do is this:

> When someone enters a false logical in a field, that field name will be added
> to one of the memo fields.

> I've got a form for users to enter the data, so I'm thinking that that can be
> designed to do the job, but I'm not sure exactly how. I am a OPAL beginner, but
> don't let that scare you away from suggesting code.

> Please let me know if anyone has any ideas. Anything will be much appreciated.

> Thanks in advance.