I'm trying to get familiarized with the mheg+ syntax and I'm getting this error with an "if" sentence.
Can you tell me where is the problem?
>java -jar MhegPlus.Compiler-1.0.1.jar -f startup -p hello.mheg+ -d out -P
06-oct-2010 17:35:34 bbc.dtv.mhegplus.Cli compileMhegPlus
INFO: Compiling startup
06-oct-2010 17:35:34 bbc.dtv.mhegplus.Cli compileMhegPlus
INFO: Compiling hello.mheg+
06-oct-2010 17:35:34 bbc.dtv.mhegplus.MhegPlus runLoad
GRAVE: Parse exception: Encountered " ":" ": "" at line 13.
Was expecting one of:
"{" ...
")" ...
>
This is my code:
{:Scene ('/hello.mheg+' 0)
:Items
(
{:IntegerVar int_var_A
:OrigValue 8
}
{:IntegerVar int_var_B
:OrigValue 10
}
:If ( int_var_A > int_var_B ){
{:Text txtHello
:OrigContent "Hello MHEG+ World!"
:OrigBoxSize 400 50
:OrigPosition 10 100
:HJustification centre
:VJustification centre
}
}:Else{
{:Text txtBye
:OrigContent "Bye MHEG+ World!"
:OrigBoxSize 400 50
:OrigPosition 10 200
:HJustification centre
:VJustification centre
}
}
)
:InputEventReg 4
:SceneCS 720 576
}
Thanks!
Hi Jorgito,
Unfortunately MHEG has no way to create or destroy objects at runtime. It can only do it at compile time when the ASN is encoded, so you can't create objects within another link (like an if statement). Please see the code above for an example on how to do this,
(Sorry about the indentation)
OK, thanks...I thought that it worked like the "foreach" sentence.
Kind regards.