Kirk, something seems odd about this code. Toward the end you have:
If ($key#"") QUERY([KVP];[KVP]key=$key;*) QUERY([KVP]; & ;[KVP]dir=$dir;*) QUERY([KVP]) End if That last Query([Table]) would bring up the query editor. I’ve never tried doing that at the end of a string of Query parameters. Either I have specified query parameters (the last one NOT ending in ;*) or I bring up the query table by referencing just the table and no parameters. Perhaps this is what you need? If ($key#"") QUERY([KVP];[KVP]key=$key;*) QUERY([KVP]; & ;[KVP]dir=$dir) ELSE QUERY([KVP]) End if __ Ron Rosell President StreamLMS > On Jul 21, 2017, at 9:58 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > I need some ideas on a problem. > > I'm getting a crash when a method runs. The method itself isn't the issue, > I think, because it gets called literally hundreds of times in a given > session. Here it is: > > C_TEXT($1;$2;$dir;$key) > > $key:=$1 > > $dir:="" > > If (Count parameters=2) > > $dir:=$2 > > End if > > ASSERT($key#"";"No key for a KVP find.") > > If ($key#"") > > QUERY([KVP];[KVP]key=$key;*) > > QUERY([KVP]; & ;[KVP]dir=$dir;*) > > QUERY([KVP]) > > End if > > > The crash is happening as soon as the query runs when it's called in the > context of a process that I spin up for a specific task. Now as I say this > method is called frequently. I tried running it with the same parameters it > gets in the crash scenario with no problem. This surprised me. So just for > fun I ran the datafile through MSC and it comes back some errors in an > index not related to this table at all. I repair it all anyway and still > get the crash. > > I try some different source records for the process even though the lookup > that's being performed is the same for all of them. I still get the crash. > > So, I'm looking for other avenues to explain what might be going on here. > > -- > Kirk Brooks > San Francisco, CA > ======================= > > *The only thing necessary for the triumph of evil is for good men to do > nothing.* > > *- Edmund Burke* > ********************************************************************** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ********************************************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************