Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decipher this code
Message
From
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:
00247082
Views:
22
>>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:-)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform