1. Re: Win32Lib --Duh

Hi Bret!

I just noticed the code I sent you was a little sloppy for my standards.. it
worked but wasn't well optimized..
Why use for loops when you can take advantage of Euphoria's sequence
operations and bool ops.

include wildcard.e

--Range function originally by Hawke'
--Modified by Greg Harris
function range(object data, integer low, integer high)
  return data * (data>=low) * (data<=high)
end function

function isAlpha(sequence data)
 --checks a string to see if it contains only
 --valid alpha characters
 sequence up
 up = upper(data)
 if find(0,range(up,'A','Z')) then
    return 0
 end if
 return 1
end function

function isNumeric(sequence data)
 --checks a string to see if it contains only
 --valid numeric characters
 --Returns: 1 if all numeric
 --         0 if not.
  if find(0,range(data,'0','9')) then
     return 0
  end if
  return 1
end function

---------------------------- end code-------------------------------

Hope this helps,
Greg Harris

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu