Ooops, my copy and paste screwed up, the correct syntax is below

 
> 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 
> 

Reply via email to