arraybuild dFound,“/”,“Cattle Database-Active”,Unique,(Check="Y”)
This code works in the following programme (sorry its so long, but I think you need it all to figure out what is happening and/or reproduce it):
local dListID,dListLetterID,dFind,dFound, dfoundLetterID,dListNumID,dfoundNumID,dResult
arraybuild dListID, "/", "Import Tag Data", ID
let n = arraysize(dListID,"/")
let dListLetterID=""
let dListNumID = ""
looparray dListID,"/",dFind
dListLetterID = arrayinsert(dListLetterID,1, 1, "/")
arraybuild dfoundLetterID, "/", "Cattle Database-Active", Unique,TotalID contains dFind
dListLetterID = arraychange(dListLetterID, dfoundLetterID, 1, "/")
dListNumID = arrayinsert(dListNumID,1, 1, "/")
arraybuild dfoundNumID, "/", "Cattle Database-Active", Unique,ID = val(striptonum(dFind))
dListNumID = arraychange(dListNumID, dfoundNumID, 1, "/")
endloop
arrayboth dListLetterID,dListNumID,"/",dResult
arraystrip dResult,"/"
setactivedatabase "Cattle Database-Active"
looparray dResult,"/",dFind
find Unique = val(dFind)
Check = "Y"
endloop
arraybuild dFound,"/","Cattle Database-Active",Unique,(Check="Y")
if n < arraysize(dFound,"/")
Message "Extra records selected compared to the original data. Please check for duplicate ID"
endif
if n > arraysize(dFound,"/")
Message "Not all data records have been located in this database. Please double check data"
endif
openform "SearchList", "database","Cattle Database-Active"
selectSearch = "Y"
showvariables selectSearch
But if I add a single line of extra code, it doesn’t work.
local dListID,dListLetterID,dFind,dFound, dfoundLetterID,dListNumID,dfoundNumID,dResult
arraybuild dListID, "/", "Import Tag Data", ID
let n = arraysize(dListID,"/")
let dListLetterID=""
let dListNumID = ""
looparray dListID,"/",dFind
dListLetterID = arrayinsert(dListLetterID,1, 1, "/")
arraybuild dfoundLetterID, "/", "Cattle Database-Active", Unique,TotalID contains dFind
dListLetterID = arraychange(dListLetterID, dfoundLetterID, 1, "/")
dListNumID = arrayinsert(dListNumID,1, 1, "/")
arraybuild dfoundNumID, "/", "Cattle Database-Active", Unique,ID = val(striptonum(dFind))
dListNumID = arraychange(dListNumID, dfoundNumID, 1, "/")
endloop
arrayboth dListLetterID,dListNumID,"/",dResult
arraystrip dResult,"/"
setactivedatabase "Cattle Database-Active"
looparray dResult,"/",dFind
find Unique = val(dFind)
Check = "Y"
Worknotes = superlookup("Import Tag Data",|||««TotalID»» contains ID|||,|||Comments|||)
endloop
arraybuild dFound,"/","Cattle Database-Active",Unique,(Check="Y")
if n < arraysize(dFound,"/")
Message "Extra records selected compared to the original data. Please check for duplicate ID"
endif
if n > arraysize(dFound,"/")
Message "Not all data records have been located in this database. Please double check data"
endif
openform "SearchList", "database","Cattle Database-Active"
selectSearch = "Y"
showvariables selectSearch
I receive the following (mysterious) error:
which I don’t understand because I don’t think I’ve referred to a variable ‘e’
It doesn’t appear to be a problem with the extra line,
Worknotes = superlookup(“Import Tag Data”,|||««TotalID»» contains ID|||,|||Comments|||)
because it has successfully done what I was asking it to do, before the procedure stops. Any help or explanations or work arounds gratefully accepted.