02-04-2005, 11:35 PM
I can't make this work... please help
Code:
'$INCLUDE:'Win\kernel32.bi'
dim shared hcom as integer
dim shared rx(1 to 91) as ubyte ,prx as ubyte ptr,lrx
dim shared tx(1 to 91) as ubyte ,ptx as ubyte ptr,ltx
.
.
hcom=open_com_1
.
.
.
fill_tx
ltx=91
ptx=@tx(1)
rawprint ptx,ltx <<this call to rawprint works
fsuccess=WriteFile(hcom, ptx ,ltx,num,byval 0)
.
.
prx=@rx(1)
fsuccess=Readfile(hcom,prx,91,lrx,byval 0)
rawprint prx,lrx <<this call to rawprint
returns only lf lrx=0
.
.
close_com_1
end
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sub rawprint (byval ptt as ubyte ptr,byval l)
dim i,ptx as ubyte ptr,a
ptx=ptt-1
for i=1 to l
ptx=ptx+1
print a,ptx
a=*ptx <<<< the second call to rawprint breaks here
next
end sub
Antoni