Es-parrot-parrot-operations

提供:Dev Guides
移動先:案内検索

オウム-Operaciones

Hay una gran variadead de operaciones que puede realizar。 ejemplo、se puedeによって、コンティニドエルコンテニドデウンレジストリストオウナコンスタンテ:

set I1, 10
print "The contents of register I1 is: "
print I1
print "\n"

Las instrucciones de arriba、en el contenido de registro I1 es la siguiente:10

Podemos realizar operacionesmatemáticasen los registros:

# Add the contents of I2 to the contents of I1
add I1, I1, I2

# Multiply I2 by I4 and store in I3
mul I3, I2, I4

# Increment I1 by one
inc I1

# Decrement N3 by 1.5
dec N3, 1.5

Incluso podemos realizar algunos sencillosmanipulaciónde cadenas:

set S1, "fish"
set S2, "bone"
concat S1, S2       # S1 is now "fishbone"

set S3, "w"
substr S4, S1, 1, 7

concat S3, S4       # S3 is now "wishbone"
length I1, S3       # I1 is now 8