mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 18:35:32 +00:00
adding %RANDOM% example how to use it echo %random%
svn path=/trunk/; revision=16489
This commit is contained in:
parent
ac3457f145
commit
5620de4ea7
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "cmd.h"
|
||||
#include "config.h"
|
||||
|
|
Loading…
Reference in a new issue