"John Wing" <jwing@psemc.com> wrote:
> Is it possible to programmatically enter field names when building records?
>
> John
yes, but not using the built-in objects. you need to create a function
that does this. Browse the archives and you'll find several examples.
Stan
--------------------------------------------------------------------------
Stan Bischof Agilent Technologies 707-577-3994 stan_bischof@agilent.com
--------------------------------------------------------------------------
---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
> Is it possible to programmatically enter field names when building records?
>
> John
yes, but not using the built-in objects. you need to create a function
that does this. Browse the archives and you'll find several examples.
Stan
--------------------------------------------------------------------------
Stan Bischof Agilent Technologies 707-577-3994 stan_bischof@agilent.com
--------------------------------------------------------------------------
---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
I needed to do the same thing for a project a while back. I wrote a function
called CreateRecordField(Name,Type,InitialValue). It outputs a record with a
single field of the specified name and type. You then use the "Merge Records"
object to merge fields into a single record.
If you have VeePro 6 or 7, you can download it at:
www.360deg.org/ftp/dyna_rec.zip
(Note this is a temporary link, though I'll leave it for a few months)
My sample function currently only recognizes "Text" and "Int32" formats, but
it's very easy to add other formats.
Theory of operation:
The concept is to unravel VEE's internal code behind a record's structure
using a ToString object. Simply send a sample record, containing one field,
through a ToString object with a single transaction (Write Container X). The
output is an array of strings describing the record in VEE's internal format.
Write some code to search through the strings and replace the sample fieldname
with the desired fieldname. Then run the resulting array through a FromString
(Read Container X). You now have a record with the appropriate field name.
Using the same principle, you can also change the Type of the field. For best
compatibility, I chose to simply create one sample record for each data type,
and use an IF to feed the right sample record into my search-and-replace.
Robin Findley
rfindley@usa.net
------ Original Message ------
Received: Tue, 12 Apr 2005 01:20:00 PM CDT
From: "John Wing" <jwing@psemc.com>
To: VRF <vrf@agilent.com>
Subject: [vrf] programmatically enter field names in Records
> Is it possible to programmatically enter field names when building records?
>
> John
---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".