Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Included or not
Message
From
14/07/2003 09:44:43
 
 
To
14/07/2003 09:31:14
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00809748
Message ID:
00809809
Views:
34
Agnes,

Sure.
First of all, JUSTSTEM() should be Justpath() .. sorry... ;-)
So, if justpath(tablename) is empty, I use the File() function.
Because the File() function DOES return true for included tables.

E.g. :

loTest = newobject("Opendbf","Opendll.dll")
loTest.c_Path = ""
loTest.c_Table = "alias"
if loTest.OpenDbf() = .T.
&&& Succes
endif

define class Opendbf as session
datasession = 1 &&& you want to open it in the calling-session

c_Path = ""
c_Alias = ""
c_Table = ""
c_Excl = ""

procedure init
with this
.c_Path = ""
.c_Alias = ""
.c_Table = ""
.c_Excl = ""
endwith
endproc

procedure OpenDbf
local llSucces

if file(this.c_Path + this.c_Table+".dbf") .or. (empty(this.c_Path) .and. file(this.c_Table+".dbf"))
llSucces = .T.

endproc
enddefine

Guillaume,
Having problems to understand your IF.
Is table the table you want to open? I don't understand how it could be with an empty file name? Could you post a larger piece of your code so that I have a better idea?

Agnes

>Hi Agnes,
>
>Well, suppose you had a DLL which does all the handling of opening tables for you. That way, you could use the DLL in all your applications.
>You only give it the full path, index, alias and so on.
>But, imagine you use the dll and suddenly, you want to open an included table.
>I solved it by using IF empty(juststem(table) .and. FILE(alias)
>That way, i get TRUE and I know it's included.
>
>Greetz
>
>Guillaume
>
>Hi Guillaume,
>
>why do you need to know that? I figured out that is very tricky to know that a file opend is included under all circumstances , but maybe a specific workaround will do. Anyway, all of may possible ideas will work after openning the table. But you can close it again?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform