Implement an Assign 'method' #24
FullValueRider
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is a Quality of Life proposal.
A common boilerplate I encounter is assigning a variant that may or may not be an object.
I though I was being clever by encapsulating this boilerplate in an 'Assign' Method
And this mostly worked OK but I found a couple of edge cases where it did not work which made Asssign less useful than it could have been.
twinBasic has eliminated this boilerplate in the case of return values for Functions and Property Gets with the introduction of the 'Return' keyword.
I've also seen use of the VariantCopy/VariantCopyInd to achieve the same goal as a myAssign method (ref Olaf Scmidt's cHasdD class on VBForums)
Thus it would seem that there is a generic 'desire' for an easy resolution of the 'Set' boilerplate.
Consequently, I am wondering if the compiler magic that allows 'Return' in twinBasic could also be adapted to allow an Assign statement.
I fully appreciate that if used correctly, Generics and Overloaded methods could mostly eliminate the need for for such a proposal. However in the spirit of making things easier for beginners, I feel that an 'Assign' method would be a useful and welcome addition to twinBasic.
Beta Was this translation helpful? Give feedback.
All reactions