KScript documentazione
IT

Lingua

Tradotto automaticamente dall’inglese, che è la versione originale.

Per iniziare

Il formato .kscript e XML

Everything above can also be written as XML, which looks like HTML: $name = 'Joan' is <let name="name" value="'Joan'" />, and echo "Hi" is <echo>Hi</echo>. Switch any example to XML to see it, or use the switch at the top of the page. XML scripts end in .ks.xml, and the two kinds can import each other.

<let name="people" value="[{ name: 'Joan', age: 82 }, { name: 'Sam', age: 35 }]" />
<for each="p" in="$people">
  <if $p.age > 40>
    <echo>{ $p.name } is over 40</echo>
    <continue />
  </if>
  <echo>{ $p.name } is { $p.age }</echo>
</for>
$people = [{ name: 'Joan', age: 82 }, { name: 'Sam', age: 35 }]
for p in $people {
  if $p.age > 40 {
    echo "{ $p.name } is over 40"
    continue
  }
  echo "{ $p.name } is { $p.age }"
}

kscript convert converte un file nell'altro formato. Maggiori informazioni in il formato .kscript.