From: Doni Pracner Date: Sat, 8 Feb 2014 12:03:34 +0000 (+0100) Subject: mjc2wsl - support for array length is now functional in FermaT X-Git-Tag: v0.1.5~15 X-Git-Url: https://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;h=11dab96f23d6fe01b75f6d6df1fe6bfa122068e1;p=mjc2wsl.git mjc2wsl - support for array length is now functional in FermaT --- diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java index 67586be..83a84de 100644 --- a/src/mjc2wsl.java +++ b/src/mjc2wsl.java @@ -501,13 +501,8 @@ public class mjc2wsl{ } case arraylength: { prl(createTopEStack()); - // TODO make an array length function of some sort! - prl(createComment( - "array length not known - LENGTH not aplicable to arrays", - C_ERR)); - messages.message("array length not known - LENGTH not aplicable to arrays", TransMessages.M_ERR); - prl(createComment("put 1 on the stack for consistency", C_SPEC)); - prl(createToEStack(1)); + prl("tempb := LENGTH("+ createArray("tempa") + ");"); + prl(createToEStack("tempb")); break; }