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

I see. You determine on the input of your DLL. I try to figure out if a file opend by some process is included or not - this seems to be harder.
The crushing point is, that my tests (using DBF()) show me a path fo the included files as well. Since this path is the one where the table is collected from, I have no idea how to figure out if I have opend the included or the external. All what I know is that a include file shows ISREADONLY() .T. under all circumstances - but to compare with an external it is not of help.

Anyway, like you I normaly know if I open an internal file. So there seems to be no need to go deeper in this.

Agnes
>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?
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform