How to know if data table is privateHello everybody,
I'd like to use the
subscribe to data table list()
function to handle all tables that the user opens during the execution of a script of mine. Since the script is also creating its own private data tables, I need a way to detect whether a data table is private in order to treat it differently from data tables opened by the user. I have looked for a "is Private" function but could not find it.
The
<<HAS data="https://community.jmp.com/" view=""></HAS>
message is not working as I would like it to. I think this could be related the the fact the data view is created after the "onopen" function of the data table subscription is triggered.
thanks for your help!
Matteo
ScriptingRe: How to know if data table is privateI tried the scripting index example in JMP 15 and changed Big Class to private. It is not seen by open or close, which is what I'd expect. Can you share an example?
Re: How to know if data table is privateIf it is your script that is generating the private tables, then perhaps the easiest way to know if a table is private is to maintain a list of the tables that you are creating; then you can just cross reference that list.
Re: How to know if data table is privateThanks @Craige_Hales,
Here is an example of what I'm seeing. It really seems that the fopen function is triggered at the very initial creation of the data table object.
names default to here(1);
fopen = Function( {dt},
print(dt<<HAS data="https://community.jmp.com/" view=""></HAS>Re: How to know if data table is privateHi @David_Burnham ,
in fact, I would like to detect all data tables created during execution of my script, but treat differently the private ones (basically doing nothing on them), from the visible ones created by the user. This cannot be handled by a list, I think. See also my reply to @Craige_Hales.
thanks!
Matteo
Re: How to know if data table is privateI'm pretty sure closing the table during the open leaves JMP 15 in a slightly broken state @audrey_shull . Don't do that; the table names, at a minimum, seem confused afterward. I'm pretty sure the behavior will be different in JMP 16.
I'm also puzzled; neither call back is made here:
does not print "opening" or "closing"
My opinion is that the callbacks should never be made for private data tables. That's part of what private means...they should be hard to observe and mess with. @chungwei
Re: How to know if data table is privateHi @Craige_Hales ,
you are right, one should not close the table inside the "open" callback function. This is not what I actually need to do, I put it in my example just as a way to explore what was happening, but it's not the key issue.
You are also right that when using "Open(..., private)" , the "open" callback function is not activated. This is exactly the behavior I would need.
But, in my example, I was using "New Table(..., private)" . In this case the "open" callback function is activated. This is where I need a way to know that the table is private and to manage it differently.
thanks again!
Matteo