spss.GetVariableCount Function (Python)
spss.GetVariableCount(). Returns the number of variables in the active dataset.
Example
#build a list of all variables by using the value of
#spssGetVariableCount to set the number of for loop interations
varcount=spss.GetVariableCount()
varlist=[]
for i in range(varcount):
varlist.append(spss.GetVariableName(i))