home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
d_b_a
/
86_11
/
namer2.prg
< prev
next >
Wrap
Text File
|
1986-10-06
|
2KB
|
60 lines
** Code for naming the day of the week from the calendar date **
* namer2.prg
* For use with IBM PC/XT/AT and compatibles running dBASE II
* Assumes that following assembly routine has been poked into RAM
* The namer assembly code reserves addresses F010 through F034
* Decimal Addresses (61456-61492)
*
* The pokes below can be poked into RAM at the beginning of the
* application and called at any time after that. You must,
* however, be careful not to poke anything on top of it.
*
erase
set colon off
set talk off
poke 61456,180,42,205,33,81,82,139,14,48,240,139,22,50,240,180,43,;
205,33,180,42,205,33,162,52,240,90,89,180,43,205,33,195
*
* this input routine is for demonstration only. It has no error checking
* on valid date entry.
do while t
erase
store " " to m::date
@ 10,10 get m::date
read
if m::date=" "
return
endif
* M::DATE is used to pass the target date into the routine and
* will be released after the routine. Only "Nameday" is passed
* back. You must validate the M::DATE before calling this
* routine.
*
* If you poke the routine above into RAM at the beginning of
* your application, include the code following in your running
* code.
* NOTE: This assumes your routine gets dates in the format
* "MM/DD/YY". If you get dates in another format, just make
* the necessary adjustments in the initialization of the passed
* variables.
*
poke 61490,VAL($(M::DATE,4,2)),VAL($(M::DATE,1,2))
poke 61488,((VAL($(M::DATE,7,2))+1900)-1792),7
store " " to m::p
set call to 61456
call m::p
stor $("Sunday .Monday .Tuesday .Wednesday .Thursday .Friday ."+;
"Saturday .",(PEEK(61492)*11)+1,9) TO dayname
@ 14,10 say "Day of Week is " + dayname
release all like M::*
wait
enddo
(61456-61492)
*
* The pokes below can be poked into RAM at the beginning of the
* application and called at any time after that. You must,
* however, be careful not to poke anything on top of it.
*
erase
set c