question

Gabriel illescas Cavazos avatar image
0 Likes"
Gabriel illescas Cavazos asked Felix Möhlmann commented

How many parameters could be able to contain a sendmessage command?

FlexSim 17.2.5
commands
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Sebastian Hemmann avatar image
1 Like"
Sebastian Hemmann answered Felix Möhlmann commented

Three. As you can read in the Commands Help:

sendmessage

Send a message to an object, firing its OnMessage trigger

Parameters

(obj toobject, obj fromobject [, var par1, var par2, var par3])

Description

Causes a message to be sent immediately to the toobject from the fromobject as in a direct function call. When the toobject receives the message, its OnMessage trigger will fire.
In the code of the OnMessage trigger, you may refer to the fromobject as msgsendingobject, and the three par values passed in as msgparam(1), msgparam(2) and msgparam(3). These message parameters are Variants, meaning they can be numbers, strings, treenode references or arrays.

Example

sendmessage(current.centerObjects[1], current, item, 10);

This sends a message to the object connected to current's first center port. A reference to item is passed as par1 and the number 10 as par2.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Yash Patel avatar image Yash Patel commented ·
Is there a way to send more then 3 parameters? What I am trying to do is send 4 different labels names to a parallel process.
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Yash Patel commented ·

The message parameters are Variants. You can write all of your values into an array and send that as a single parameter. Note though that this is only possible with "sendmessage()". "senddelayedmessage()" can only use numbers as parameters.

sendmessage(toObject, fromObject, [1, 2, 3, 4])
1 Like 1 ·