Running project with custom properties raises Exception

Hallo everyone.
In a project , i have a form in which i have defined a custom property of type TStrings where i can insert some values.
For this custom property,
i have also defined a custom property editor. So, this custom property is displayed in object inspector. I click on the elipsis button and the custom property editor opens. When I select OK to the editor, all the values are being saved inside TScriptForms.SaveProps.
Then I save all the project (at the corresponding unitXXX.sfm i see the values saved in saveProps )

Now, i load the project and trying to run it and then I bump into exception.
Why is this happening?How can i use the custom properties functionality and data stored in, in runtime? Do you have any examples on cases of custom properties usage?

To help with the above , i have attached a small project
pict1--run project





I don't see the attached project. Can you please send it in a zip format? Thank you.

Wagner, good morning. The upload had failed due to size and i hadnot seen that. I am attaching againg the project without the executable

I use Alexandria

Custom Properties.zip (94.1 KB)

Thanks, the project should be sent without executable indeed.

I think you should do this differently. If you want a property in your script form, you should actually create the property in your form class.

My suggestion is that you inherit a class from TScriptForm and declare the CustomProps property in it.

TMyScriptForm = class(TScriptForm)
...
  property CustomProps: TStrings read GetCustomProps write SetCustomProps;

Then you change your default script form class to the new one:

IDEScripter.ScriptFormClass := TMyScriptForm;

Wagner, thank you for the response. I tried and, yes you are right it is working. But, the crusial thing in the solution you suggested is that the new property CustomProps MUST be declared as pusblised and not public. If it is public, the problem still remains.

Any way thank you for the response

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.