static int32 getarraysize(struct script_state* st, int32 id, int32 idx, int isstring, struct DBMap** ref)
{
int32 ret = idx;
if( isstring )
{
for( ; idx < SCRIPT_MAX_ARRAYSIZE; ++idx )
{
char* str = (char*)script->get_val2(st, reference_uid(id, idx), ref);
if( str && *str )
ret = idx + 1;
script_removetop(st, -1, 0);
}
}
else
{
for( ; idx < SCRIPT_MAX_ARRAYSIZE; ++idx )
{
int32 num = (int32)__64BPTRSIZE(script->get_val2(st, reference_uid(id, idx), ref));
if( num )
ret = idx + 1;
script_removetop(st, -1, 0);
}
}
return ret;
}