Page 1 of 1

reducing function calls with methods.

Posted: 25 Oct 2011 21:21
by Ed Dyreen
'
We can set an "object"

Code: Select all

set "$var=File"
set "$var.file=C:\This Works.TMP"

We can set a "method"

Code: Select all

set "$var.exist=if exist "^!$var.file^!""

We can replace a function call with a method

Code: Select all

set "$obj.exist=!%$Name%.exist!"
%_forX% ( '!SetsError!' ) %$obj.exist%

We can evaluate a "method"

Code: Select all

set "$obj.exist=!%$Name%.exist!"
%_forX% ( '!SetsError!' ) %$obj.exist% &&echo.true ||echo.false

Variables can be FUN :mrgreen: