TIB: calendar


[Prev][Next][Index][Thread]

TIB: calendar




As always...

"_" represents one(1) space. ie. JODY_SNIDER

/L/ stands for the tiny capitol L that signifies a user-made list. It 
is under the list commands

@ stands for 'theta'

<>,<=,>= stand for "not equal to", "less than or equal to", and 
"greater than or equal to", respectively.

You'll notice how repetitive much of this is. It was unavoidable the 
way I wrote the program. However, I do have some ideas that might 
eliminate this problem for the next version. I know it's tedious...

prgmCALENDAR
:Goto 5
:Lbl 6
:ClrDraw
:/L/CAL(1)+15->X
:For (T,1,D-1
:X+13->X
:If X>84
:6->X
:End
:If X=6
:"SUNDAY,->Str1
:If X=19
:"MONDAY,->Str1
:If X=32
:"TUESDAY,->Str1
:If X=45
:"WEDNESDAY,->Str1
:If X=58
:"THURSDAY,->Str1
:If X=71
:"FRIDAY,->Str1
:If X=84
:"SATURDAY,->Str1
:Text(0,0,Str1
:4length(Str1)-2->X
:For(T,1,dim(/L/MONTH
:X+4->X
:Text(0,X,sub(Str3,/L/MONTH(T),1
:End
:Text(0,X+6,D
:If D=1
:/L/Z1->L5
:If D=2
:/L/Z2->L5
:If D=3
:/L/Z3->L5
:(just keep doing exactly as above until...)
:If D=30
:/L/Z30->L5
:If D=31
:/L/Z31->L5
:Horizontal 55
:2->Z
:For(T,1,dim(L5)-1
:If L5(T)=29
:Then
:Z+6->Z:0->X
:If Z>57
:Then
:ClrDraw:0->Z:Pause
:End
:Text(Z,0,"-
:T+1->T
:End
:X+4->X
:If X>90
:Then
:Z+6->Z:4->X
:If Z>57
:Then
:ClrDraw:0->Z:Pause
:End
:End
:If L5(T)<>0
:Then
:Text(Z,X,sub(Str3,L5(T),1
:End
:End
:Pause
:Goto 5
:Lbl 7
:ClrHome
:Disp 
"INPUT_ONE_EVENT","AT_A_TIME._PRESS","ENTER_WHEN_FINI-","SHED._LETTERS
","WILL_VANISH_AS","THEY_ARE_STORED","INTO_MEMORY.
:Pause:ClrHome
:Disp 
"TRY_TO_KEEP_MES-","SAGES_SHORT,_AS","THEY_USE_INCRED-","IBLE_AMOUNTS_
OF","MEMORY.
:Pause
:Lbl 8
:ClrHome
:Input Str1
:Output(1,1,"_
:{J,D,H->L3
:1->A:2->B:3->C...(just keep doing the same as before)...:26->Z:0->@
:{0,1,1->L2
:DelVar L4
:While L2(1)<length(Str1)
:L2(1)+1->L2(1
:expr(sub(Str1,L2(1),1))->L4(L2(1))
:L2(2)+1->L2(2
:If L2(2)>16
:Then
:L2(3)+1->L2(3
:1->L2(2
:End
:If L2(1)<128
:Output(L2(3),L2(2),"_
:End
:29->L4(dim(L4)+1
:L3(1)->J:L3(2)->D
:L3(3)->H
:/L/CAL(D+2)+dim(L4)-1->/L/CAL(D+2)
:If D=1
:augment(/L/Z1,L4)->/L/Z1
:If D=2
:augment(/L/Z2,L4)->/L/Z2
:(same thing, just keep doing the above)
:If D=31
:augment(/L/Z31,L4)->/L/Z31
:Disp "DO_YOU_WANT_TO","ENTER_ANOTHER","MESSAGE?","_","[1]-YES_ _ 
_[2]-NO
:getKey->K
:While K=0
:getKey->K
:End
:If K=92
:Then
:0->J
:Goto C
:End
:Lbl 5
:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"->Str3
:0->J:4->X:45->Z
:Menu("PLEASE_PICK_ONE","VIEW_CALENDAR",A,"CHANGE_MONTHS",B,"UPDATE",C
:Lbl C
:J+1->J
:Lbl B
:J+1->J
:Lbl A
:J+1->J
:If J=2
:Then
:ClrHome
:Disp 
"******NOTE******","THIS_WILL_ERASE","ALL_INFORMATION","FOR_THIS_MONTH
!","_","CONTINUE?","[1]-YES_ _ _[2]-NO
:getKey->K
:While K=0
:getKey->K
:End
:If K=93
:Goto 5
:End
:ClrDraw
:For(T,2,93,13
:Vertical T
:End
:Vertical 0
:Vertical 1
:Vertical 94
:Horizontal 0
:Horizontal 51
:Text(2,6,"S
:Text(2,19,"M
:Text(2,32,"T
:Text(2,45,"W
:Text(2,58,"T
:Text(2,71,"F
:Text(2,84,"S
:For(T,50,0,-7
:Horizontal T
:End
:If J=2
:Then
:{29->/L/Z1
:{29->/L/Z2
:{29->/L/Z3
:(same as above...)
:{29->/L/Z30
:{29->/L/Z31
:While 1
:getKey->K
:While K=0
:getKey->K
:N+1->N
:If N>1
:0->N
:Line(X,Z,X+10,Z,N
:Line(X,Z,X,Z+4,N
:End
:Line(X,Z,X+10,Z,0
:Line(X,Z,X,Z+4,0
:If K=105
:Goto 1
:If K=24 and X<>4
:X-13->X
:If K=26 and X<>82
:X+13->X
:End
:End
:If J=1 or J=3
:Then
:/L/CAL(1)->X
:/L/CAL(2)->H
:End
:Lbl 1
:13->Z
:If J=2
:Then
:ClrHome
:Disp "NAME_OF_MONTH?
:0->T:DelVar /L/MONTH
:Lbl 10
:getKey->K
:While K=0
:getKey->K
:End
:If K=105
:Goto 9
:T+1->T
:K-(47+(5(iPart(K/10)-5))->C
:If K<=43
:C+2->C
:C->/L/MONTH(T)
:Output(2,T,sub(Str3,C,1
:Goto 10
:Lbl 9
:Disp "HOW_MANY_DAY_IN"
:Input "THE_MONTH?_",H
:X-13->X
:DelVar /L/CAL
:DelVar L5
:End
:For(T,1,H
:X+13->X
:If X>82
:Then
:4->X:Z+7->Z
:End
:Text(Z,X+2,T
:End
:If J=2
:Then
:For(K,0,250
:End
:Goto 5
:End
:34->X:{0,0->L2
:Text(57,0,"PICK_A_DAY_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
:Lbl 3
:getKey->K
:While K=0
:getKey->K
:End
:If K=45
:Then
:Lbl 4
:Fill(0,L2
:Text(57,38,"_ _ _ _ _ _ _
:34->X
:Goto 3
:End
:If K=105
:Goto 2
:3(abs(iPart(K/10)-10)-1)+10fPart(K/10)-1->T
:If T=-2
:0->T
:X+4->X
:If X>42
:Goto 3
:Text(57,X,T
:T->L2(iPart(X/10)-2
:Goto 3
:Lbl 2
:If X=38
:SortA(L2
:10L2(1)+L2(2)->D
:If D>31
:Goto 4
:If J=1
:Goto 6
:If J=3
:Goto 7


Requirements:
prgm     3646 bytes
L2       27
L5       18
/L/CAL   308
/L/MONTH 94
/L/Z1    20
/L/Z2    20  Note: 20 bytes is the starting value. If a message is
so on...           stored then this number will be bigger.
/L/Z31   20
Str1     20
Str3     34

As far as I know, this works. If you anyone has any trouble with this, 
please let me know so I can attempt to fix it.  Also, if you have any 
input as to improvements to the next version, let me know. 

Jody Snider
jody1@alaska.net