Make your own free website on
-- Look out! We be programming!
-- cradle1b.ex a Euphoria compiler by A.R.S. KA9QLQ Alvin Koffman Copy right 2002

include get.e -- for get character functions
include wildcard.e -- for upper()

with trace
--trace(1) -- output to screen

  alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", -- Define alphas
  nums = "0123456789"	-- Define numerics

 object Look	-- Look ahead character

function IsAlpha(object c) -- Recognize an Alpha Character
   return find(upper(c),alpha)
end function

function IsDigit(object c) -- Recognize a Decimal Digit
   return find(c,nums)
end function

procedure GetChar()	-- this grabs a line of characters
   Look = getc(0)	--  this will prosess one character at a time if looped
end procedure

procedure Init() -- initialize program
   GetChar() -- grab a character
end procedure

-- start
   puts(1, "Input a character \n") -- ask for imput
   Init() -- initialise program
   while Look != '\n' do -- if NOT enter key loop else stop
      puts(1,"\n")	-- Drop a line so you don't over write what you type
	   if IsDigit(Look) then puts(1, Look & " is a Numeric\n") -- check for numeric
	   elsif IsAlpha(Look) then puts(1, Look & " is an Alpha\n") -- check for an alpha
	   end if
	   GetChar() -- redy next character
   end while --end loop