Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

@NAME supports library functions

Aug
1,917
68
The @NAME internal variable function also supports library functions.

For example, if I have a library function called SetVar, @NAME returns SetVar.

I would suggest updating the help file to include this new feature;
Code:
Returns the base name of a file, or library function, without the path or extension.

Joe
 
The @NAME internal variable function also supports library functions.

For example, if I have a library function called SetVar, @NAME returns SetVar.

I would suggest updating the help file to include this new feature;
Code:
Returns the base name of a file, or library function, without the path or extension.

Joe
I just did some tests, and it seems to me that @NAME simply takes the argument and takes away the last part, starting from the last dot.
So, echo %@name[abc] returns abc, even if abc is not a file, nor a function, nor an alias, nothing.
P.S. It is described in the help.
"
Note: The @NAME function makes no assumption about the existence of a file or directory. Its filename parameter can be any string and the function will attempt to extract from it a base name.
"


Regards

Rodolfo Giovanninetti
 
Code:
Test {
  @echo off
  echo %%0: %0
  echo %@name[%0]
}

Seems that %0 and %@name[%0] do return the same thing in a library function.
Code:
c:\users\jlc\utils>test
%0: test
test

Nothing to see here, move along.

Joe
 

Similar threads

Back
Top