Qbasicnews.com
October 18, 2019, 11:15:20 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Newbie Question about pointers..  (Read 2550 times)
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« on: February 04, 2005, 03:35:48 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
Logged

Antoni
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #1 on: February 05, 2005, 07:00:42 AM »

Code:
for i = l to l
?
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #2 on: February 05, 2005, 07:13:23 PM »

I solved my problem passing prx by value to ReadFile. Guess why...
Logged

Antoni
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!