Choose Language Hide Translation Bar
Highlighted
awoj
Level II

Closing tables using Send operator

I had assumed the following are equivilent operations:

Close( dt, nosave );
dt << Close( nosave );

But now find myself in a position where they don't produce the same results (the 2nd version using the Send operator doesn't close the table).

 

What's the difference?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Closing tables using Send operator

The Close message can be sent to a several JSL objects, but not to data tables. 

 

Data Table doesn't accept the <<Close message at all. If you send this to a "clean" data table (one that is already saved to disk and which has no changes), it also won't close the data table.

 

dt = open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Close(); // nothing happens

 

Takeaway: The function Close() and the message <<Close are not the same thing and are not interchangeable.

 

HTH,

Melanie

 

View solution in original post

3 REPLIES 3
Highlighted

Re: Closing tables using Send operator

I don't know. Close() has been a function of the data table, not part of a message protocol, since JMP 4 when JSL was first introduced. There are a few cases (only a few) where the same result can be accomplished by a function and sending a message. For example, obtaining a reference to the report layer of a platform p can use Report( p ) or it can use p << Report.

Learn it once, use it forever!
Highlighted
awoj
Level II

Re: Closing tables using Send operator

So Close() was never intended to be sent to objects but it might happen to work? I've adopted a legacy script that closes tables exclusively via sending messages... :(
Highlighted

Re: Closing tables using Send operator

The Close message can be sent to a several JSL objects, but not to data tables. 

 

Data Table doesn't accept the <<Close message at all. If you send this to a "clean" data table (one that is already saved to disk and which has no changes), it also won't close the data table.

 

dt = open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Close(); // nothing happens

 

Takeaway: The function Close() and the message <<Close are not the same thing and are not interchangeable.

 

HTH,

Melanie

 

View solution in original post

Article Labels

    There are no labels assigned to this post.