checkbox action event error

Greetings,

I have an indexed checkbox that gives the following error: Type mismatch error. Expected Int32, but got class CheckBox.

This error shows up even when there is no code in the Action(index as Integer) event, other than rem or empty space!
I have another non indexed check box with an action event that does not produce an error.

Thank you for your help!
CG

[quote=242950:@Carl Gibson]Greetings,

I have an indexed checkbox that gives the following error: Type mismatch error. Expected Int32, but got class CheckBox.

This error shows up even when there is no code in the Action(index as Integer) event, other than rem or empty space!
I have another non indexed check box with an action event that does not produce an error. [/quote]

Could you post the block of code where the error occurs ?

This is the code that is in the Action event

if me.value =TRUE then
lensData(index).cell(3,1)=“mirror”
lensData(index).heading(0)=“DATA FOR MIRROR”
else
lensData(index).cell(3,1)=str(lens(index).refractionIndex)
lensData(index).heading(0)=“DATA FOR LENS”
end if

This is an optical bench simulation with mirrors, prisms and lenses, which worked perfectly well under RealBasic. Very unfortunately the compiled version does not work with 10.11.2. The rewrite of code in XOJO is as if I knew nothing about realBasic!

Thanks!

I see nothing here in relation to the checkbox. I cannot imagine the error you report happening in the code you posted.

All that seems related to an array of ListBoxes called lensData.

When an error occurs, Xojo shows you the part of the code where the error occurred outlined yellow. That is where you want to look.

Given the nature of the reported error, I suspect that, at some point, you are incorrectly referring to a member of your control set. The member index expects an integer (Int32) and, in some way, you may have referred to the member with the instance name of your checkbox. The shown code may not be the source of the error.