sharma
18th September 2004, 09:37
Hi friends
I want to use seq.read.local( ref string buf, ref long size, long lfn )
but I am not understanding what is ref string buf & ref long size
Please explain in detail or some example.
Thanks
mr_suleyman
18th September 2004, 10:32
hello there
look at following code
file = "/bse/data.txt"
fp = seq.open(file,"r")
if fp < 1 then
message("ERROR................")
endif
while ( seq.eof(fp) = 0 )
ret = seq.read(txtdata,1,fp)
| it read 1 character from starting point (fp) and assing its value to txtdata.
endwhile
Good lucks ...
Hitesh Shah
20th September 2004, 07:42
I interpret the arguments as follows.
ref string buf - value readin in the local client file will be stored in buf variable.
ref long size - Maximum nnumber of characters to read. For succssful read it will return the number of characters read .
long lfn - read file pointer returned by seq.open.local
Do give us the feedback on this.
malutz
20th September 2004, 08:41
Hej,
this is what it says in the Baan-Help.
Syntax
long seq.read.local( ref string buf, ref long size, long lfn )
Description
This reads a specified number of bytes from a specified file into buf.
Arguments
buf This returns the data read from the file.
size This returns the number of bytes read from the file.
lfn The file pointer, as returned by seq.open.local() when the file was opened.
Note
You cannot use seq.*() functions in combination with the seq.*.local() functions. So, you cannot use seq.read.local() on a file that was opened with seq.open().
Return values
>=0 success
<0 error; probably lfn not connected
Context
ttdllbw library function.
sharma
20th September 2004, 11:37
Thanks for everybody.
According to Mr. Suleyman I got solve my problem.
But when I was using Seq.read.local(buffer,len(buffer),lfn)
I was getting a error arrgument 2 should be use with some reference.
thanks
Hitesh Shah
20th September 2004, 11:55
The function prototype tells clearly the reference type long variable for 2nd argument. So just declare a long variable and pass that in the function 2nd argument.
sharma
22nd September 2004, 07:32
Thanks a lot.
I got understand this error.