¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Question on finding the number of defined array elements.


Chip Moody
 

And nuke the semicolon at the end of the IF statement line - I think
what you had is equivalent to "if this condition is met, do absolutely
squat". :)

Function Main()
{
FOR(i = 10 to 1 Step -1)
{
IF(IsSignalDefined(in$[i]))
{
TRACE("i = %d", i);
BREAK;
}
}
}

--- In Crestron@..., "Lindsay" <lindsayc@...> wrote:

Hi Matt,

You need to put the statements after the IF in {}.

Lindsay

--- In Crestron@..., "Matt" <mjrtoo@> wrote:

I'm messing around with an upcoming project, and am looking to
determine the number of elements a string array has been assigned in
Simpl. Looking at S+ I see the directive isSignalDefined(). I have
the following code (not complete).

STRING_INPUT in$[10][25];

Function Main()
{
FOR(i = 10 to 1 Step -1)
{
IF(IsSignalDefined(in$[i]));
TRACE("i = %d", i);
BREAK;
}
}

Within Simpl, I have only two strings expanded on the symbol, but
NumSources always = 10, I was expecting to see 1.

Is this the correct approach and/or any advice on what's incorrect?

Join [email protected] to automatically receive all group messages.