Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB/VC H-File to a VFP H-File
Message
From
27/09/1998 12:24:01
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00141225
Message ID:
00141242
Views:
24
>The following code is in a VB/VC H-File. What would the VFP equivalent be?
>const LONG PTR_S_JOURNAL        = 1;
>const LONG PTR_S_RECEIPT        = 2;
>const LONG PTR_S_SLIP           = 4;
>
>const LONG PTR_S_JOURNAL_RECEIPT= PTR_S_JOURNAL | PTR_S_RECEIPT;
>const LONG PTR_S_JOURNAL_SLIP   = PTR_S_JOURNAL | PTR_S_SLIP   ;
>const LONG PTR_S_RECEIPT_SLIP   = PTR_S_RECEIPT | PTR_S_SLIP   ;
>
>The first 3 are easy, but I do not understand the last 3. Are they concatenations of 2 constants? e.g., would PTR_S_JOURNAL_RECEIPT be defined as 1 | 2 ==> 12? PTR_S_JOURNAL_SLIP defined as 1 | 4 ==> 14?
>

Those are logical ORs; you can do the same thing with numerical values in VFP with addition, assuming that the bits involved do not have overlapping power of two values. For your examples,


#DEFINE PTR_S_JOURNAL 1
#DEFINE PTR_S_RECEIPT 2
#DEFINE PTR_S_SLIP 4

#DEFINE PTR_S_JOURNAL_RECEIPT PTR_S_JOURNAL + PTR_S_RECEIPT && 3
#DEFINE PTR_S_JOURNAL_SLIP PTR_S_JOURNAL + PTR_S_SLIP && 5
#DEFINE PTR_S_RECEIPT_SLIP PTR_S_RECEIPT + PTR_S_SLIP && 6
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
Next
Reply
Map
View

Click here to load this message in the networking platform