On 1/30/2008 9:10:42 PM, Ian Binnie wrote:
> On 1/30/2008 8:23:46 PM, Dale Cook wrote:
>> Reg_Set(10,Date(NOMSG+NOCR))
>> Reg_Save(10,"temp.txt",OK)
>>
>> but that doesn't work - temp.txt ends
>> up as a zero-length file.
Date()does not return a string value.
To put date into register 10, use the following:
Out_Reg(10)
Date(NOMSG+NOCR)
Out_Reg(CLEAR)
However, you do not need to write date in a register to get it in file. Just switch to the file (or tmp buffer) and use Out_Ins instead of Out_Reg.
>
> The following will insert date into a register.
>
> #28=Buf_Switch(Buf_Free) // working buffer
> Out_Ins() Date(NOMSG|REVERSE|NOCR)
> Out_Ins(CLEAR)
> BOF
> Reg_Copy(10,1)
You can insert date directly to register using Out_Reg, see above.
However, since manipulation is needed (increment date, add the filename extension), you need to insert it in a buffer.
Here is a test macro I made:
Buf_Switch(Buf_Free)
Out_Ins()
Date(NOMSG+NORMAL)
Out_Ins(CLEAR)
BOF
#10 = Num_Eval_Date() // #10 = Today's date as Julian number
Del_Char(ALL)
Num_Ins_Date(#10+1,NORMAL+NOCR+VALUE,0) // write tomorows date
Char(-4)
Del_Char(2) // remove first 2 digits of year
EOL
Ins_Text(".evr")
Reg_Copy_Block(10,BOL_pos,CP)
Buf_Quit(OK)
File_Open(@10)
--
Pauli
|
|