Can anyone tell me why this code in a history view produces duplicates? (bonus: 5 fake internet points to the winner!!!)
//main impression array placeholder
local arrImp = array()
//individual line with values
local result = array()
//array to return
local Imps = array()
//var to track where to insert into new array
local insertme = 0
//get the impression history
arrImp = getfield(LIST_OBS('IMPRESSION','Signed','delimited',"value"),"|","")
//loop through the impressions keeping non-blanks and ones matching to a signer's name
for s = 1, s <= size(arrImp),s=s+1
do
result = array()
//get the list of fields in the current array item
result = getfield(arrImp[s],"^","")
//if size of value field > 0 and signee's name match the string, change whoever to something useful
if (size(result[1])>0 and match(result[4],"WHOEVER")>0) then
insertme = insertme + 1
//insert text into return array
set(Imps,insertme,hret + size(arrImp) + hret + result[2] + " " + result[3] + " - " + result[4] + hret +result[1] + hret)
else "" endif
endfor
IF (size(Imps) > 0) THEN
Imps
ELSE
""
ENDIF
Hello,
Would you mind attaching a text-file with your history view in it, or emailing me at [email protected] directly? I tried testing your code as written in my system, but it seemed to function correctly.
Thank you,
Daniel Carpenter