B4J Code Snippet [Tool] Property generator (not only for B4J, of course)

LucaMs

Expert
Licensed User
Strangely... you're right (as always 😄).

I vaguely remembered this but I always used "m" as a prefix for the "property variable", so over time I forgot it.

I will look for a solution (I also thought of having them create multiple properties in one go, if you selected multiple declaration lines, but this was not a real tool I wanted to create, I would have liked... something else ;))
 

LucaMs

Expert
Licensed User
I will look for a solution
I have two options (or more?):

1 - force the programmer to use a prefix in the variable name (but I don't like that)

2 - add a suffix to the property name; for example if the variable name is... Name, the property would be "Sub setNameProp" (I don't like this too much but it's better than the previous one)

Other ideas?
 

LucaMs

Expert
Licensed User
If I remember correctly, the property will not be recognized as a property if there is a global variable with the same name. Check it.
I will look for a solution
2 - add a suffix to the property name; for example if the variable name is... Name, the property would be "Sub setNameProp" (I don't like this too much but it's better than the previous one)
Applied this second option.
 

stevel05

Expert
Licensed User
The problem with writing a 'quick' utility is that it generally grows to the stage that it is no longer as quick :). Feel free to take any logic you want from my effort.
 

stevel05

Expert
Licensed User
You mean.... there Logic involved????
Only very loosely. My development logic:

B4X:
Sub DevelopmentLogic
    Dim TakeAGuess As Boolean = False
    Do While TakeAGuess = False
      TakeAGuess = FiddleWithIt
    Loop

    Log("At Last ... Time for Coffee")
End Sub

Private Sub FiddleWithIt As Boolean
    Scratch Head
    TrySomethingElse
    Return TrySomethingElse = True
End Sub
 
Last edited:
Top