question

Clair A avatar image
0 Likes"
Clair A asked Matthew Gillespie commented

Property Table | FlexScript exception: string index out of range

In a new model, drag & drop any object, for example a Source.

Add a string label to the object.

Click on the Compare Properties icon.

It throws this exception:

exception: FlexScript exception: string index out of range in call to string.substr() at VIEW:/active/DockingGUI/TabPane/TabControl/PropertyTable/TableView>style/FS_CELL_FORMATTING/Labels.label1/textColor
exception: FlexScript exception: string index out of range in call to string.substr() at VIEW:/active/DockingGUI/TabPane/TabControl/PropertyTable/TableView>style/FS_CELL_FORMATTING/Labels.label1/displayText

In VIEW:/active/DockingGUI/TabPane/TabControl/PropertyTable/TableView>style/FS_CELL_FORMATTING/Labels.label1/displayText, line 8, this statement:

strVal.substr(1, 4)

throws an exception if your label has 3 letters or less.

If you follow the same steps in 22.2, there was no exception.

Could you please fix this bug ?

FlexSim 23.0.9
property table
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

@Clair A This issue is fixed in 23.0.10 and 23.1.4 released today.

1 Like 1 ·
Julie Weller avatar image Julie Weller commented ·

Hi @Clair A, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·
Clair A avatar image Clair A Julie Weller commented ·
The answer has already been auto-accepted today.
1 Like 1 ·
Julie Weller avatar image Julie Weller Clair A commented ·
Awesome, thanks!
0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Clair A commented

Thanks for reporting this Clair.

I'll send it into the developers to fix.


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Clair A avatar image Clair A commented ·

Thanks Jason.

While waiting for the next fix, I told our customer to execute this script:

treenode cellFormatting = maintree().find("project/exec/globals/properties/Labels>variables/cellFormatting");
treenode displayText = cellFormatting.subnodes["displayText"];
if(displayText) displayText.destroy();
treenode textColor = cellFormatting.subnodes["textColor"];
if(textColor) textColor.destroy();
0 Likes 0 ·