Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decipher this code
Message
From
28/07/1999 09:50:06
 
 
To
28/07/1999 09:21:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00247040
Message ID:
00247105
Views:
28
>>>This code piece was taken from an MS site article and on top was saying "....using this code". If it wasn't MS itself I would think a mistyping or personal code.
   CLEAR
>>>   DO CASE
>>>      CASE "6.0"$VERSION()
>>>         lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
>>>            "Exclusive=No;SourceType=DBF;SourceDB="+HOME(2)+"DATA"
>>>      CASE "5.0"$VERSION()
>>>         lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
>>>            "Exclusive=No;SourceType=DBF;SourceDB="+HOME()+"SAMPLES\DATA"
>>>      CASE "3.0"$VERSION()
>>>         lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
>>>            "Exclusive=No;SourceType=DBF;SourceDB=D:\VFP30\SAMPLES\DATA"
>>>   ENDCASE
Cetin
>>
>>If this is a qustion, it's building a connect string using directories that are available in more certain fashions on a version-specific basis; 6 provides the HOME(2) to locate the Samples directory (if its installed), 5 relies on the samples being installed by default to the SAMPLES folder beneath VFP's base installation directory, and 3 required you to guess, since I think you had to install the samples by hand. I'd be willing to bet in gets used to make an ODBC connection somewhere... :-)
>>
>>If you find the code annoying, I agree completely; it's not an example of overwhelmingly good coding technique, since it isn't even testing to see if the directroy in question exists before referencing it!
>>
>>Bletch.
>I wondered why it was not home() but "d:\VFP30" in version 3. I have been using home() before 3.0 :) Maybe in 3.0 samples were only for those having a CD as drive D:-)

I vaguely remember that you had to do something manual to install the samples, so there wasn't a predictable location under 3.0; it's been a long time since I looked at the samples under 3...
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