AnsweredAssumed Answered

vrf - 'Clear File at pre-run' boxes and ticks

Question asked by VRFuser on Jul 18, 1997
Stan Bischof wrote:
> "Gustin, Mike" <> wrote:
> >
> > I would appreciate help with this problem.
> >
> > I am currently using 3.12 running on windows 3.11. My processor is an intel
> > 133MHz Pentium.
> >
> > I am using a "To File" object  in my program twice in both cases it is
> > writting to the same file. The first instance is in my main program where I
> > write header information to the file. This instance has the box for clearing
> > the file at prerun checked. The second instance is in an imported vee
> > routine.
> > The box is not checked to clear the file at prerun in that test program.
> >
> > When the main program is run and the second instance "To File"  is imported
> > the check box for clearing the file is checked off. The orginal program does
> > not have it checked but the imported version is checked to clear.
> >
> > How do you fix this problem???
> Remember that the file system allows exactly _one_ write pointer to
> a given file from your VEE process. This is not a VEE issue per se
> but rather is a basic function of the OS and file system.
> What this means inside VEE is that all the TO FILE objects referring to
> a given file must share the same pointer. Hence they also must
> share attributes such as "clear the file at prerun".
> Now, in your case, just what is the "problem" that needs to get fixed?
> It sounds like you want your file to be cleared at prerun. And I'm guessing
> that your imported routine wants to append to the file rather than
> clearing it? If so you shouldn't have any problems.
> Another way of looking at this:
> Your VEE program is writing to exactly one file. You have
> multiple TO FILE objects. It would make no sense for one of them
> to say "clear the file at prerun" and another to say
> "don't clear the file at prerun". Can't have it both ways, given that
> prerun occurs exactly once!
> Perhaps I'm missing the point. Please explain further what you are trying
> to do and what isn't working.
> regards
> Stan Bischof

The above explenation of Stan is clear. Others pointed out to use a To/File object
with a clear action and DON'T have the 'Clear File at pre-run' boxes checked.
Some remarks from my side:
  1. Same problems hold for To/From dataset. There is, however no, no
     'transaction-block'. You always need seperate T0File objects.
  2. Why is the 'Clear File at pre-run' box still active when you have a control
     pin for the filename attached to the object? Using a Filename input clearly
     indicates that the filename and so the filepointer too are to be determined
     during programm execution. Perhaps it should also be an regular input
     i.s.o. a control input.
  3. Why are there differences in the nummer of available control-inputs between
     To/From file and To/From dataset objects. In my oppinion they are basically
     the same; ToFrom dataset has additional features for schema/data, reflected
     in somewhat different behaviour of 'Rewind' and 'Clear'. Why same names than?

I once saved  a lot of data through a To Dataset objects in a UserFunction with
the name MyFile on it, but with a FileName control input.  When I wanted to do
similar measurements some weeks later, I had to build a simple test first.
This test also used a ToFile object but with 'Clear File at pre-run' box checked.
(So also the box in the libarie became checked!!!!) When finally starting the
measurements, I could not append any data to files anymore: the old data was

I recommend HP to change vee so that behaviour as from above can not occure anymore.
At least you can put warning signs on the object, manuals, etc....


Remi Tuijtelaars,
   Philips Semiconductors,  Dev. T&D,   BZ-2.090
   Gerstweg 2, 6534 AE Nijmegen, The Netherlands
   tel: +31-24-353-2812     fax: +31-24-353-3160