DISH,
GETVAR - short for Get Variable
DWGNAME - Variable in AutoCAD which stores the name of the current drawing
STRLEN - Returns the length of the string returned by $(getvar, "dwgname"

SUBSTR - With user specified options, allows for truncating a string at a specified point
To use an example, let's assume you are in a drawing named, 100-03-master.dwg
$(getvar, "dwgname"

would return "100-03-master.dwg"
$(strlen,$(getvar,"dwgname"

) would return 17 because there are 17 characters in the string which is the drawing name with extension
$(-,$(strlen,$(getvar,"dwgname"

),4) would return 13 because I am subtracting 4 from the length of the string.
$(substr,$(getvar,"dwgname"

,1,$(-,$(strlen,$(getvar,"dwgname"

),4)) returns "100-03-master". The way it does this is as follows:
1. It first gets the drawing name with extension
2. It then gets the length of the drawing name with extension
3. It then returns the length obtained minus 4 because of the 4 characters in ".dwg"
4. Now with the Substr function, it starts at character 1 and goes 13 steps through the string and returns "100-03-master"
The AutoLISP equivalent of this is as follows:
(substr (getvar "dwgname"

1 (- (strlen (getvar "dwgname"

) 4))
If you want to store that information to a user specified variable, you might use:
(setq dwg-name (substr (getvar "dwgname"

1 (- (strlen (getvar "dwgname"

) 4)))
Hope this helps.
Jeff Foster, PE
CE Group, Inc.
Apex, NC