Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to define data type for integer,binary & hexadecima
Message
From
04/02/1999 08:09:28
 
 
To
03/02/1999 22:01:58
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00179567
Message ID:
00183813
Views:
28
>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
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform