Share My Creation Quickly create get/setters in a class

stevel05

Expert
Licensed User
Longtime User
Yes, it does not validate the Var Type field. I suppose it could, I have finished adding maintaining declared values i.e. Int = 10 will now be carried forward (Next release anyway) I'll take a look, probably Monday Now.
 

stevel05

Expert
Licensed User
Longtime User
I was thinking of just removing the additional declaration, so making Int, String just Int. But if it's left and not noticed, it will be obvious when pasted into the IDE, an error will be raised.

If I raise an error then it would prolong the process, and the correction is probably easier and quicker to do in the IDE.

I suppose an option is to remove it and notify the user that it has been removed.
 

LucaMs

Expert
Licensed User
Longtime User
I'm slightly lost because I do not know why I should be able to add directly texts like "Dim MyVar As Int".

I would do only one thing like...



Two buttons, to add a new property and to remove the selected one (or long click on the variable name to remove it).

"Set too" if you want to create both routines or just get (read only).
 

stevel05

Expert
Licensed User
Longtime User
I do not know why I should be able to add directly texts like "Dim MyVar As Int".
You can't, but you can paste them, which goes through an extra parse routine to format them as needed.

I can see where you are coming from but this is not integrated into the IDE and has no idea of all the possible class types. Creating an input along the lines you outline would I think, slow down the process. Also, the app would need to maintain it's own list of Types. Users would have to be able to add and remove types to cater for their own classes, not to mention the hundreds of classes in libraries. If you had to stop and add them before parsing, it would probably take longer than typing them directly, at least the first time.

As I said before, this is intended as a quick in and out utility. Type your Variable names and their types, Parse the code and copy and paste. Any errors in the var type names will be immediately obvious in the IDE when you do the first paste, and very quickly changed using search and replace in the IDE or come back to the open app and change it and re parse.
 

LucaMs

Expert
Licensed User
Longtime User
Thanks to my poor English , I still did not understand what you're talking about "parsing".

However, a solution to define a parameter of any type, still selecting it by Combo, could be set the first item of the Combo to "Custom" and display an input dialog (BTW, I looked for an "InputDialog" b4j e I did not find one!).
 

stevel05

Expert
Licensed User
Longtime User
@LucaMs See what you think of this version, the Type_Validated tab uses a modified version of Erels MiniSearchView to validate entries against a stored list.
You will be prompted to add types that are not on the list. To add a type that has less characters than an existing matched one, press the Escape key to dismiss the list, then press return. To delete an entry, type the first few characters to get it in the list, then right click on the list entry.

It uses a few more libraries, but I think they are all standard libraries. I've also changed the text on the button Parse to Create.
 

Attachments

  • CreateGetSetters-v0.4-Beta.zip
    27.7 KB · Views: 264

stevel05

Expert
Licensed User
Longtime User
Update to v0.4
  • Deals with assignments at the end of pasted or entered VarType
  • Basic format pattern check on vartypes in Unvalidated tab : Matches Type(String) or Type(String) = String or Type(String) = "String"
  • Added validated Tab, VarTypes must be in the validation list, which can be added to via prompt if it doesn't already exist.
  • Added readonly to unvalidated tab which is still required to allow assignments.
File updated and more information in first post
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…