Omnis Studio - Datafiles name
Mischa
mischa at omnislab.com
Tue Jan 13 05:02:39 EST 2015
Hi Stephane,
the last used data file path is stored in the nameless master class of the
library (showing up as '#PASSWORDS' in the Studio browser, when class filter
is disabled). #PASSWORDS always has the $ident 256. There is no direct
access to its contents, you can however use the binary functions of Studio
to read out the stored information.
To put the content of #PASSWORDS into a binary variable use
Calculate mID as 256
Calculate mBin as $clib.$classes.[mID].$classdata ;; binary of Master
Class
Note that $clib.$classes.256.$classdata does not work, you need square
bracket notation, otherwise Omnis will not access #PASSWORDS.
The length of the data file path is stored at offset 8, the data path is
stored at offset 9. I have not yet tested what happens when the path length
exceeds 255 bytes (something not very likely). The challenge now is to
convert a binary variable into a string or numeric value. Fortunately,
Studio offers bintohex(Bin) returning a hex representation for the binary
variable as a string variable. From there you can proceed in converting the
needed substrings to numeric or literal values as needed.
I have written an object for such binary functions, but I hope you got the
idea how to do it on your own. If you or anyone else needs the object I can
put it on my website.
Hth
Mischa
--------------------------------------------------
T H E O M N I S L /\ B www.omnislab.com
---------------------------------------------------
-----Ursprüngliche Nachricht-----
Von: omnisdev-en-bounces at lists.omnis-dev.com
[mailto:omnisdev-en-bounces at lists.omnis-dev.com] Im Auftrag von Stephane
Pras
Gesendet: Montag, 12. Jänner 2015 21:34
An: OmnisDev List - English
Betreff: Omnis Studio - Datafiles name
When you open a Library, the last Datafile used automatically reopen.
Anybody knows where and how its name is saved by Omnis ?
I would like to catch this information and use it Š $cdata().$name becomes
available only after the datafile is opened and made current.
Stephane
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com
More information about the omnisdev-en
mailing list