IonicWind Software

IWBasic => Console Corner => Topic started by: GWS on November 26, 2006, 02:04:46 PM

Title: A simple console test ..
Post by: GWS on November 26, 2006, 02:04:46 PM
Just a quick test for a console program:


openconsole

stringÂÃ,  s

DO
color 7,0
input "Enter a color (red, green, or blue) ... ", s

SELECT true
case (s = "red")
color 12,0
print "You entered Red"
case (s = "green")
color 10,0
print "You entered Green"
case (s = "blue") | (s = "BLUE")
color 9,0
print "You entered Blue"
case (s <> "red") & (s <> "green") & (s <> "blue") & (s <> "")
color 14,0
print "Invalid entry."
ENDSELECT

UNTIL (s = "")

do:until inkey$<>""
closeconsole

end



Works like a charm .. :)

Graham
Title: Re: A simple console test ..
Post by: Jerry Muelver on November 30, 2006, 03:17:06 AM
Graham, would it be okay to add this to the wiki, say like http://ebasic.wikispaces.com/GWS+simple+console+test ?
Title: Re: A simple console test ..
Post by: GWS on November 30, 2006, 04:13:42 AM
I should think so Jerry .. I found it among my many snippets dating way back .. so I can't remember if I composed it or where it originated..

I don't think anyone would mind though ..  :)

Graham