Using Filestream DOTNET with NAV

OldNavDogOldNavDog Member Posts: 88
edited 2014-06-06 in NAV Three Tier
Since the THEY have now RUINED the usefulness of the FILE Commands SEEK and READ...

Yes, the "SEEK" command (and the "READ") are still technically "Supported"; HOWEVER, in NAV 2013 or above, if you attempt to do a READ into a Text Variable that has a Length LONGER than the amount of Bytes "left" to Read, you get a nasty Error.

Reading into an INSTREAM avoids the error (and nicely tells you how many bytes WERE read); but it has no "SEEK" method (!!!!)

:roll:

Other than the hokey suggestions to read into a "char" variable, one character at a time, there doesn't seem to be a way to "skip around" in a file (SEEK) (like FILE.READ supports), but still read-in a potentially shorter-than-variable-length number of bytes (like INSTREAM.READ supports).

I note that the Filestream DOTNET Class (in mscorlib) supports SEEK, and the same "Read n Bytes, or until EOF") functionality; but I'm not good enough with DOTNET to figure out how to make it work from within C/AL. ](*,)

Can someone help?

TIA!!!
Experience is what you get, when you don't get what you want. --Anon.
Sign In or Register to comment.