3

The LA Fox Developer Newsletter
June 1998
FOX 2000 (Con’t from page 1)

* Program to isolate possible Denver Public Health Fox Year 2000
problems by:
* 1. find all databases on the network
*
2. find all date fields in these databases
*
3. Run a Norton text search on these date field names
*
to find every occurrence of these names in Fox programs,
*
forms! screen sets, reports and queries
*
Written by Mike Merino on 12/01/1997
Latest revision by MM on 12/04/1997
TO RUN THIS PROGRAM
*
a) start Fox
*
b) you may want to edit the TS line in procedure Norton
to limit your search
*
C) set default to subdirectory in question e.g. (g:\apps\purch)
d) do g:\apps\lib\m2000
e) this will create a four files: C:\apps\y2000prg.txt, y2000sct.txt,
*
y2000frt.txt, y2000pro.txt. Once run you should move your y2000
*
files so the next time you run m2000 you don’t write over them
CLOSE ALL
CLEAR
SET SAFETY OFF
SET TALK OFF
SET CLOCK ON
start=SYS(2) && # SECONDS SINCE MIDNIGHT

Find all databases and put in a text file *

I DIR /s *.DBF > g:\apps\lib\stemp.txt && Art Davidson’s contribution
CLOS DATA
CREATE CURSOR temp (Iinestr c(80))
APPEND FROM g:\apps\lib\stemp.txt TYPE SDF
DELETE ALL FOR;
(SUBSTR(Iinestr,1 0,3)#’DBF’ OR SUBSTR(linestr,1 ,1)”_”;
OR linestr=”FOXUSER”);
AND NOT “Directo”$linestr
DELETE FILE g:\apps\lib\stemp.txt
COPY TO ARRAY mdirect FOR NOT DELEO
USE IN I
ind=1
j=1

first time program run, also check for these phrases a

DO firstime WITH j

mlen=ALEN(mdirect)
DO WHILE indcmlen
IF mdirect(ind,1)”Direct” && build mpath, the
subdirectory path
mpath=SUBSTR(mdirect(ind,1),14)
indind+1
DO WHILE mdirect(ind,1)#”Direct” AND ind<mlen
mdbf=SUBSTR(mdirect(ind,1),1 ,9)
mpd=ALLT(mpath)+"\"+ALLT(mdbf)
build mpd, the database file
USE (mpd)
=AFIELDS(temp)
tlen=ALEN(temp,1)
i=1
DO WHILE ktlen

a Now find all date fields within these dbfs *


IF temp(i,2)=”D” && search within
mpd for Date fields
DO Norton WITH temp(i,1),j &&
file and date field name
ENDIF
i=i+1
ENDDO
ind=ind+1
ENDDO
ENDIF
ENDDO
CLOS ALL

a Now reduce the multitude of files to Just 4 using DOS
*
concatenation *
ICOPY g:\apps\lib\py2*.txt c:\apps\y2000prg.txt
ICOPY g:\apps\lib\sy2*.txt c:\apps\y2000sct.txt\
ICOPY g:\apps\lib\ry2*.txt c:\apps\y2000frt.txt
!COPY g:\appslib\qy2*.txt c:\apps\y2000pro.txt
IDel g:\apps\lib\?y2*.txt
CLEAR
END=SYS(2) && # SECONDS SINCE MIDNIGHT
x=(VAL(END)-VAL(start))/60 && get value in minutes
@10,10 SAY This process took “+ALLT(STR(x,6,2))+”
minutes to run”
SET SAFETY ON
SET TALK ON
*
this is the end
PROCEDURE firstime
PARAMETERSJ
DO Norton WITH “CENT”,j
DO Norton WiTH “CTOD(”,J
DO Norton WiTH “DTOC(”j
DO Norton WiTH “DTOS(”,j
DO Norton WITH “YY “,j
DO Norton WITH “MDY”J
RETURN

PROCEDURE Norton
a procedure to call Norton Utilities Text Search program
*
to find all occurrences of a date field name
a if you want to limit your search, or specify a certain
a file type
to check, edit these statements
a File types not neccesary to check:
*
fxp,dbf,cdx,fpt,tmp,bak,spr,app,pjx,pjt,spx,scx,spx,frx
PARAMETERS mdatenamej
FOR IN=1 TO4
DO CASE
CASE IN=1
npath='g:\apps\*.prg*
sfile='g:\apps\lib\py200'+ALLT(STR(j))+'.txt'
CASE lN2
npath='g:\apps\*.sct
sfile='g:\apps\lib\sy200'+ALLT(STR(j))+'.txt'
CASE lN=3
npath='g:\apps\*.frt'
sfile='g:\apps\lib\ry200'+ALLT(STR(j))+'.txt'
CASE lN4
npath='g:\apps\*.pro'
sfile=’g:~apps~lib\qy200’+ALLT(STR(J))+’.txt’
ENDCASE
*
Call Norton Text Search from a DOS window
!h:\apps\nu\ts &npath &mdatename Is /a /T !LOG >&sfile

(Con't, page 8)
Page 3

3