>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