home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel Volume 2 #1
/
carousel.iso
/
mactosh
/
hc
/
schedule.sit
/
Scheduler
/
card_7997.txt
< prev
next >
Wrap
Text File
|
1988-02-12
|
6KB
|
194 lines
-- card: 7997 from stack: in
-- bmap block id: 14347
-- flags: 0000
-- background id: 7690
-- name: Talley
-- part 3 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=373 top=46 right=68 bottom=473
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Talley
----- HyperTalk script -----
on mouseUp
put the short date
global firstofmonth, lastofmonth, StorageArray, Subindex, Index, Name
global BlankTalleyArray, pointer, wheretotalley
put 10 into pointer
put " 0 0 0 0 0 0 0 0" into BlankTalleyArray -- place holders for the talley of 4 shifts per day
put "" into field TalleyData
Ask "Which Month Should we Talley" with "February"
put it into wheretotalley
Ask "which Year" with "88"
put "19" before it
put wheretotalley & it into wheretotalley
put wheretotalley into field month
--set lockscreen to true
go to card wheretotalley of bkgnd "Scheduler"
put "" into field 38
SetUpCalendar -- find first and last of month
put word 2 of line 2 of field "Year" into shifnum -- # shifts per day
repeat with index = firstofmonth to lastofMONTH
set style of field index to shadow
repeat with subindex = 1 to shifnum -- or A to ... (up to D for now)
put the number of words of line subindex of field index into employeenum
if subindex = 1 then
put 2 into start -- don't start with date (i.e. word 1)
else
put 1 into start -- otherwise, start with the first word of the line
end if
repeat with employee = start to employeenum
get word employee of line subindex of field index
put it into Name
Put Name
whichDayOfWeek
StoreIt
set cursor to 4
end repeat
end repeat
set style of field index to transparent
end repeat
closebackground
go back
TransferData
end mouseup
On StoreIt
set cursor to 4
Global StorageArray, Name, Index, Subindex, BlankTalleyArray, pointer, step
-- set lockscreen to true -- don't show our work****
if field 38 contains Name then
put Offset (name,field 38) into namepointer
put character (namepointer - 2) of field 38 & char (namepointer - 1) of field 38 into linepointer
put linepointer - 10 into linepointer
-- first 2 characters before the name holds the line num
-- to the word number in the array, which we can then use for counting
-- beyond... to place shifts in their spot in the array
-- namepointer now holds the number of the name in the array
-- i.e. its the 2nd name or the 4th name etc...
-- to find which 'word' number it is means you have to add 8 words
-- for 8 blank shifttalley holders that follow each name etc.
put subindex + step into shiftpointer
get word shiftpointer + 1 of line linepointer of field 38 -- get current talley for this shift
put 1 + it into it -- add 1 to it ***
put it into word shiftpointer + 1 of line linepointer of field 38-- put it back
else -- uh oh, haven't seen this name, better add it to the list
put pointer + 1 into pointer -- set to 11 the first time (2 digits easier to work with)
put pointer - 10 into linepointer
Put 1 into word (subindex + step) of BlankTalleyArray -- its the first
-- time we've seen this name, set the first shift to 1
put Pointer & Name && BlankTalleyArray into line linepointer¬ -- add it to the growing list
of field 38
put " 0 0 0 0 0 0 0 0" into BlankTalleyArray -- restore it for the -- next joe
end if
end StoreIt
On WhichDayOfWeek
global step, index
if first char of first word of line 5 of field index = "S" then
put 4 into step
else
put 0 into step
end if
End WhichDayOfWeek
On TransferData
global wheretotalley
set lockscreen to true
-- go to the calendar background and get the data we've
go to card wheretotalley of bkgnd "Scheduler"-- collated
put the number of lines in field 38 into linenums
repeat with thisline = 1 to linenums
get line thisline of field 38
put it into transporter
put char 3 of word 1 of transporter & char 4 of word 1 of transporter & " " into word 1 of transporter -- strip the code for the line number
closebackground
go to card "Talley"
set lockscreen to false
put transporter into line thisline of field "talleydata"
set lockscreen to true
closebackground
go card wheretotalley
end repeat
closebackground
go card "Talley"
set lockscreen to false
end TransferData
-- part 4 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=380 top=23 right=45 bottom=466
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Show Menu
----- HyperTalk script -----
on mouseUp
show menubar
end mouseUp
-- part 5 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=361 top=69 right=92 bottom=494
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Scheduler
----- HyperTalk script -----
on mouseUp
visual effect barn door close
GO RECENT CARD OF BKGND "SCHEDULER"
end mouseUp
-- part contents for background part 3
----- text -----
February1988
-- part contents for background part 1
----- text -----
MC 5 5 0 0 1 2 0 0
HS 2 7 0 0 3 2 0 0
CS 4 3 0 0 1 0 0 0
CB 4 4 0 0 2 3 0 0
EW 2 2 0 0 0 1 0 0