Re: How to determine if a SET exists?

2016-10-19 Thread Tom Dillon
Kirk Brooks wrote: >That being said I think the best solution for me right now is the error 39 >trap Jeremy and David and some others have suggested. Just FYI, the Save Set command saves the specified set to a document unless the set does not exist, in which case no document is created, no error

Re: How to determine if a SET exists?

2016-10-18 Thread Kirk Brooks
David, On Tue, Oct 18, 2016 at 5:12 PM, David Adams wrote: > I thought that I already had a Set_Exists("Set_Name") : Boolean > function...but I didn't. Thanks for the conversation, ​Almost always ready to converse. And "yeah, I thought I had that too" until I tried to find it. Thanks for actual

Re: How to determine if a SET exists?

2016-10-18 Thread Kirk Brooks
Doug, On Tue, Oct 18, 2016 at 12:13 PM, Douglas von Roeder wrote: > Use set throws error 39 if the referenced set does not exist. However, > Records in set returns 0 *without* throwing an error. Hmm… > > Your point about recreating the set is valid but that also sidesteps the > possibility that

Re: How to determine if a SET exists?

2016-10-18 Thread John DeSoi
I thought about this as a feature request, but I have not officially posted it yet. It would be really useful if 4D could call a method of your choosing when an object goes out of scope (no more references to it). Lots of other languages have something like this which allows you to ensure that r

Re: How to determine if a SET exists?

2016-10-18 Thread David Adams
I thought that I already had a Set_Exists("Set_Name") : Boolean function...but I didn't. Thanks for the conversation, this code works in V13 (what I have open right now): C_BOOLEAN($0;$exists) C_TEXT($1;$set_name) $set_name:=$1 Error:=0 ErrorHandler_Install ("ErrorHandler_SuppressError") C_BOO

Re: How to determine if a SET exists?

2016-10-18 Thread Sujit Shah
Depending on the scope of the set you can wrap the CREATE SET and CREATE EMPTY SET so each time a set is created you add it to an Object or Array. Then you simply test if that set name is in the array. The same wrapper can be used when the set is Cleared so the arrays/ object is in sync. It is s

Re: How to determine if a SET exists?

2016-10-18 Thread Jeremy French
Hi Kirk, Have you tried trapping for error code 39 ("The set does not exist") with the command "Is in set"? If the set is nonexistent, error 39 ("The set does not exist") occurs. So you could have method that you pass the set name to, invoke ON ERR CALL, call the “Is in set” command, and retur

Re: How to determine if a SET exists?

2016-10-18 Thread Douglas von Roeder
On Tue, Oct 18, 2016 at 10:46 AM, Kirk Brooks wrote: > Doug, > I thought about that too. But then I'm fiddling around with the current > selection. > > I guess there's no issue with simply re-creating a set if it has no records > in it.. > Kirk: Agreed. I just ran a bit of code (V12) to unders

Re: How to determine if a SET exists?

2016-10-18 Thread Kirk Brooks
Doug, I thought about that too. But then I'm fiddling around with the current selection. I guess there's no issue with simply re-creating a set if it has no records in it.. On Tue, Oct 18, 2016 at 8:28 AM, Douglas von Roeder wrote: > Kirk: > > IIRC, activate an error handler prior to calling th

Re: How to determine if a SET exists?

2016-10-18 Thread Kirk Brooks
Randy, That was my first thought too. In this case I need to know if the set has been attempted to be created. But maybe not. Have to work with what I have I suppose. On Tue, Oct 18, 2016 at 8:16 AM, Randy Engle <4d.l...@xc2.us> wrote: > Kirk, > > It's not 100% what you are looking for, but I'm

Re: How to determine if a SET exists?

2016-10-18 Thread Douglas von Roeder
Message- > From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Kirk > Brooks > Sent: Tuesday, October 18, 2016 7:35 AM > To: 4D iNug Technical <4d_tech@lists.4d.com> > Subject: How to determine if a SET exists? > > Hi all, > Is there a way to deter

RE: How to determine if a SET exists?

2016-10-18 Thread Randy Engle
C2 Software LLC -Original Message- From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Kirk Brooks Sent: Tuesday, October 18, 2016 7:35 AM To: 4D iNug Technical <4d_tech@lists.4d.com> Subject: How to determine if a SET exists? Hi all, Is there a way to determine if a se

How to determine if a SET exists?

2016-10-18 Thread Kirk Brooks
Hi all, Is there a way to determine if a set exists? So far the only thing I've come up with requires keeping track of them as they are created. This is OK but unverifiable. It would be nice to have the equivalent of the 'Is a list' function. -- Kirk Brooks San Francisco, CA