Share Tips, Code Samples, etc. with the Visual Prolog community.
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

PropertyDepot - property code generator and repository

Unread post by Harrison Pratt »

Ever get annoyed by all the code you have to type to support properties ... and then you need to make a few changes and have to reorganize it all? Yeah, me too!

PropertyDepot is will let you maintain a database of your own sets of properties and generate property or single fact code that you can paste into your .i, .cl and .pro files.

When you are done exploring the sample database, just delete all the *.PDB files and start creating your own database.

Merry Christmas! :-)

ADDENDUM as of 12 February 2023:
The project ZIP file is obsolete and has been deleted.
Use the updated PropertyDepot.zip in the following post.
PropertyDepot Screenshot 2022-11-26 080733.jpg
PropertyDepot Screenshot 2022-11-26 080733.jpg (164.42 KiB) Viewed 49802 times
Last edited by Harrison Pratt on 12 Feb 2023 18:43, edited 1 time in total.
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: PropertyDepot - property code generator and repository

Unread post by Harrison Pratt »

PropertyDepot is updated as follows:

Domains may be prefixed with '::'

Code: Select all

    propColor : ::color
Parameter labels are allowed

Code: Select all

  myTerm : trm( string ID, real Value )     myRect : vpiDomains::rct( integer X, integer Y, integer Right, integer Bottom )
Tuple definitions are supported, as is star-list syntax

Code: Select all

    propTuple : tuple{ string Label, integer Value }     propTuples : tuple{ string Label, integer Value }* % you can use a comment     propList : real*
Miscellaneous updates
  • Property Import supports the above structures and now will also import in-line comments for imported properties.
  • Helpful error messages are displayed when various parsing errors are encountered during code generation.
  • Minor aesthetic changes are made in the Property Editor dialog.
  • There is no change in the database structure.
The attached project here fully replaces the original one posted 26 Nov 2022.
Attachments
PropertyDepot.zip
Updated PropertyDepot project
(133.18 KiB) Downloaded 311 times
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Re: PropertyDepot - property code generator and repository

Unread post by Thomas Linder Puls »

I think you should use the sciLexer instead of an edit control. So I have update a few files.
Using sciLexer
Using sciLexer
using_sciLexer.png (86.65 KiB) Viewed 49615 times
I have problems with string properties.

You should also notice that auto-formatting will write the code differently.
Attachments
properties_PACKAGE.zip
Using sciLexer
(114.39 KiB) Downloaded 377 times
Regards Thomas Linder Puls
PDC
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: PropertyDepot - property code generator and repository

Unread post by Harrison Pratt »

Thanks for the sciLexer update -- that's much better.

I realize that autoFormat will change the layout. I laid out the generated code to be easy to read in the generated-code dialog.

About the string problem, did you not quote the string value or did you see different kind of error? There is a specific error message for an unquoted string.

Do you have any other suggestions?
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: PropertyDepot - property code generator and repository

Unread post by Harrison Pratt »

Updated properties_PACKAGE folder attached as ZIP file.

Attachment deleted. Use the package in the 16 February 2023 post below.
Last edited by Harrison Pratt on 16 Feb 2023 13:06, edited 1 time in total.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Re: PropertyDepot - property code generator and repository

Unread post by Thomas Linder Puls »

Regarding string: I didn't supply a value. I assumed it would work since that worked for integer, etc.
Regards Thomas Linder Puls
PDC
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: PropertyDepot - property code generator and repository

Unread post by Harrison Pratt »

Fixed it. I neglected to consider empty string when checking for unquoted string value.

myString : string should generate myString_fact : string := erroneous. and supporting clauses.

Thanks.
Attachments
properties_PACKAGE.zip
properties_PACKAGE 2023-02-16
(114.12 KiB) Downloaded 430 times
Post Reply