or, you could just start counting, which may be easier, for example if you had 8 tanks in total =
_ap = player
_tank1 = _this select 0
_tank2 = _this select 1
_tank3 = _this select 2
_tank4 = _this select 3
_tank5 = _this select 4
_tank6 = _this select 5
_tank7 = _this select 6
_tank8 = _this select 7
_num = 0
#checking
? (_num = 8):[] exec "objcomplete.sqs"
? (_ap knowsabout _tank1):_num = _num + 1
? (_ap knowsabout _tank2):_num = _num + 1
? (_ap knowsabout _tank3):_num = _num + 1
? (_ap knowsabout _tank4):_num = _num + 1
? (_ap knowsabout _tank5):_num = _num + 1
? (_ap knowsabout _tank6):_num = _num + 1
? (_ap knowsabout _tank7):_num = _num + 1
? (_ap knowsabout _tank8):_num = _num + 1
~0.2
goto "checking"
that will have a number, and will add one every time you find a tank, simple, that may not work if you find about the same tank twice, but Im not sure if you can, can you?