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.
 avatar
unknown
autohotkey
a year ago
244 B
6
Indexable
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)
}
Editor is loading...
Leave a Comment