HTPL Compiler
  • HTPL Compiler
  • Introduction
  • Github repository
  • What is HTPL and why it exists
  • Getting started
  • Syntax
    • Variable declaration
    • Returning values
    • Operations between values
    • Value assignment
    • If then else branches
    • Comparison and logical operators
    • Function declaration and invocation
    • While loop
    • Inputs and outputs
    • Comments
  • Other
    • HTPLCompiler interface - Browser
    • Error handling
Powered by GitBook
On this page

Was this helpful?

  1. Syntax

Inputs and outputs

If you want to ask the user to insert a value, you have to use <prompt> element. The optional message is specified by the id:

<h2 id="foo">
    <prompt id="Please insert a value for foo: ">
    </prompt>
</h2>

this code is compiled as:

foo = prompt('Please insert a value for foo: ');

Outputs are displayed with <cite> element:

<cite>
    <b id="+">
        <p>Foo now has value: </p>
        <p id="foo"></p>
    </b>
</cite>

Which is compiled as an alert() function:

alert(('Foo has new value: ' + foo))
PreviousWhile loopNextComments

Last updated 4 years ago

Was this helpful?