DALIS User Input

by david 20. November 2011 17:01

As I have mentioned before, I have been adding User Input to my new programming language, codenamed DALIS.  Because the language is designed to work in a request / response environment I wanted the language to reflect that without getting over complicated.  So this is what I have got at the moment:

WRITE "Welcome to another DALIS program."+RETURN
ASK "Type your name and press ENTER: "
name = ANSWER
IF name="Dave"
   WRITE RETURN+"Good morning Dave."
OTHERWISE
   WRITE RETURN+"Hello "+name+"."
END

The ASK ... ANSWER syntax looks pretty straightforward to me.  If I run this program, this is what happens:

Starting the program

Then I put in a name:

Entering a name

Finally, this is the end result:

The result

It seems to work fine.  Simple code which even runs on my phone.  I also have a plan to enable forms, so that you can submit several values at once.  That is for another day though...

About the author

David

I'm a C# developer having worked with .Net since it was in beta.  Before that I mainly worked in C and C++.  I have been developing commercial software for more than 20 years.  I also mess around with microprocesors, but that's just for fun.  I live near Cambridge, England and at the moment I'm contracted to one of the departments at Cambridge University.

Tag cloud