Soplang Logo
Soplang

Input and Output

Use qor() to print values and gelin() to read user input in Soplang.

Input and Output in Soplang

Soplang provides built-in functions for console output and user input.

qor() – Print to Console

Use qor() to display a value in the terminal.

print_console.sop

print_console.sop
qor("Hello, Adduun!")
door magaca = "Aamina"
qor("Magaca: " + magaca)

qor() accepts one value. To print several values together, join them with +:

print_multiple.sop
door da = 19
qor("Magaca: " + "Aamina" + ", Da'da: " + da)
qor([1, 2, 3])          // [1, 2, 3]
qor(run)                // run

gelin() – Read User Input

Use gelin() to read a line of input. The prompt is optional. The result is always a string (qoraal).

read_input.sop

read_input.sop
door magaca = gelin("Magacaaga qor: ")
qor("Waad ku mahadsan tahay, " + magaca)

Use a conversion function such as abn() when you need a number rather than a string.

type_conversion.sop

type_conversion.sop
door da = abn(gelin("Da'daada qor: "))

On this page