Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting the Computer Date from FPW
Message
From
19/03/1999 14:27:02
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00199712
Message ID:
00199914
Views:
13
>I am trying to create some automatic testing that involves simulating running an application over a period of time. I need to be able to set the computer date fromthe test program. I see plenty of ways to read the date and do calculations to create new dates, but I have not discovered an easy way to change the computer date. Does anyone have some suggestions?

Regarding to title (FPW) 16 bit ASM calling is supported :)
* Run once to create .bin file
lcBinFile = chr(180)+chr(43)+chr(139)+chr(15)+chr(138)+;
			chr(119)+chr(2)+chr(138)+chr(87)+chr(3)+chr(205)+chr(33)+chr(203)
handle=fcreate("setdate.bin")
=fwrite(handle,lcBinFile,13) 
=fclose(handle)
* Run once to create .bin file
* Creates this
*!*		mov ah,2b       // Set date subfunction
*!*		mov cx,[bx]     // Year
*!*		mov dh,[bx+02]  // Month
*!*		mov dl,[bx+03]  // Day
*!*		int 21          // Call dos int 
*!*		retf
* Creates this

function mySetDate
parameters lnYear, lnMonth, lnDay
load setdate.bin
lnYearLowByte = lnYear % 256
lnYearHighByte = int(lnYear / 256)
lcDate=CHR(lnYearLowByte)+CHR(lnYearHighByte)+CHR(lnMonth)+CHR(lnDay)
call setdate.bin with lcDate
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform