Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to define data type for integer,binary & hexadecima
Message
De
03/02/1999 22:01:58
 
 
À
24/01/1999 15:41:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00179567
Message ID:
00183755
Vues:
22
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?

>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform