mIRC Homepage
Posted By: Doqnach isnum -> isdec / ishex - 03/09/04 12:41 PM
an addition for isnum to incorporate decimal and hex...

currently I check for hex using:

Code:
alias ishex {
  if (!$len($remove($1,1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f))) return $true
  else return $false
}


which is a very simple and fast (non-regexp) solution...
but since hex is a highly used system it might be nice to have a build in way like isnum

(note: this isn't some high priority thing... just a nice idea which is easely scripted)
Posted By: Coolkill Re: isnum -> isdec / ishex - 03/09/04 02:49 PM
Personally, I doubt I would use 'ishex', nor would many others, however thats not to say it couldnt be a valuable addition.

Eamonn.

Posted By: nalAAlan Re: isnum -> isdec / ishex - 03/09/04 09:38 PM
isbinary for auto binary translaters.
Posted By: Hrung Re: isnum -> isdec / ishex - 03/09/04 10:07 PM
This is actually something that i've occasionally needed. It is really easy to script with regex or whatnot, but a built-in version might be nice.
Posted By: zack Re: isnum -> isdec / ishex - 04/09/04 12:43 PM
alias ishex if ($1 == $base($1,16,16)) return $true
Posted By: qwerty Re: isnum -> isdec / ishex - 04/09/04 01:02 PM
This would fail with numbers like 00012EF. You could use $base($1,16,16,$len($1)) to fix it.
© mIRC Discussion Forums