You can use spanof to get the number of elements in a static array. This is the same as UBOUND when the indexbase is 1.
sys aa[100]
print spanof aa 'result 100
...
for j=1 to spanof aa
aa[j]=j
next
...
IF spanof(g_TabFilePaths) => TabIdx THEN
szCaption = g_TabFilePaths(TabIdx) ' & " | " & "Tab #" & format$(TabIdx)
END IF