How to invoke new I7 Activity rulebooks from I6?

Poking around the template code, I see that there are at least a couple of ways to call rules from activity rulebooks:

e.g. BeginActivity(READING_A_COMMAND_ACT);

Obviously, the former would be used if one were actually running an activity, the latter just to run a rulebook outside of an activity.

Built-in template activities have a constant defined like so:

Which matches a less user-friendly constant thus:
Constant V16_reading_a_command = 16;

User-defined activities seem to have only the latter type of constant defined, e.g.

Constant V34_parsing_a_command = 34;

The difficulty is that knowledge of this constant, or the name of it, appears to be required to invoke activity rulebooks as in the examples above, but I can’t see any way of reliably knowing what constant name or value will be allocated by the compiler and therefore no reliable way of invoking rulebooks from user-defined activities (or indeed any I7-defined rule) from I6 code.

The manual provides a means of referencing an I6-defined rule in I7 code, but not the other way round.

Is there a way to do this?

1 Like

You can use the (+ +) notation:

BeginActivity((+ reading a command +));

This allows you to embed bits of I7 inside I6 embedded in I7: mnemonically, it’s the “opposite” of (- -). It’s mostly used for constants which have nicer names in I7 than in I6.


Ah! Brilliant. I hadn’t twigged from the rather sparse discussion in the manual on this topic that this could be done for I7 kinds other than simple values.

Thank you.

1 Like

No problem! For an example, this code basically just adds an extra activity to a certain part of the I6 template.

1 Like