Opened 4 years ago

Closed 4 years ago

#6253 closed defect (invalid)

Error processing assert

Reported by: Philip Hannebohm Owned by:
Priority: blocker Milestone: 1.16.1
Component: *unknown* Version: 1.16.0
Keywords: assert, loadString Cc:

Description

When I run the following X.mos script

loadString("
model X
equation
  assert(time < 1, "text");
end X;
"); getErrorString();

I get the error message

...X.mos:4:25-4:25:writable] Error: Missing token: EQUALS

However loading a separate .mo file with model X works.

Change History (2)

comment:1 by Mahder Alemseged Gebremedhin, 4 years ago

It is probably the quote on the string "text". You have to escape it since the whole thing is supposed to be one big string. Try \"text\".

comment:2 by Philip Hannebohm, 4 years ago

Resolution: invalid
Status: newclosed

Yes that was it! I'm stupid.

Note: See TracTickets for help on using tickets.