C-Script syntax types

I am starting to program in C script block and I have questions:

When defining a variable in ‘code declarations,’ why are there two syntax types? For example, this: ‘define PREV_INPUT DiscState(0)’ and the other syntax ‘define DELAY ParamRealData(0, 0)’. My question is: How do we interpret or understand the arguments in ‘DiscState(0)’ and ‘ParamRealData(0, 0)’? I understand that the following syntax ‘DiscState(i)’ and ‘ParamRealData(i, j)’ refers to the ith and jth values, respectively. Another question is: In what cases is it better to use the first notation or the second notation?

Thank you.

The syntax between your two examples is the same in that it uses the define preprocessor directive. It seems you are confused by the last argument in the define directive. In the examples you referenced, the last argument refers to pre-defined C-Macros in PLECS. The different macros allow you to access block data such as input/output signals, parameters, and states.

Refer to the C-Scripts + C-Script Macros section of the PLECS Manual for a description of the available macros. The graphic pasted below shows a subset of the available macros.