reducing function calls with methods.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

reducing function calls with methods.

#1 Post by Ed Dyreen » 25 Oct 2011 21:21

'
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:

Post Reply