On 1/9/2008 1:59:09 AM, Steve Rawling wrote:
>I have written the attached macro "SR-macro" intending it
>to primarily executed in its own instance of vedit using a
>command line prompt
>However if I have some other file is buffer 1 and have
>"SR-data.asc" loaded into buffer 2 , then run the macro,
>the reformatted data is successfully written to disk
>but when VEDIT tries to close it asks me "Do I want to save
>"SR-data.asc" but I have already saved the buffer to a
>new name and followed that command with BQ(OK) which
>should prevent this prompt from occuring.
>Can anyone explain to me what
>I am doing wrong
First I wouldn't rely on Buf_Previous() for switching buffers. Better take care by yourself!
I rewrote some lines of your macro a bit to show:
// INPUT FILE'S EXTENSION IS CHANGED TO RDE AND "filename.rde' SAVED IN T REG 99
#103=Buf_Num // remember current buffer number
Out_Reg(103) // use one of the temporary registers
Buf_Switch(Buf_Free(EXTRA)) // use one of the extra buffers
Search(".",REVERSE+ADVANCE) // advance past the found "."
Reg_Copy_Block(103, Cur_Pos, EOL_Pos)
Buf_Switch(#103) // don't rely on Buf_Previous but take control by yourself
// THE FINISHED CONVERTED DATA IS COPIED TO THE CLIPBOARD AND THEN SAVED AS "filename.rde"
But I didn't test it.