AnsweredAssumed Answered

vrf File Pointer DLL Modification

Question asked by VRFuser on Aug 20, 2002
Please let me express my sincere thanks for all the input!  You all have
been a great help.

-Phil

]
>
>Phil -
>
> > (hopefully) my file pointer stays put.
>
>Oh well! Bob and Les are right. When VEE reopens the file it starts from
>square one. You can see the same behavior if you open your file more than
>once in your dll.
>
>Anyway, I can see a couple ways around this. First, return your file
>pointer
>to VEE and have VEE seek to that location. How? Read the file as an array
>of
>UInt8 (to end) and then do something like:
>
>asText(ary[<filepointer>:totSize(ary) - 1])
>
>Now, I have no idea if this will work because I don't have version 6, but
>it
>seems as if it should work.
>
>Second, read the file as a text array (to end) and just use strPosStr to
>search for your keyword. Run the output through a Comparator set to == -1
>and the X Data of the Failures pin identifies the array subscript at which
>your keyword is found. Then just copy from the next element to the end (see
>attached).
>
>Your desire to write loopless VEE is admirable!
>
>BUT: The VEE way with a comparator is almost certainly *much* faster than
>looping with fgets! WHY?? There are two reasons:
>
>First, I/O is *really* slow, and the buffers allocated by the old C RTL
>routines are not very big (like 4K if memory serves) so you're going to hit
>the disk a lot. Window's automatic cacheing will help, but how much is
>debatable.
>
>Second, fgets is an old C RTL routine. Like it or not, it's just not kosh
>with Windows. You can drastically improve performance by using the Windows
>Way with CreateFile / ReadFile / CloseHandle and using Stupid C Tricks to
>do
>your own searching - something like the attached.
>-SHAWN-
><< ArySearch.vee >>
><< SearchFile.txt >>
>---
>You are currently subscribed to vrf as: philmcrevis@hotmail.com
>To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
>To send messages to this mailing list,  email
>"vrf@it.lists.it.agilent.com".
>If you need help with the mailing list send a message to
>"owner-vrf@it.lists.it.agilent.com".




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


---
You are currently subscribed to vrf as: rsb@soco.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@it.lists.it.agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes