Alan: Understood. I saw that you were using the 3rd parm but didn't look much further.
Glad that the issue is resolved. -- Douglas von Roeder 949-336-2902 On Sat, Aug 20, 2016 at 12:58 PM, Alan Tilson <[email protected]> wrote: > Douglas, > Thanks for your ideas on this one but I seem to have shot myself in the > foot! > Alan > > On Sat, Aug 20, 2016 at 3:44 PM, Douglas von Roeder <[email protected]> > wrote: > > > Alan: > > > > I haven't checked on this issue, I'll admit, but, as we know, sometime > > troubleshooting is gets down to removing all of the variables till we get > > to "Yup, it's broke!" > > > > I appreciate you publicizing this, BTW. > > > > -- > > Douglas von Roeder > > 949-336-2902 > > > > On Sat, Aug 20, 2016 at 12:40 PM, Alan Tilson <[email protected]> > > wrote: > > > > > Douglas, > > > I'm testing it on different versions of the same data file, one that > is 6 > > > months old, one that is current and one that was upgraded to v15. All > the > > > data files I have are based upon one file that has been upgraded many > > > times. > > > I did rebuild the index on the field that the array is based upon, but > > that > > > didn't change anything. > > > I did use different selections from the Table in question. > > > I created a blank array and stepped through it filling the values from > > the > > > S2A array and when the first one of the "bad" values appeared the count > > was > > > immediately 2. > > > I manually typed the search for criteria into Count in Array thinking > > there > > > might be some weird hidden characters. > > > I'll fake the array into a blank data file & see what happens. > > > Thanks, > > > Alan > > > > > > > > > On Sat, Aug 20, 2016 at 3:13 PM, Douglas von Roeder < > > [email protected]> > > > wrote: > > > > > > > Alan: > > > > > > > > Though it shouldn't make a difference, are you testing this scenario > on > > > > different data files? > > > > > > > > -- > > > > Douglas von Roeder > > > > 949-336-2902 > > > > > > > > On Sat, Aug 20, 2016 at 12:00 PM, Alan Tilson <[email protected]> > > > > wrote: > > > > > > > > > Hello out there, > > > > > A little more information might shed light on something, like > > > > > > > > > > 1. the array is created with Selection to Array > > > > > 2. the values that give the wrong Count are always the same > > > > > 3. they give these bad Count values immediately after the array > is > > > > > created. > > > > > > > > > > I'm baffled! > > > > > Alan > > > > > > > > > > > > > > > On Fri, Aug 19, 2016 at 6:16 PM, Alan Tilson <[email protected] > > > > > > wrote: > > > > > > > > > > > Hello again, > > > > > > A bit more testing indicates this error only occurs when the > > starting > > > > > > element is more than 1, at least in my example. > > > > > > The result should be 2 (elements 2 & 3) and it is 2 if I start > > with 1 > > > > but > > > > > > the result is 4 if I start with 2! > > > > > > And it seems only to occur when the result is greater than 1. > > > > > > Thanks, > > > > > > Alan > > > > > > > > > > > > On Fri, Aug 19, 2016 at 6:07 PM, Alan Tilson < > [email protected] > > > > > > > > wrote: > > > > > > > > > > > >> Hello everyone, > > > > > >> > > > > > >> I have a method whose purpose is to delete the values from one > > array > > > > > (a1) > > > > > >> from another array (a2). > > > > > >> So I > > > > > >> > > > > > >> 1. Sort both arrays > > > > > >> 2. Loop through the the array containing the values (a1) to > be > > > > > deleted > > > > > >> 1. Use Find in Array to see if the value in a1 is present in > a2 > > > > > >> 1. If yes, use Count in Array to determine the number > to > > be > > > > > >> deleted > > > > > >> 2. Use DELETE FROM ARRAY to the number of elements > found > > > > > >> > > > > > >> I have found situations in v13.3, v13.6 and v15.0 where the > number > > > of > > > > > >> elements counted in step 2.1.1 does not match the Debug windows > > > > display > > > > > of > > > > > >> the array. > > > > > >> > > > > > >> The basic code is below. And it works at least 90% of the time. > > > > > >> > > > > > >> Any ideas would be appreciated! I have written a replacement for > > > this > > > > > >> function but I am having a hard time believing that something > this > > > > basic > > > > > >> doesn't work... > > > > > >> > > > > > >> Thanks, > > > > > >> Alan Tilson > > > > > >> > > > > > >> $pAr_DeleteFrom:=$1 > > > > > >> $pAr_ValuesToDelete:=$2 > > > > > >> $count_i:=$3 > > > > > >> > > > > > >> SORT ARRAY($pAr_DeleteFrom->;>) > > > > > >> SORT ARRAY($pAr_ValuesToDelete->;>) > > > > > >> > > > > > >> $start:=0 > > > > > >> For ($el;1;Size of array($pAr_ValuesToDelete->)) > > > > > >> > > > > > >> $_ValueToDelete:=$pAr_ValuesToDelete->{$el} > > > > > >> $start:=Find in array($pAr_DeleteFrom->;$_ValueToDelete;$start) > > > > > >> If ($start=-1) > > > > > >> > > > > > >> $start:=0 > > > > > >> > > > > > >> Else > > > > > >> > > > > > >> $count_toDelete:=Count in array($pAr_DeleteFrom->;$_ > > > > > ValueToDelete;$start) > > > > > >> > > > > > >> DELETE FROM ARRAY($pAr_DeleteFrom->;$start;$count_toDelete) > > > > > >> > > > > > >> End if > > > > > >> > > > > > >> End for > > > > > >> > > > > > > > > > > > > > > > > > ************************************************************ > > ********** > > > > > 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:[email protected] > > > > > ************************************************************ > > ********** > > > > > > > > > ************************************************************ > ********** > > > > 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:[email protected] > > > > ************************************************************ > ********** > > > ********************************************************************** > > > 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:[email protected] > > > ********************************************************************** > > > > > ********************************************************************** > > 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:[email protected] > > ********************************************************************** > > > ********************************************************************** > 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:[email protected] > ********************************************************************** > ********************************************************************** 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:[email protected] **********************************************************************

