Jim:  Following is the code I used.  The client says that stopping at
30 is a good number.  Let me know if it doesn't wrap right and I can
privately email you a text file.   In this case, the part#s can have
spaces in the name, and that made it a little more difficult.
  

SET VAR vFilenamePart = ( CVAL("QUOTES") + "F:\Data\Shop\Exceptions\" + 
.v_custpart + "r")

SET VAR vLoop INT = 1
WHILE vLoop <= 30 THEN
  SET VAR vFilename = (.vFilenamePart +  + CTXT(.vLoop) + ".doc" + 
CVAL("QUOTES") )

  -- For some reason, just putting the "set var vcount =" command by itself
  -- always yielded 0.  I think it's because of the quotes in the filename, 
which
  -- is needed because the part# could have spaces in it.
  SET VAR vCommand = ("SET VAR vCount = (CHKFILE(" + .vFilename + "))" )
  &vCommand

  IF vCount > 0 THEN
    BREAK
  ENDIF

  SET VAR vLoop = (.vLoop + 1)
ENDWHILE

IF vCount = 0 THEN
  PAUSE 2 USING "No Exceptions file for this part" CAPTION "No file" OPTION 
MESSAGE_FONT_SIZE 11
ELSE
  LAUNCH .vFilename
ENDIF

RETURN


 
> If you get this to work perfectly, I would be interested in the code that 
> gives you what you want.
> 
>  We have one area where the spec sheets are related to more than one item 
> and this may be the answer I am looking for.
> 
>   
> 
>  James Belisle
> 
>  
> 

Reply via email to