>Hi Ed,
>
>Are Inp and Out funtions in a later version of VFP? If not is it possible to read and write to a port directly in VFP?
>
I have no idea if the two .DLL entrypoints below work, or if another product would work in its place. I'd expect to talk to a VXD to get at ports on a Win9x box, and to be pulling most of my hair out getting at them under NT without Admin privileges. I didn't suggest the two routines below, just corrected what the user did wrong syntactically.
>>>Ed Rauh,
>>> I have a problem to pass a hexadecimal parameter in VFP but in Vb that is ok, why ?
>>> Below is VB code :
>>>
>>>>Dim PortAddress As Integer
>>>>Dim nData As Integer
>>>>PortAddress = &H2E3
>>>>Out PortAddress, 128
>>>>PortAddress = &H2E0
>>>>nData = 1
>>>>Out PortAddress, nData
>>>>text1.text= Inp(PortAddress)
>>>
>>> Do you know how to pass a hexadecimal value of "&h2E3" to the PortAddress in VFP ? When i display the return value from Inp(PortAddress), it is not the actual value i want that is not an integer!!
>>>how to solve it ?
>>
>>VFP represents hexidecimal notation in constants by prefixing with
0x; for example:
>>
>>? ox2E3 && prints out 739
>>
>>In your case,
Out(0x2E3,128) would send 128 (0x80) out port 0x2E3 (739 decimal). To read from port ox2E0, you'd say
Inp(0x2E0).
>>
>>Numbers by default are displayed in decimal notation. To display a number in hexidecimal format, use the TRANSFORM() function with the '@0' argument for formatting. For example, to display 739 in hexidecimal notation:
>>
>>? TRANSFORM(739,'@0) && prints 0x000002E3