Getting started
Open Try Dave, select an example, and press Run. Dave checks each statement and shows the resulting screen or output. A statement that does not match a supported form produces a diagnostic.
Make a screen called "Hello".Put a heading at the top of the screen that says "Hello, world".Putting things on the screen
Start by making a screen. Then put a box, heading, button, or text on it. Quoted text appears in the resulting interface.
Make a screen called "Sign In".Put a box on the screen that says "Password".Put a button underneath the password box that says "Enter".The button is placed relative to the password box named by the statement.
Giving things names
Make a screen called gives the screen a quoted name. You can use that name to identify the screen in the preview. Dave also recognizes a client named Steve in the follow-up example.
Make a screen called "Sign In".Steve is a client whose email is "steve@harbourline.co".Remembering things
A proposition has a value of true or false. Declaring that Dave will keep track of a proposition starts it as false. Remember that changes its value.
We’re going to keep track of whether we’ve heard back from Steve.Remember that we’ve heard back from Steve.Making decisions
If checks a proposition. The action runs only when that proposition is true.
We’re going to keep track of whether we’ve heard back from Steve.If we’ve heard back from Steve, send him the invoice.Waiting for things to happen
When waits for an event. Put the action on the next line, indented by four spaces. In the playground, use the preview controls to trigger supported events.
When someone presses the button, check the password.When an email arrives from Steve, remember that we’ve heard back from Steve.Working with numbers
Dave recognizes signed numbers in a declared list and calculates with the numbers retained from that list.
These numbers are 4, -2, 8, and 12.From these numbers, keep the ones that are greater than zero.Add those numbers together and divide that by how many numbers we kept.Working with lists
Declare a list of numbers using These numbers are. The statement From these numbers, keep the ones that are greater than zero. produces a new list containing only positive values.
For the list above, Dave keeps 4, 8, and 12. Their average is 8.
A screen can also contain a list. The dashboard example puts today’s appointments underneath its heading.
Make a screen called "Dashboard".Put a heading at the top of the screen that says "Good morning".Put a list of today’s appointments underneath the heading.When someone presses an appointment, show the details of the appointment.Positioning things
Underneath places one interface element vertically after another. Below describes depth and has a different meaning, so it is not accepted in this construction.
Put a box on the screen that says "Password".Put a button underneath the password box that says "Enter".Common misunderstandings
For a button after a password box, use underneath. Dave reports: “Below” changes the depth of something. Did you mean “underneath”?
When requires an event. If requires a true or false proposition. Dave reports a specific diagnostic when a proposition is used as an event.
If a statement does not match the grammar, Dave reports “Dave didn’t understand that.” The playground accepts only the forms documented here.