- Posts: 3
- Thank you received: 0
Wrong argument number when passing a custom type.
3 weeks 3 days ago #79
by fefa
Wrong argument number when passing a custom type. was created by fefa
Hi.
I get "Wrong argument number" error when calling a function when passing a custom type.
For example this code compiles without errors:
but if change the if condition like this (now instead of using an intermediate variable, we access the field directly in the custom type):
then the error arises.
The only way to make it compile and work is this (expanding every custom type field):
I have attached the full example code.
TIA.
I get "Wrong argument number" error when calling a function when passing a custom type.
For example this code compiles without errors:
Code:
type midiEvent
{
byte t;
byte ch;
byte p1;
byte p2;
};
midiEvent mE = { 1, 2, 3, 12 };
byte t = mE.t;
if(t==1){
drawSlider(slider1, mE.p2);
}
but if change the if condition like this (now instead of using an intermediate variable, we access the field directly in the custom type):
Code:
if(mE.t==1){
drawSlider(slider1, mE.p2);
}
then the error arises.
The only way to make it compile and work is this (expanding every custom type field):
Code:
if(mE.t==1){
drawSlider(slider1.x,slider1.y,slider1.size,mE.p2);
}
I have attached the full example code.
TIA.
Please Log in or Create an account to join the conversation.
2 weeks 4 days ago #80
by Franck
Replied by Franck on topic Wrong argument number when passing a custom type.
Fixed in version 0.7.6.
Also I enabled .src extensions as attachments to the forum, so you can now attach a Lofi source file directly.
Also I enabled .src extensions as attachments to the forum, so you can now attach a Lofi source file directly.
The following user(s) said Thank You: fefa
Please Log in or Create an account to join the conversation.
Time to create page: 0.150 seconds