Solved. The Queue ViewPosition var doesnt work with Position() in all cases.
And my debugger was only showing 1000chars/bytes from the ViewPositions 1024 chars/bytes.
Dont know why the debugger is showing the wrong value, but debugview exists as a backup which shows the correct value.
Here’s the modified template code which works in C6
ABBrowse.tpw
Line2181
#Insert(%MakeField, 'ViewPosition', '', 'String(1024)','Entry''s view position')
change to
#Insert(%MakeField, 'ViewPosition', '', 'String(' & %LongestKey() &')','Entry''s view position')
and then add at the bottom of the ABBrowse.tpw file
#Group(%LongestKey)
#Declare(%KeyLength)
#Set(%KeyLength,0)
#Fix(%File,%Primary)
#For(%Key)
#For(%KeyField)
#Fix(%Field,%KeyField)
#Set(%KeyLength,%KeyLength+%FieldMemoSize)
#EndFor
#EndFor
#Set(%KeyLength,%KeyLength+4) #!Adds Position()'s 4 bytes + sum of the sizes of the fields in the key
#IF(%KeyLength<1024) #!If the KeyLength is less than the original ViewPosition var's 1024 chars/bytes, it keeps it that way for compatibility reasons.
#Set(%KeyLength,1024)
#EndIF
#Return(%KeyLength)
This %LongestKey group gets the Queue’s Primary file’s keys and works out which key and its fields totalled is the longest and then makes the viewposition that length if its longer than the current 1024 chars. If its less than 1024 chars, it keeps it that way because I dont know if anyone else is doing stuff to the ViewPosition var.
This should get rid of all the Error 78’s, including the one’s mentioned here What causes an Error 78 and/or sometimes "phantom" records in a browse? but let me know if it doesnt.