adding %RANDOM% example how to use it echo %random%

svn path=/trunk/; revision=16489
This commit is contained in:
Magnus Olsen 2005-07-07 17:09:56 +00:00
parent ac3457f145
commit 5620de4ea7
2 changed files with 11 additions and 2 deletions

View file

@ -1006,7 +1006,8 @@ ProcessInput (BOOL bFlag)
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL, szTime, sizeof(szTime));
cp = _stpcpy (cp, szTime);
}
/* %DATE% */
else if (_tcsicmp(ip,_T("date")) ==0)
{
TCHAR szDate[40];
@ -1015,9 +1016,16 @@ ProcessInput (BOOL bFlag)
cp = _stpcpy (cp, szDate);
cp = _stpcpy (cp, _T(" "));
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szDate, sizeof (szDate));
cp = _stpcpy (cp, szDate);
}
/* %RANDOM% */
else if (_tcsicmp(ip,_T("random")) ==0)
{
TCHAR szRand[40];
/* Get random number */
_itot(rand(),szRand,10);
cp = _stpcpy (cp, szRand);
}

View file

@ -10,6 +10,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
#include <time.h>
#include "cmd.h"
#include "config.h"