Error Generated code at (1354, 102)

A place for Ventity software questions & answers
Post Reply
Jack Harich
Senior Member
Posts: 68
Joined: Wed Sep 15, 2004 9:01 pm
Vensim version: DSS

Error Generated code at (1354, 102)

Post by Jack Harich »

Sorry this happened, but I've encountered an error I cannot solve. The error is below:

Generated code at (1354, 102) Non-invocable member 'GeneratedCode.oziOvyJTl7.VentityRuntimeModel_GC.MainCollection_belief_meme' cannot be used like a method. (context: initializing; trigger "Support Decision 1" invoker for "Support Decision 1"., in voter)

On action Support Decision 1, changing from a Process List to a Command still gives the same error, even though Belief Meme is not used on the diagram or references. It does appear as a property of the Invoker.

Thanks!
Attachments
RDem 2.zip
(24.09 KiB) Downloaded 250 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Error Generated code at (1354, 102)

Post by tomfid »

Not immediately obvious - I'll take a deeper look.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Error Generated code at (1354, 102)

Post by tomfid »

The problem is that there is a reference Voter.Support Decision 1 that confuses the trigger’s intended link to the action of the same name. If you delete the reference, it runs.

This is a fairly subtle problem, and we'll have to add a graceful error message for this, but for the sake of completeness, here's how I spotted it. My default procedure is to start deleting things recently added/modified. The generated code error mentions Support Decision 1, so I deleted that. Model runs. Then I recreated the trigger to see what went wrong. When setting up the action field, I noticed this:
2023-03-14_09-08-55.png
2023-03-14_09-08-55.png (35.47 KiB) Viewed 2727 times
There are really only 2 legit cases for name duplication: the attribute/reference pair you get when an attribute has its 'refers to' type set, and an action and trigger of the same name (not required, but I often find it useful). So this was a red flag for me. We'll probably change the name rules to prevent this.
Post Reply