Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Help with OME

Help with OME

Hi everybody,
I am quite new and I would ask a little help.
the code:
a=3
b=1
equation
if a==b then
//show error message
else
//do nothing
end if;
algorithm
b:=b+1;

Someone can helpme, which code can I use for showing the error message?
thanks everybody

Re: Help with OME

You can do assert(a <> b, "message");
However, you cannot have two equations for b (b=3, b:=b+1). You also cannot have an algorithm like b := b+1, because this is equivalent to 0 := 1;

Re: Help with OME

thanks current/wink

There are 0 guests and 0 other users also viewing this topic
You are here: