1. Macro tries to create a file using
'current filename' + '.01' + '.txt'
If file already exists macro increases the index '.01' to '.02' and further on, if necessary.
2. Then macro writes the content of the clipboard to the file and ends.
(Macro is executed via Hotkey)
Macro works great in FAR 1.75. In FAR 2.0.x it ignores the zero in '.01' and reduces this index to '.1'. Next index '.02' works fine. Do you have any idea what I have to change. Or is this buggy in FAR 2?
Code: Select all
%i=1; %si="01"; %ext=".txt";
$WHILE(panel.fexist(0,fsplit(APanel.Current,4)+"."+%si+%ext) == 1)
%i=%i+1;
$IF (%i < 10) %si="0"+%i; $ELSE %si=%i; $END
$IF (%i == 100) MsgBox("ERROR creating new Filename", "\nToo many loops ("+%i+") in Macro while creating new name for\n\n\""+APanel.Current+"\"\n ", 1) $EXIT $END
$End
ShiftF4 $Text fsplit(APanel.Current,4) . $Text %si $Text %ext "" Enter ShiftF8 d ShiftIns Enter Enter CtrlHome Down ShiftF10