Hi Benoit,
in bug #589, comment #6, [0] you wrote that the C code
interface = PMD_Find_Inteface ( &hid[i], i, USB1608FS_PID);
would translate to
Const USB1608FS_PID As Integer = &H007D& ' from usb_1608FS.h
...
PMD_Find_Interface(VarPtr(Hid[I]), I, USB1608FS_PID)
(Yes, we're still trying to solve this problem and the ones around it in the
German Gambas forum where it was initially posted.)
But VarPtr() apparently cannot handle the array syntax used in its argument,
as it "takes only one identifier". See attached script which also contains a
good workaround.
Regards,
Tobi
[0] https://code.google.com/p/gambas/issues/detail?id=589
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
#!/usr/bin/gbs3
Extern inet_aton(Ip As String, AddrOut As Pointer) As Integer In "libc:6"
Public Sub Main()
Dim aIp As String[] = ["8.8.8.8", "192.168.1.1"]
Dim aAddr As New Integer[2]
Dim iAddr As Integer
Dim iInd As Integer
For iInd = 0 To aIp.Max
#If True
Debug "inet_aton =";; inet_aton(aIp[iInd], VarPtr(aAddr[iInd]))
#Else
Debug "inet_aton =";; inet_aton(aIp[iInd], VarPtr(iAddr))
aAddr[iInd] = iAddr
#Endif
Next
Debug Hex$(aAddr[0]), Hex$(aAddr[1])
End
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user