1. Re: Win32Lib --Duh

Hi Bret!

-----Original Message-----
From: Bret Belgarde <BretBelgarde at WORLDNET.ATT.NET>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Tuesday, January 19, 1999 6:26 PM
Subject: Re: Win32Lib --Duh


>That's what I get for not reading the documentation, (RTFM right?) Thanks
for pointing it
>out to me, it will help. Any Ideas on the other though?(Tell the difference
between numbers
>and alpha or will upper() do that also?)


include wildcard.e

--Originally by Hawke'
function range(integer 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
       --Returns: 1 if all alpha
       --         0 if not.
       integer temp
       sequence up
       up = upper(data)
       for x = 1 to length(up) do
        temp = range(up[x], 'A','Z')
        if temp = 0 then
            return temp
        end if
       end for
       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.
    integer temp
    sequence up
    for x = 1 to length(data) do
     temp = range(data[x], '0','9')
     if temp = 0 then
         return temp
     end if
    end for
    return 1
end function
---------------------------- end code-------------------------------

examples:

? isNumeric("01bC8")
0
? isNumeric("0123456789")
1
? isAlpha("Hello")
1
? isAlpha("H93llo")
0

Hope this helps,

Greg Harris

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu