Unclear Error Message

Hi Chris,
I get the following error and warning:
ERROR: Cannot index list with undefined
WARNING: Subscript evaluation failed. Returning 0 instead.
The experiment runs well regardless of the error, but I am trying to find out the reason for this. In the protocol, there is a variable list that is defined and then a range replicator which changes an index to pick elements from that list. I tried changing the variable type in that index variable, but it didn’t solve it. I didn’t see the error when I removed the range replicator and kept everything else (so the same value is picked from the list as the index isn’t changed).

Any idea what causes this?

Cheers,
Beshoy

Hi Beshoy,

That is strange. “Undefined” is a value used internally by MWorks (sort of like Python’s None), but you shouldn’t be able to generate it in your experiment.

Can you send me the experiment file that produces this error? I’d like to understand how this is happening, as it might indicate a bug somewhere.

Thanks,
Chris

Hi Chris,

I attached the file, it has several protocols. I tried testing them separately and I think the problem starts with the RF mapping protocol.

Cheers,
Beshoy

Attachment: Agayby_experiments.mwel.zip (8.79 KB)

Hi Beshoy,

Thanks for sending your experiment.

It looks like there is some issue in how the values of local-scope variables are assigned during load time. I haven’t yet determined exactly what’s happening, but I’m sure I’ll figure it out eventually.

In the meantime, I don’t think you need to worry about this, since (as you noted) it doesn’t appear to affect how things work when the experiment runs.

Cheers,
Chris

Hi Chris,

Thanks for looking into it. You are right, so far it’s not causing the experiment to malfunction. I was just curious and wanted to make sure there is nothing I am missing.

Cheers,
Beshoy