[specialList]
pgCtr = 0 : lnCtr = 99 : listCount = 0 : sectCtr = 0
menu #rept, "Close", "Close", [reptClose]
open " STRUCTURE LIST" for text_fs as #rept
#rept, "!trapclose [reptClose]"
rptTtl$ = " Structure Listing by Department and Section with Time Codes " + date$()
gosub [newPage]
files path$, info$(
fc = val(info$(0, 1)) ' dept folders
for cf = 1 to fc
foldName$ = info$(cf, 0)
files foldName$, info2$(
folCt = val(info2$(0,1)) 'section folders
for cf2 = 1 to folCt
fold2Name$ = info2$(cf2,0)
if right$(fold2Name$,5) = "Admin" then
fileName$ = fold2Name$ + "\Admin.dat"
open fileName$ for input as #head ' error on this line
line input #head, deptHead$
close #head
#rept, chr$(10);" ";getFldr$(foldName$);" Dept. Head = "; deptHead$
else
fileName$ = fold2Name$ + "\Admin.dat"
open fileName$ for input as #supv
line input #supv, sectData$
close #supv
f$ = getFldr$(fold2Name$)
#rept, space$(5);f$; space$(20-len(f$));"Supervisor = ";word$(sectData$,1,"|")
namLine$ = space$(10)
for n = 2 to 9
namLine$ = namLine$ + tb$(word$(sectData$,n,"|"),17)
if namLine$ = "" then exit for
next
#rept, namLine$
lnCtr = lnCtr + 1
end if
next
sectCtr = sectCtr + folCt
next
#rept " "
#rept str$(fc); " Departments "; sectCtr; " Sections"
wait
[reptClose]
close #rept
wait
pgCtr = 0 : lnCtr = 99 : listCount = 0
menu #rept, "Close", "Close", [reptClose]
open " EMPLOYEE LIST" for text_fs as #rept
#rept, "!trapclose [reptClose]"
rptTtl$ = tw$ + " Listing by Department and Section " + date$()
gosub [newPage]
files path$, info$(
dfc = val(info$(0, 1)) ' dept folder count
for cf = 1 to dfc
foldName$ = info$(cf, 0)
#rept, chr$(10);" ";getFldr$(foldName$)
files foldName$, info2$(
sfc = val(info2$(0,1)) 'section folder count
sfc2 = val(info2$(0,0)) 'section file count
for cf2 = sfc2+1 to sfc + sfc2 'sfc2+1 is first folder
fold2Name$ = info2$(cf2,0)
#rept, space$(5);getFldr$(fold2Name$)
files fold2Name$, ent$, info3$(
efc = val(info3$(0,0)) 'employee file count
for cf3 = 1 to efc
fileName$ = fold2Name$ + "\" + info3$(cf3,0)
rgt$ = right$(fileName$,3)
if INSTR("hlysal", rgt$) = 0 then [skip]
y$ = "" : z$ = ""
open fileName$ for input as #6
input #6,x$
if not(eof(#6)) then input #6, y$
if not(eof(#6)) then input #6, z$
close #6
x$ = info3$(cf3,0)
perName$ = left$(x$,len(x$)-4)
namLine$ = space$(10) + tb$(word$(x$,3,"|"),17) + word$(x$,4,"|") + " " + word$(x$,5,"|") _
+ space$(15 - len(word$(x$,4,"|"))) _
+ tb$(word$(x$,6,"|"),5) + tb$(word$(x$,12,"|"),14) + tb$(word$(x$,13,"|"),27)
namLine$ = space$(10) + tb$(perName$,20) +" "+ word$(y$,4,"|") +" "+ word$(y$,6,"|")
listCount = listCount + 1 ' count name records
#rept, namLine$; " "; z$
lnCtr = lnCtr + 1
[skip]
'if z$ <> "" then #rept, space$(30);z$
next
next
next
#rept " "
#rept str$(dfc); " Departments "; listCount; " persons"
wait
[reptClose]
close #rept
wait
Code:
namLine$ = space$(10) + tb$(word$(x$,3,"|"),17) + word$(x$,4,"|") + " " + word$(x$,5,"|") _
+ space$(15 - len(word$(x$,4,"|"))) _
+ tb$(word$(x$,6,"|"),5) + tb$(word$(x$,12,"|"),14) + tb$(word$(x$,13,"|"),27)
namLine$ = space$(10) + tb$(perName$,20) +" "+ word$(y$,4,"|") +" "+ word$(y$,6,"|") |
|