obfusc88 wrote on Jul 3
rd, 2007 at 3:23am:
I am not sure what you are doing yet but I will try to figure this out in the next few days.
The code basically does this:
1. @XLookupSourceListAll() gathers all previous records in the database that have the same phone number as the current new record, and brings back the data from each external element that's named in the semicolon-delimited list, between the last set of quotes.
2. If there's no error (meaning it found a match), sort the string array. This will sort primarily by the first element in the array, which happens to be the date.
3. Now that the records in the array are sorted by date, we can simply pluck the last record from the array to find the most recent one. So, I use @CountStringArray() to find out how may records are in the array.
4. @AccessStringArray() uses the result from the previous step (which is now in the vCount variable) to know which record is the last one in the array. It sets vStr to contain only that last record.
5. Each of the element values can now be extracted with @AccessStringArray(), using a number which represents the position of the desired element, as it appeared in the element list in @XLookupSourceListAll().
In order to keep is simple, I left out a few other steps in between these that change the StringArraySeparator. But, this should give you a the general idea of the code sample.