@Echo off
REM Fd Logger 1.1, A quick and dirty utility to Log text on FD.LOG
if not "%@eval[2+2]"=="4" Goto Sorry
if %_4VER lt 5 Goto Sorry
SetLocal
if '%2'=='' goto Man
if '%3'=='' goto Man
if not exist %1 goto NoFich
iff %_Month==1 then Set _MonthS=Jan
elseiff %_Month==2 then Set _MonthS=Feb
elseiff  %_Month==3 then Set _MonthS=Mar
elseiff  %_Month==4 then Set _MonthS=Apr
elseiff  %_Month==5 then Set _MonthS=May
elseiff  %_Month==6 then Set _MonthS=Jun
elseiff  %_Month==7 then Set _MonthS=Jul
elseiff  %_Month==8 then Set _MonthS=Aug
elseiff  %_Month==9 then Set _MonthS=Sep
elseiff  %_Month==10 then Set _MonthS=Oct
elseiff  %_Month==11 then Set _MonthS=Nov
elseiff  %_Month==12 then Set _MonthS=Dec
endiff
if %@Index[%_Time,0]=0 set _Time= %@SUBSTR[%_TIME,1,7]
set Fich=%@FILEOPEN[%1,append,t]
if %Fich==-1 goto NoFich
set nul=%@FILESEEK[%fich,0,2]
set nul=%@FILEWRITE[%fich,]
set nul=%@FILEWRITE[%fich,----------  %_DOW %_DAY %_MONTHS %@SUBSTR[%_YEAR,2,2], Fd Logger 1.1]
set nul=%@FILEWRITE[%fich,%@SUBSTR[%2,0,1] %_Time  %3&]
set nul=%@FILECLOSE[%fich]
goto end
:NoFich
Echo Could not open file %1 !!!!!!!!!!!!
:Man
text
Fd Logger 1.1, A quick, dirty and free utility to Log text on a
file in a FD compliant way. Requires 4DOS, 4OS2 or 4DOS for NT.
Written by Eduardo Jacob 2:344/2. October 19th 1994.

    Usage: FDLogger File.Log Flag Message
        Where:
        * File.Log: The file where you want Log
        * Flag: The character to be logged, could be one of these (for example)
            ! Fatal errors      $ Accounting info
            ? Other errors      + Brief messages
            - Trivial messages
        * Message: The message you want to Log. Can be 4DOS expression.

    Example: FDLogger Fd.log ! Dos Memory Free = %@DosMem[K] Kb

    Would result on:

----------  Wed 19 Jan 94, Fd Logger 1.1
! 13:13:24  Dos Memory Free = 629 Kb

    Written at the end of Fd.Log
EndText
EndLocal
Goto End
:Sorry
Echo Sorry, this batchfile requires 4DOS 5.0, 4OS2 2.0 or 4DOS for NT 2.0 or higher
:End