cFecha = "08/03/2015"
RUN DATE &cFecha
Y me la cambia, pero me sale la ventana de comandos de msdos y no quiero que salga.
Alguien puede ayudarme?. Gracias
SET CENTURY ON
* Save the current date and time, reset it at the end.
m.olddate = DATE()
m.oldtime = TIME(1)
* Set the system time arbitrarily to 10:30:15 AM on 06/30/2001.
m.updtdate = {06/30/2001}
m.updttime = "10:30:15.00"
=setsystime(m.updtdate, m.updttime)
=MESSAGEBOX("Old date: " + DTOC(m.olddate) + CHR(13) + ;
"Old time: " + m.oldtime + CHR(13) + ;
"New system date: " + DTOC(DATE()) + CHR(13) + ;
"New system time: " + TIME(1), ;
0 + 64 + 0, ;
"SetLocalTime()")
* Now, reset it to its original value.
m.updtdate = m.olddate
m.updttime = m.oldtime
=setsystime(m.updtdate, m.updttime)
* Function setsystime.
* Parameters: date, character time in the form HH:MM:SS:hh.
* Returns: nothing.
FUNCTION setsystime
PARAMETERS m.updtdate, m.updttime
DECLARE SHORT SetLocalTime IN win32api STRING SystemTime
* Use SendMessage to tell everybody that we've changed the system time.
DECLARE INTEGER SendMessage IN win32api ;
INTEGER WindowHandle, ;
INTEGER MESSAGE, ;
STRING Param1, ;
STRING Param2
* SendMessage constants.
#DEFINE HWND_BROADCAST 65535
#DEFINE WM_TIMECHANGE 30
m.SystemTime = word2str(YEAR(m.updtdate)) + ;
word2str(MONTH(m.updtdate)) + ;
word2str(DOW(m.updtdate) - 1) + ;
word2str(DAY(m.updtdate)) + ;
word2str(VAL(LEFT(m.updttime, 2))) + ;
word2str(VAL(SUBSTR(m.updttime, 4, 2))) + ;
word2str(VAL(SUBSTR(m.updttime, 7, 2))) + ;
word2str(VAL(RIGHT(m.updttime, 2)))
m.retval = SetLocalTime(m.SystemTime)
* Send the message that the time has changed.
m.retval = SendMessage(HWND_BROADCAST, WM_TIMECHANGE, "", "")
* Function word2str.
* Parameters: 16-bit value.
* Returns: low-high format string for use in structures
* requiring a WORD value.
FUNCTION word2str
PARAMETERS m.wordval
PRIVATE i, m.retstr
m.retstr = ""
FOR i = 8 TO 0 STEP -8
m.retstr = CHR(INT(m.wordval/(2^i))) + m.retstr
m.wordval = MOD(m.wordval, (2^i))
NEXT
RETURN m.retstr
RUN/N7 DATE &cFecha
Saludos
El presente correo y sus anexos son exclusivamente para el uso de los destinatarios indicados en el encabezado del mismo, pueden contener información confidencial y/o privilegiada. Si usted por error ha recibido la presente correspondencia agradezco hacer omisión de esta y hacerme del conocimiento por esta misma vía
Bendito el Hombre que ha sido llamado por Cristo para ser el soldado del ejército en cuya mano empuñe como arma la palabra de Dios
Luis María Guayán
Tucumán, Argentina
_____________________________
http://comunidadvfp.blogspot.com
Jean, el requerimiento fue puntual por ende requiere respuesta puntual.
En el proceso de desarrollo Alexana descubrirá otras necesidades las cuales planteara si requiere ayuda; No sabemos en este momento en que momento o en qué ambiente ejecutara el cambio de fecha.