Number or not?

Sjoerd Op 't Land sjoerdoptland at
Fri Feb 8 09:43:01 EST 2002

Terry Vogelaar wrote/ schreef:

> Hello all,
> Simple question: is there a way to verify if a variable is a number?
> AppleScript makes a difference between 2 and "2", but it also does not
> accept string-parameters without quotes. So I want to put quotes around a
> parameter only when it is not a number. Any suggestions?
Try this one (untested):

function formatVar vContents
  if isNumber(vContents) then return vContents
  else return quote & vContents & quote
end formatVar
> Terry
Regards, / Groeten,

More information about the Use-livecode mailing list