Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
System Time
Message
 
To
02/07/2003 02:03:05
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00805965
Message ID:
00805970
Views:
31
SetTime("f:\")




FUNCTION SetTime(l_path)
LOCAL c_creatf, m1, cDate, cTime
c_creatf = ADDBS(l_path) + SYS(2015) + ".TIM"
m1 = FCREATE(c_creatf)
IF m1 > 0
FCLOSE(m1)
m1 = ADIR(cTim, c_creatf)
ERASE (c_creatf)
cDate = cTim[1,3]
cTime = cTim[1,4]
cBuff = Num2WORD(YEAR(cDate))
cBuff = cBuff + Num2WORD(MONTH(cDate))
cBuff = cBuff + Num2WORD(1)
cBuff = cBuff + Num2WORD(DAY(cDate))
cBuff = cBuff + Num2WORD(VAL(LEFT(cTime,2)))
cBuff = cBuff + Num2WORD(VAL(SUBSTR(cTime,4,2)))
cBuff = cBuff + Num2WORD(VAL(RIGHT(cTime,2)))
cBuff = cBuff + Num2WORD(0)+CHR(0)
DECLARE INTEGER SetLocalTime IN WIN32API STRING @cBuff
SetLocalTime(@cBuff)
ENDIF

RETURN


FUNCTION Num2WORD
*
* Creates a C USHORT (WORD) from a number
*
* Parameters:
*
* tnNum (R) Number to convert
*
LPARAMETER tnNum
*
* x holds an int
*
LOCAL x
x=INT(tnNum)
RETURN CHR(MOD(x,256))+CHR(INT(x/256))

FUNCTION NumToLong
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform