INPUT /  OUTPUT /  LANGUAGE






putLn tag

Transient logic tag

Sends a line of input back to the running application, with a newline character added to the end of the line automatically.

Sample usage

<putLn {input text}> — inputs the character string input text (then a newline) back to the running program.

Fields

Default field

Named fields

Behaviour

When one more more values are pushed into the tag's default field, they are sent as standard input back to the running program.

Standard input function in many programming languages rely on waiting for a newline character (represented in ioL as </n>, but outside ioL often represented as \n) to notify the running program that the complete line of input has arrived.

When the putLn tag is complete, a new-line character is added to the end of the running program's input and the tag's lifetime then ends.

The putLn tag does not generate a value. No result value is yielded back into the document tree.

Notes

Example

The following example shows how a Python program can output the putLn and dialog tags compounted together to prompt the user for their name and receive the text entered back as input to the running program:

name = input('<putLn|dialog text=true {Enter your name:}>')
print('Hello ' + name)

In the above example, Python's input function was used, which allows an input prompt to be printed to the console without a separate print statement. However as far as ioL is concerned, the tag could equally have been used inside a print statement with a separate input statement used to get the resulting input afterwards.