token_string_count

Declaration

token_string_count (tokens, delimiter: STRING): INTEGER

Description

Returns the number of delimiter-separated items in the tokens. Useful for writing loops with token_string_item that work on each item in a tokenized string. Only uses the first character of delimiter.

See Also

sort_token_string
token_string_item
string functions

Example

script build_report is
  num_profiles := token_string_count (profile_names, ',')
  i := 0;
  while i < num_profiles loop
    prof_name := token_string_item (profile_names, ',', i)
    load_profile_vars (prof_name)
    -- do something with the variables
    i := i + 1
  end
end