You need to log in to create posts and topics.
Type "string" in property for scripted component
LWT98709@lwt98709
34 Posts
#1 · December 16, 2024, 12:23 pm
Quote from LWT98709 on December 16, 2024, 12:23 pmThere seems to be an error for scripted component. When adding a property of type string. Unable to modify the value of the property. The modification is immediately canceled in the dialog box.
In the .mcu file:
<propertygroup name="group name"> <property name="Test" type="string" /> </propertygroup>
In the .as file:
string test_string = "abcd"; string getTest() { return test_string; } void setTest( string &in val ) { test_string = val; }
There seems to be an error for scripted component. When adding a property of type string. Unable to modify the value of the property. The modification is immediately canceled in the dialog box.
In the .mcu file:
<propertygroup name="group name">
<property name="Test" type="string" />
</propertygroup>
In the .as file:
string test_string = "abcd";
string getTest() {
return test_string;
}
void setTest( string &in val ) {
test_string = val;
}
Click for thumbs down.0Click for thumbs up.0
Last edited on December 16, 2024, 12:24 pm by LWT98709
arcachofo@arcachofo
616 Posts
arcachofo@arcachofo
616 Posts
#3 · December 21, 2024, 11:40 am
Quote from arcachofo on December 21, 2024, 11:40 amHi.
This works for me:
string test_string = "abcd"; string getTest() { return test_string; } void setTest( string val ) { test_string = val; print( "setTest "+val ); }
Hi.
This works for me:
string test_string = "abcd";
string getTest()
{
return test_string;
}
void setTest( string val )
{
test_string = val;
print( "setTest "+val );
}
Click for thumbs down.0Click for thumbs up.0