delphi - Bypass function "out" parameters -
some functions need variable send out value. don't need value , don't want define variable use function out parameter. this:
procedure test(out somevar: string); begin //... end; i want execute safely:
test;
you can create wrapper:
procedure test(); overload; var somevar : string; begin test(somevar); end; note: you'll have mark other version overload, or can call wrapper other test, , remove overload.
another option: declare dummy variable somewhere (at top of unit, maybe):
var dummystr : string; then don't have declare new variable every time want call function.
test(dummystr);
Comments
Post a Comment