AnsweredAssumed Answered

VRf-records field naming

Question asked by VRFuser on May 24, 1996
> I=B4m currently using VEE3.2 under both HP-UX and WIN enviroments.
> I have the need to build records which field names can change while
> execution.
> I=B4ve solved the problem under HP-UX by using a litle sophisticated
> combination of HP-UX commands ('ed' , 'tr' and others). These commands=20
> modify the data set file which contains the record structure. But,
> obviously, this solution is not valid when I try to port the programme
> to a WIN platform.
> I need to know any other way to do it valid in both platforms.
> Tanks.

There are two ways to do this that are completely portable:

(1) Create the record in VEE ascii format as a string and feed to a
"from string" object reading in "container" format. This requires a
little bit of work to understand the ascii format, and it could
likely break at future releases but is otherwise quite simple.

(2) Write a utility - say strReplace(str, old,new)- that replaces
occurences of one string with another. Then create a record with dummy
names, write that record to a string, replace the names, and then
read into a record using a "from string" object. This is a
little slower and clumsier but should also be more robust since
you are not relying upon the VEE ascii syntax. This is what I
have done for our user group here and it works great.

Stan Bischof