Function to Determine Variable Types

This snippet defines a function `VarTypes` that takes an input and determines its type. It checks against a static list of types and returns the matching ones as a comma-separated string.
mail@pastecode.io avatar
unknown
autohotkey
a month ago
244 B
2
Indexable
Never
VarTypes( p_Input )
{
  static st_Types := "integer,float,number,digit,xdigit,alpha,upper,lower,alnum,space,time"
  Loop, Parse, st_Types, `,
    If p_Input is %A_LoopField%
      l_Output .= "," A_LoopField
  Return SubStr(l_Output,2)
}
Leave a Comment