The SUBSTR() command can grab just the first 2 letters of the string.

The INSTR() command searches the entire string looking for those 2 letters.

Take the following code

code:

BREAK ON CLS

$PCNAME="VA123DC"

SELECT
CASE INSTR ($PCNAME, "DC")
USE G: "\\SERVER1\SHARE"
CASE INSTR ($PCNAME, "VA")
USE G: "\\SERVER2\SHARE"
CASE 1
? "Non standard PC name.."
ENDSELECT



Even though VA is the first 2 letters, the first case argument is proven true because you preform a INSTR() on the entire string looking for "DC" and $pcname = "VA123DC"

using SUBSTR() removes the chance of that happening.

Bryce

------------------
kix.isorg.net