Archive: Removing part of a file name..


Removing part of a file name..
I'm using IO to allow users to select a .map file (for my Map-Compiler prog)
but I need the .map bit to be removed afterwards, since I need to use the entered cmd line as x:\path\to\mymap instead of x:\path\to\mymap.map

Otherwise, VIS and RAD compiles will try to compile x:\path\to\mymap.map.bsp, when it needs to be just x:\path\to\mymap.bsp

-Stuart


Use strcpy $0 "x:\path\to\mymap.map" -4


Wow thanks!!
Shouldn't that be in the manual!?

Nevermind, since it brings people here ;)

-Stuart


Sets the user variable $x with str. Note that str can contain other variables, or the user variable being set (concatenating strings this way is possible, etc). If maxlen is specified, the string will be a maximum of maxlen characters (if maxlen is negative, the string will be truncated abs(maxlen) characters from the end). If start_offset is specified, the source is offset by it (if start_offset is negative, it will start abs(start_offset) from the end of the string).
;)