Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decipher this code
Message
From
28/07/1999 08:28:58
 
 
To
28/07/1999 07:45:14
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00247040
Message ID:
00247054
Views:
17
>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.
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