home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 85
/
af085a.adf
/
archives
/
af85a1.lzx
/
Dialog_Procedures
/
Source
/
DataMasterWB.AMOS
/
DataMasterWB.amosSourceCode
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS
UTF-8
Wrap
AMOS Source Code
|
1978-07-26
|
50.6 KB
|
2,663 lines
'
Set Buffer 200
'
On Error Goto ER1
'
' *************************
' *** Data-Master V3.0b *** Written By John.A.Kinsella
' *************************
'
' *** SET VARIABLES HERE ****************************************************
'
_DIALOGBUTTON$=""
A#=0.0 : Rem Compiler Fix.
'
_MAXFILES=200
_FILES=0
_PATH$="Ram:"
_WILD$="**"
_FILE$=""
Dim _FILENAME$(_MAXFILES)
'
HINO=2000
Dim F$(HINO)
'
' *** SET GLOBAL VARIABLES HERE *********************************************
'
Global A#,R1$,R2$,R3$,R4$
'
' *** Open Default Screen & Set Font.
'
_OPENDIALOGSCREEN[0,200,44]
_GETWBPALETTE
'
Limit Mouse 128,44 To 447,298-64
'
Get Rom Fonts
_SETFONT["Topaz",8]
'
' *** INSERT PROGRAM BELOW THIS LINE ****************************************
'
RES:
'
F1$="FIELD 1"
F2$="FIELD 2"
F3$="FIELD 3"
F4$="FIELD 4"
FL1=60
FL2=60
FL3=60
FL4=60
DT$=""
P=0
NOR=0
CHK=0
HELP=0
MC=0
TIT$=""
'
For LOP=1 To HINO
F$(LOP)=Chr$(255)+Chr$(255)+Chr$(255)
Next LOP
'
_DRAW3DBOX[0,2,633,54,"",0,0,_COLOUR]
'
_ADDBUTTON[4,5,116,19,"LOAD RECORDS",1]
_ADDBUTTON[4,21,116,35,"SAVE RECORDS",2]
_ADDBUTTON[4,37,116,51,"MERGE RECORDS",3]
_ADDBUTTON[132,5,244,19,"PRINT RECORDS",4]
_ADDBUTTON[132,21,244,35,"SORT RECORDS",5]
_ADDBUTTON[132,37,244,51,"CLEAR ALL",6]
_ADDBUTTON[260,5,372,19,"INSERT RECORD",7]
'
_DRAW3DBOX[388,37,500,51,"",1,0,_BACK]
'
_ADDBUTTON[260,37,372,51,"DELETE RECORD",8]
_ADDBUTTON[388,21,500,35,"FIELD TOTAL",9]
_ADDBUTTON[388,5,500,19,"FIND RECORD",10]
_ADDBUTTON[260,21,372,35,"COPY RECORD",11]
'
_SETFONT["Topaz",9]
_ADDBUTTON[516,5,628,35,"ABOUT",14]
_SETFONT["Topaz",8]
_ADDBUTTON[516,37,628,51,"QUIT !!!",15]
'
_DRAW3DBOX[0,114,633,198,"",0,0,_COLOUR]
_DRAW3DBOX[12,117,116,131,"",0,0,_BACK]
'
_ADDBUTTON[132,117,172,131," S< ",16]
_ADDBUTTON[180,117,220,131," << ",17]
_ADDBUTTON[228,117,260,131," < ",18]
'
_ADDBUTTON[268,117,300,131," > ",19]
_ADDBUTTON[308,117,348,131," >> ",20]
_ADDBUTTON[356,117,396,131," >E ",21]
'
_ADDBUTTON[404,117,452,131,"GOTO",22]
_ADDBUTTON[468,117,620,131,"",23]
'
_ADDBUTTON[12,133,116,147,F1$,24]
_ADDBUTTON[12,149,116,163,F2$,25]
_ADDBUTTON[12,165,116,179,F3$,26]
_ADDBUTTON[12,181,116,195,F4$,27]
'
_ADDINPUTBUTTON[17,17,"",60,60,-28]
_ADDINPUTBUTTON[17,19,"",60,60,-29]
_ADDINPUTBUTTON[17,21,"",60,60,-30]
_ADDINPUTBUTTON[17,23,"",60,60,-31]
'
OK:
Do
'
TEMP$="FREE :"+Str$(Free)
Print At(49,5)+TEMP$+Space$(13-Len(TEMP$))
'
_CHECKBUTTONS
_BUTTONZONE=Param
'
If _BUTTONZONE=16 and P>1
P=1
_DISPLAYRECORD
End If
'
If _BUTTONZONE=17 and P>10
Add P,-10
_DISPLAYRECORD
End If
'
If _BUTTONZONE=18 and P>1
Dec P
_DISPLAYRECORD
End If
'
If _BUTTONZONE=19 and P<NOR
Inc P
_DISPLAYRECORD
End If
'
If _BUTTONZONE=20 and P<NOR-9
Add P,10
_DISPLAYRECORD
End If
'
If _BUTTONZONE=21 and P<NOR
P=NOR
_DISPLAYRECORD
End If
'
If _BUTTONZONE=1
_LOADRECORDS
End If
'
If _BUTTONZONE=2 and NOR>0
_SAVERECORDS
End If
'
If _BUTTONZONE=3
_MERGEFILE
End If
'
If _BUTTONZONE=10 and NOR>1
_FINDRECORD
End If
'
If _BUTTONZONE=9 and NOR>0
_FIELDTOTAL
End If
'
If _BUTTONZONE=14
_ALERTREQUESTER[" D A T A - M A S T E R V 3 . 0b |Written By John.A.Kinsella","YEAH!"]
End If
'
If _BUTTONZONE=15
_ALERTREQUESTER["Do You Really Wish To Quit ?","YES|NO"]
If Param=1
Exit
End If
End If
'
If _BUTTONZONE=4 and NOR>0
_PRINTRECORDS
End If
'
If _BUTTONZONE=6 and NOR>0
_CLEARALL
End If
'
If _BUTTONZONE=7 and NOR<HINO
_INSERTRECORD
End If
'
If _BUTTONZONE=8 and NOR>0
_DELETERECORDS
End If
'
If _BUTTONZONE=11 and NOR>0 and NOR<HINO
_COPYRECORDS
End If
'
If _BUTTONZONE=5 and NOR>1
_SORTRECORDS
End If
'
If _BUTTONZONE=22 and NOR>1
_GOTORECORD
End If
'
If _BUTTONZONE=23 and NOR>0
_FILENOTE
End If
'
If _BUTTONZONE=24
_CHANGEFIELD1[0]
End If
'
If _BUTTONZONE=25
_CHANGEFIELD2[0]
End If
'
If _BUTTONZONE=26
_CHANGEFIELD3[0]
End If
'
If _BUTTONZONE=27
_CHANGEFIELD4[0]
End If
'
If _BUTTONZONE=28 and FL1>0 and NOR>0
_CUTFIELDS[P]
_ADDINPUTBUTTON[17,17,R1$,FL1,FL1,0]
R1$=Param$
F$(P)=R1$+Chr$(255)+R2$+Chr$(255)+R3$+Chr$(255)+R4$
End If
'
If _BUTTONZONE=29 and FL2>0 and NOR>0
_CUTFIELDS[P]
_ADDINPUTBUTTON[17,19,R2$,FL2,FL2,0]
R2$=Param$
F$(P)=R1$+Chr$(255)+R2$+Chr$(255)+R3$+Chr$(255)+R4$
End If
'
If _BUTTONZONE=30 and FL3>0 and NOR>0
_CUTFIELDS[P]
_ADDINPUTBUTTON[17,21,R3$,FL3,FL3,0]
R3$=Param$
F$(P)=R1$+Chr$(255)+R2$+Chr$(255)+R3$+Chr$(255)+R4$
End If
'
If _BUTTONZONE=31 and FL4>0 and NOR>0
_CUTFIELDS[P]
_ADDINPUTBUTTON[17,23,R4$,FL4,FL4,0]
R4$=Param$
F$(P)=R1$+Chr$(255)+R2$+Chr$(255)+R3$+Chr$(255)+R4$
End If
'
Loop
'
For LOP=0 To HINO
F$(LOP)=""
Next LOP
'
' *** INSERT PROGRAM ABOVE THIS LINE ****************************************
'
Screen Close 0
End
'
Procedure _OPENDIALOGSCREEN[N,H,Y]
'
Shared _BACK,_SHADOW,_LIGHT,_COLOUR,_TEXT
'
Screen Open N,640,H,4,Hires
Screen Display N,130,Y,,
Curs Off
Flash Off
Cls 0
Palette $AAA,$0,$FFF,$58B
'
Colour Back Colour(0)
'
_BACK=0
_SHADOW=1
_LIGHT=2
_COLOUR=3
_TEXT=1
'
Pen _TEXT
Paper _BACK
Ink _TEXT,_BACK
'
' *** Set Mouse Colours.
'
Colour 17,$EEC
Colour 18,$0
Colour 19,$E44
'
End Proc
'
Procedure _DRAW3DBOX[X1,Y1,X2,Y2,T$,IN,FC,BC]
'
Shared _SHADOW,_LIGHT
'
If IN=0 or IN=3
C1=_SHADOW
C2=_LIGHT
Else
C1=_LIGHT
C2=_SHADOW
End If
'
If IN<>2
Ink BC,FC
Bar X1,Y1 To X2,Y2
Ink C1
Box X1,Y1 To X2,Y2
If IN<3
Box X1+1,Y1 To X2-1,Y2
End If
Ink C2
Polyline X1+1,Y2 To X2,Y2 To X2,Y1
If IN<3
Polyline X1+1,Y2 To X2-1,Y2 To X2-1,Y1+1
End If
Else
Cls BC,X1+2,Y1+1 To X2-1,Y2
End If
'
I=0
J=0
B=0
While I<Len(T$)
I=Instr(T$,"|",I+1)
If I=0
I=Len(T$)+1
End If
J=I
Inc B
Wend
'
If Upper$(Left$(T$,3))="(S)"
_DRAWUSEROBJECT[X1,Y1,X2,Y2,Mid$(T$,4)]
Goto FIN
End If
'
H#=((Y2-Y1)-(B*Text Base))/(B+1)
Y#=Y1+H#+Text Base
'
Ink FC,BC
Gr Writing 0
'
I=0
J=0
LOP=0
While LOP<B
I=Instr(T$,"|",I+1)
If I=0
I=Len(T$)+1
End If
A$=Mid$(T$,J+1,I-J-1)
'
If Left$(A$,1)="'"
A$=Mid$(A$,2)
X7=X1+4
Goto NXT
End If
'
If Left$(A$,1)="^"
A$=Mid$(A$,2)
X7=(X2-Text Length(A$))-4
Goto NXT
End If
'
WID=Text Length(A$)
X7=(((X2-X1)/2)+X1)-(WID/2)+1
'
NXT:
Text X7,Y#,A$
'
Y#=Y#+Text Base+H#
'
J=I
Inc LOP
Wend
'
Gr Writing 1
'
FIN:
'
End Proc
'
Procedure _CHECKZONE[X1,Y1,X2,Y2,WT]
'
X=X Screen(X Mouse)
Y=Y Screen(Y Mouse)
M=Mouse Key
AN=0
'
If X<X1 or X>X2 or Y<Y1 or Y>Y2 or M=0
Goto FIN2
End If
'
AN=M
'
If WT=0
Goto FIN2
End If
'
If WT=1
Gr Writing 2
Bar X1,Y1 To X2,Y2
End If
'
While X>=X1 and X<=X2 and Y>=Y1 and Y<=Y2
X=X Screen(X Mouse)
Y=Y Screen(Y Mouse)
If Mouse Key=0
Goto FIN
End If
Wend
'
AN=0
'
FIN:
If WT=1
Bar X1,Y1 To X2,Y2
Gr Writing 1
End If
'
FIN2:
'
End Proc[AN]
'
Procedure _SETFONT[FT$,FS]
'
Shared _FONTNAME$,_FONTSIZE
'
FT$=Upper$(FT$)
'
OK=0
POS=1
'
While Font$(POS)<>""
If Upper$(Left$(Font$(POS),Len(FT$)+5))=(FT$+".FONT")
If Val(Mid$(Font$(POS),30,3))=FS
Set Font POS
OK=1
_FONTNAME$=FT$
_FONTSIZE=FS
End If
End If
Inc POS
Wend
'
End Proc[OK]
'
Procedure _ADDBUTTON[X1,Y1,X2,Y2,T$,BZ]
'
Shared _TEXT,_BACK
'
_DRAW3DBOX[X1,Y1,X2,Y2,T$,1,_TEXT,_BACK]
'
If BZ<>0
_ADDZONE[X1,Y1,X2,Y2,BZ,"B"]
End If
'
End Proc
'
Procedure _CHECKBUTTONS
'
Shared _DIALOGBUTTON$
'
ZN=0
I1=1
I2=1
'
While I2<Len(_DIALOGBUTTON$)
'
I2=Instr(_DIALOGBUTTON$,";",I1)
L$=Mid$(_DIALOGBUTTON$,I1,I2-I1)
'
AC=Asc(Mid$(L$,1,1))
X1=Val(Mid$(L$,3,3))
Y1=Val(Mid$(L$,7,3))
X2=Val(Mid$(L$,11,3))
Y2=Val(Mid$(L$,15,3))
BZ=Val(Mid$(L$,19,4))
'
WT=1
If BZ<0
BZ=-BZ
WT=0
End If
'
_CHECKZONE[X1,Y1,X2,Y2,WT]
If Param and(AC>64 and AC<91) : Rem A to Z.
ZN=BZ
Goto FIN
End If
'
I1=I2+1
'
Wend
'
FIN:
'
End Proc[ZN]
'
Procedure _DELETEBUTTON[NO,BC]
'
Shared _DIALOGBUTTON$
'
I1=1
I2=1
'
While I2<Len(_DIALOGBUTTON$)
'
I2=Instr(_DIALOGBUTTON$,";",I1)
L$=Mid$(_DIALOGBUTTON$,I1,I2-I1)
'
BZ=Val(Mid$(L$,19,3))
If BZ<0
BZ=-BZ
End If
'
If BZ=NO
'
X1=Val(Mid$(L$,3,3))
Y1=Val(Mid$(L$,7,3))
X2=Val(Mid$(L$,11,3))
Y2=Val(Mid$(L$,15,3))
'
_DIALOGBUTTON$=Left$(_DIALOGBUTTON$,I1-1)+Mid$(_DIALOGBUTTON$,I2+1)
'
If BC>-1
Ink BC
Bar X1,Y1 To X2,Y2
End If
'
End If
'
I1=I2+1
'
Wend
'
End Proc
'
Procedure _ADDINPUTBUTTON[X,Y,TXT$,L,ML,BZ]
'
Shared _TEXT,_BACK
'
XX=X
YY=Y
ED$=TXT$
SX=L
'
Pen _TEXT
Paper _BACK
'
X1=(X*8)-4
Y1=(Y*8)-3
X2=(X*8)+(L*8)+4
Y2=(Y*8)+8+2
'
If BZ<>0
_ADDZONE[X1,Y1,X2,Y2,BZ,"I"]
_DRAW3DBOX[X1,Y1,X2,Y2,"",1,_TEXT,_BACK]
_DRAW3DBOX[X1+2,Y1+1,X2-2,Y2-1,"",0,_TEXT,_BACK]
Print At(XX,YY)+Mid$(TXT$,1,L)
Goto _END
End If
'
XC=Len(ED$)
MN=0
PX=0
L=XC
'
Clear Key
'
Do
Gosub _DED
'
If Mouse Key=1
X=((X Screen(X Mouse))/8)-XX
If X>=0 and X<=L
XC=X
Gosub _DED
End If
End If
'
Gr Writing 2
GRX=X Curs*8
GRY=YY*8
Bar GRX,GRY To GRX+7,GRY+7
If Mouse Key
Repeat
Until Mouse Key=0
End If
'
Repeat
A$=Inkey$
S=Scancode
K=Key Shift
Until A$<>"" or Mouse Key or(A$<>"" and K)
'
XM=X Screen(X Mouse)
YM=Y Screen(Y Mouse)
If Mouse Key and(XM<X1 or XM>X2 or YM<Y1 or YM>Y2)
A$=Chr$(13)
End If
'
Bar GRX,GRY To GRX+7,GRY+7
Gr Writing 1
'
F=1
'
If A$=Chr$(13)
Exit
End If
'
If A$=Chr$(27)
ED$=TXT$
TXT$=""
Print At(XX,YY)+Space$(SX);
Gosub _DED
Exit
End If
'
If S=65 and K=0 and XC+PX>MN
ED$=Left$(ED$,XC+PX-1)+Mid$(ED$,PX+XC+1)
E=1
Dec L
S=79
End If
'
If S=65 and K>0 and K<4
ED$=Mid$(ED$,PX+XC+1)
L=Len(ED$)
PX=0
XC=0
End If
'
If S=70 and K=0 and XC+PX<L
ED$=Left$(ED$,XC+PX)+Mid$(ED$,PX+XC+2)
E=1
Dec L
End If
'
If S=70 and K>0 and K<4
ED$=Left$(ED$,XC+PX)
L=Len(ED$)
F=0
End If
'
If S=79 and PX+XC>MN
F=0
If XC=0
Dec PX
Else
Dec XC
End If
End If
'
If S=79 and K>0 and K<4
F=0
PX=0
XC=0
End If
'
If S=78 and PX+XC<L
F=0
If XC=SX
Inc PX
Else
Inc XC
End If
End If
'
If S=78 and K>0 and K<4
F=0
XC=L
If XC>SX
XC=SX
End If
PX=L-SX
If PX<0
PX=0
End If
End If
'
If F
If A$>=" " and L<ML
ED$=Left$(ED$,PX+XC)+A$+Mid$(ED$,PX+XC+1)
Inc L
If L>SX
If XC>=SX
Inc PX
Else
Inc XC
End If
Else
Inc XC
End If
End If
End If
'
Loop
'
Goto _END
'
_DED:
Print At(XX,YY)+Space$(SX);
Print At(XX,YY)+Mid$(ED$,PX+1,SX);
Locate Min(XX+XC,XX+SX-1),YY
Return
'
_END:
Print At(XX,YY)+Space$(SX);
Print At(XX,YY)+Left$(ED$,SX);
'
End Proc[ED$]
'
Procedure _DRAWUSEROBJECT[X1,Y1,X2,Y2,T$]
'
Shared _FONTNAME$,_FONTSIZE,_SHADOW,_LIGHT,_TEXT,_BACK,_COLOUR
'
Left$(T$,3)=Upper$(Left$(T$,3))
'
' *** Paste Icon.
'
If Mid$(T$,1,3)="ICO"
NO=Val(Mid$(T$,4,3))
If Length(2)>=NO
Paste Icon X1+Val(Mid$(T$,7,3)),Y1+Val(Mid$(T$,10,3)),NO
End If
End If
'
' *** Paste Bob.
'
If Mid$(T$,1,3)="BOB"
NO=Val(Mid$(T$,4,3))
If Length(1)>=NO
Paste Bob X1+Val(Mid$(T$,7,3)),Y1+Val(Mid$(T$,10,3)),NO
End If
End If
'
' *** Up Arrow.
'
If T$="UAR"
Ink _SHADOW
X=X1+(X2-X1)/2
Y=Y1+(Y2-Y1)/2
Polygon X,Y1+2 To X1+4,Y2-2 To X,Y To X2-4,Y2-2 To X,Y1+2
End If
'
' *** Down Arrow.
'
If T$="DAR"
Ink _SHADOW
X=X1+(X2-X1)/2
Y=Y1+(Y2-Y1)/2
Polygon X,Y2-2 To X1+4,Y1+2 To X,Y To X2-4,Y1+2 To X,Y2-2
End If
'
' *** Left Arrow.
'
If T$="LAR"
Ink _SHADOW
X=X1+(X2-X1)/2
Y=Y1+(Y2-Y1)/2
Polygon X1+4,Y To X2-4,Y1+2 To X,Y To X2-4,Y2-2 To X1+4,Y
End If
'
' *** Right Arrow.
'
If T$="RAR"
Ink _SHADOW
X=X1+(X2-X1)/2
Y=Y1+(Y2-Y1)/2
Polygon X2-4,Y To X1+4,Y1+2 To X,Y To X1+4,Y2-2 To X2-4,Y
End If
'
' *** Group Box.
'
If T$="GBX"
_DRAW3DBOX[X1,Y1,X2,Y2,"",0,0,_BACK]
_DRAW3DBOX[X1+2,Y1+1,X2-2,Y2-1,"",1,0,_BACK]
End If
'
' *** Window.
'
If Mid$(T$,1,3)="WIN"
_DRAW3DBOX[X1,Y1,X2,Y2,"",4,0,_COLOUR]
_DRAW3DBOX[X1+3,Y1+10,X2-3,Y2-2,"",3,_LIGHT,_BACK]
_DRAW3DBOX[X1,Y1,X2,Y1+10,Mid$(T$,4),4,_LIGHT,_COLOUR]
End If
'
End Proc
'
Procedure _VERTICALSLIDER[X,Y,W,H,S,P,T$]
'
Shared _TEXT,_BACK,_TEXT
'
_DRAW3DBOX[X,Y,X+W,Y+H,"",4,_TEXT,_BACK]
HIG=0
'
If S>=1
T=Y+(H*(P-1))/S
B=Min(Y+H,T+H/S)
If B-T<3
T=Y+((H-3)*(P-1))/S
B=Min(Y+(H-3),T+(H-3)/S)
HIG=3
End If
Cls _TEXT,X+3,T+1 To X+W-2,B+1+HIG
End If
'
If T$<>""
_SLIDERROUTINE[T$,P]
End If
'
End Proc
'
Procedure _GRABVERTICALSLIDER[X,Y,W,H,S,P,T$]
'
If S<1 Then Pop Proc
'
T=Y+(H*(P-1))/S
B=Min(Y+H,T+H/S)
'
_CHECKZONE[X,Y,X+W,T-1,2]
If Param>0 and P>1
Dec P
Gosub _DRAWSLIDER
Goto FIN
End If
'
_CHECKZONE[X,B+1,X+W,Y+H,2]
If Param and P<S
Inc P
Gosub _DRAWSLIDER
Goto FIN
End If
'
_CHECKZONE[X,T,X+W,B,0]
If Param>0
'
PO=P
DY=Y Screen(Y Mouse)-T
'
Repeat
'
YY=Y Screen(Y Mouse)-Y-DY
PO=((YY*(S+1))/H+1)
'
If PO<1
PO=1
End If
If PO>S
PO=S
End If
'
If PO<>P
P=PO
Gosub _DRAWSLIDER
End If
'
Until Mouse Key=0
End If
'
Goto FIN
'
_DRAWSLIDER:
_VERTICALSLIDER[X,Y,W,H,S,P,""]
Return
'
FIN:
'
End Proc[P]
'
Procedure _SLIDERROUTINE[T$,P]
'
Shared _FONTNAME$,_FONTSIZE,_COLOUR,_SHADOW,_LIGHT,_BACK,_TEXT
'
Goto T$
Goto FIN
'
'
FIN:
'
End Proc
'
Procedure _DRAWTITLEBAR[T$]
'
Shared _FONTNAME$,_FONTSIZE,_SHADOW,_LIGHT
'
B_FT$=_FONTNAME$
B_FS=_FONTSIZE
'
_SETFONT["Topaz",8]
'
If T$=""
T$=T$+"'Amiga Workbench "+Str$(Chip Free)-" "+" graphics mem "
T$=T$+Str$(Fast Free)-" "+" other mem"
End If
_DRAW3DBOX[-1,-1,640,10,T$,1,_SHADOW,_LIGHT]
'
_SETFONT[B_FT$,B_FS]
'
End Proc
'
Procedure _GETBUTTONSTRING[NO]
'
Shared _DIALOGBUTTON$
'
I1=1
I2=1
P=0
'
While I2<Len(_DIALOGBUTTON$) and P<>NO
'
I2=Instr(_DIALOGBUTTON$,";",I1)
L$=Mid$(_DIALOGBUTTON$,I1,I2-I1)
'
BZ=Val(Mid$(L$,19,4))
If BZ<0
BZ=-BZ
End If
'
If BZ=NO
Exit
End If
'
I1=I2+1
'
Inc P
Wend
'
End Proc[L$]
'
Procedure _ADDZONE[X1,Y1,X2,Y2,BZ,TP$]
'
Shared _DIALOGBUTTON$
'
L$=Space$(22)+Mid$(TP$,2)+";"
'
Mid$(L$,1,1)=Mid$(TP$,1,1)
Mid$(L$,3,3)=Str$(X1)-" "
Mid$(L$,7,3)=Str$(Y1)-" "
Mid$(L$,11,3)=Str$(X2)-" "
Mid$(L$,15,3)=Str$(Y2)-" "
Mid$(L$,19,4)=Str$(BZ)-" "
'
_DIALOGBUTTON$=_DIALOGBUTTON$+L$
'
End Proc
'
Procedure _ALERTREQUESTER[M$,BT$]
'
Shared _DIALOGBUTTON$,_BACK,_COLOUR,_TEXT,_LIGHT,_SHADOW
'
If M$="_Cc_"
Goto FIN
End If
'
I=0
J=0
L=0
While I<Len(M$)
I=Instr(M$,"|",I+1)
If I=0
I=Len(M$)+1
End If
J=I
Inc L
Wend
'
I=0
J=0
B=0
While I<Len(BT$)
I=Instr(BT$,"|",I+1)
If I=0
I=Len(BT$)+1
End If
J=I
Inc B
Wend
'
_OPENDIALOGSCREEN[7,50+(L*8),44]
Get Palette 0
H=50+(L*8)-1
'
_DRAW3DBOX[0,0,639,H-1,"",4,0,_COLOUR]
Set Pattern 2
_DRAW3DBOX[3,10,636,H-2,"",3,_LIGHT,_BACK]
Set Pattern 0
'
If BT$=""
_DRAW3DBOX[0,0,639,10,"",4,0,_COLOUR]
Ink _TEXT,_COLOUR
Text 5,7,"Information Requester"
_DRAW3DBOX[8,13,632,H-3,M$,3,_TEXT,_BACK]
Goto FIN2
End If
'
B_DLG$=_DIALOGBUTTON$
_DIALOGBUTTON$=""
'
_DRAW3DBOX[0,0,18,10,"",4,1,_COLOUR]
_ADDZONE[0,0,18,10,1,"B"]
Ink _LIGHT
Bar 7,3 To 11,7
Ink _SHADOW
Box 7,3 To 11,7
_DRAW3DBOX[19,0,639,10,"",4,0,_COLOUR]
Ink _TEXT,_COLOUR
Text 24,7,"Button Requester"
_DRAW3DBOX[8,13,632,H-20,M$,3,_TEXT,_BACK]
'
BB#=B
D2#=326.0-((BB#*100.0)/2.0)
'
I=0
J=0
A=0
While A<B
I=Instr(BT$,"|",I+1)
If I=0
I=Len(BT$)+1
End If
_ADDBUTTON[D2#+100*A,H-18,D2#+100*A+86,H-5,Left$(Mid$(BT$,J+1,I-J-1),10),A+2]
J=I
Inc A
Wend
'
Repeat
_CHECKBUTTONS
Q=Param
Until Q
'
_DIALOGBUTTON$=B_DLG$
B_DLG$=""
ZN=0
'
FIN:
Screen Close 7
'
FIN2:
'
End Proc[Q-1]
'
Procedure _GETWBPALETTE
'
F$=""
F=0
'
If Exist("Env:Sys/Palette.prefs")
F$="Env:Sys/Palette.prefs"
F=1
End If
'
If F=0 and Exist("ENVARC:Sys/Palette.prefs")
F$="EnvArc:Sys/Palette.prefs"
F=1
End If
'
If F=0 and Exist("Devs:System-Configuration")
F$="Devs:System-Configuration"
F=2
End If
'
If F=0
Palette $999,$0,$FFF,$58A,$F00,$F0,$F,$FF0
End If
'
' *** Change To WB Colours.
'
If F=1
Open In 1,F$
L=Lof(1)
Close 1
A$=String$(" ",L)
Bload F$,Varptr(A$)
For A=0 To 7
R=Peek(Varptr(A$)+180+A*8)/16
G=Peek(Varptr(A$)+182+A*8)/16
B=Peek(Varptr(A$)+184+A*8)/16
Colour A,(R*256+G*16+B)
Next A
A$=""
End If
'
If F=2
Open In 1,F$
L=Lof(1)
Close 1
A$=Space$(L)
Bload F$,Varptr(A$)
For A=0 To 3
Colour A,Deek(Varptr(A$)+110+A*2)
Colour A+16,Deek(Varptr(A$)+102+A*2)
Next A
A$=""
End If
'
Colour Back Colour(0)
'
End Proc
'
Procedure _FILEREQUESTER[H$]
'
Shared _DIALOGBUTTON$,_FONTNAME$,_FONTSIZE,_TEXT,_COLOUR,_LIGHT,_BACK
Shared _MAXFILES,_FILES,_PATH$,_WILD$,_FILENAME$(),_FILE$
'
TEMP1$=_DIALOGBUTTON$
_DIALOGBUTTON$=""
'
TEMP2$=_FONTNAME$
TEMP3=_FONTSIZE
'
_SETFONT["Topaz",8]
'
_OPENDIALOGSCREEN[7,110,44]
Get Palette 0
_DRAWTITLEBAR[H$]
'
_DRAW3DBOX[0,11,639,108,"",1,,_COLOUR]
_DRAW3DBOX[8,13,334,106,"",1,,_BACK]
'
_ADDBUTTON[337,89,352,97,"(S)UAR",-1]
_DRAW3DBOX[337,13,352,87,"",1,,_BACK]
_ADDBUTTON[337,98,352,106,"(S)DAR",-2]
'
_DRAW3DBOX[356,45,440,59,"File",1,_TEXT,_BACK]
_ADDINPUTBUTTON[45,8,_FILE$,31,31,-3]
_DRAW3DBOX[356,13,440,27,"Drawer",1,_TEXT,_BACK]
_ADDINPUTBUTTON[45,4,_PATH$+_WILD$,31,120,-4]
'
_ADDBUTTON[356,77,490,91,"Parent",5]
_ADDBUTTON[356,92,490,106,"Volumes",6]
_ADDBUTTON[497,77,631,91,"Cancel",7]
_ADDBUTTON[497,92,631,106,"OK",8]
'
_BPATH$=_PATH$+_WILD$
_SWITCH=0
_POSITION=1
'
If _FILES=0
Gosub _GETDIRECTORY
End If
'
Gosub _DISPLAYLIST
Gosub _DISPLAYPATH
Gosub _DISPLAYFILE
'
Do
'
_CHECKBUTTONS
_BUTTONZONE=Param
'
If _BUTTONZONE=1 and _POSITION>1
Dec _POSITION
Gosub _DISPLAYLIST
End If
'
If _BUTTONZONE=2 and _POSITION<_FILES-11
Inc _POSITION
Gosub _DISPLAYLIST
End If
'
If _BUTTONZONE=3
_ADDINPUTBUTTON[45,8,_FILE$,31,31,0]
_FILE$=Param$
End If
'
If _BUTTONZONE=4
_BPATH$=_PATH$
_ADDINPUTBUTTON[45,4,_PATH$+_WILD$,31,120,0]
_PATH$=Param$
Gosub _CUTWILD
_TEMP$=_PATH$
Gosub _CHECKFILE
End If
'
If _BUTTONZONE=5
Gosub _PARENT
End If
'
If _BUTTONZONE=6
SWITCH=1
Gosub _GETDIRECTORY
Gosub _DISPLAYLIST
Gosub _DISPLAYPATH
Gosub _DISPLAYFILE
End If
'
If _BUTTONZONE=7
_FILE$=""
Goto FIN
End If
'
If _BUTTONZONE=8
_TEMP$=_PATH$+_FILE$
Goto FIN
End If
'
_COUNT=0
While _COUNT<11
_CHECKZONE[10,16+(_COUNT*8),332,23+(_COUNT*8),1]
If(Param>0) and(_FILENAME$(_POSITION+_COUNT)<>"")
_TEMP$=_FILENAME$(_POSITION+_COUNT)
Gosub _CHECKFILE
Gosub _DISPLAYFILE
End If
Inc _COUNT
Wend
'
_GRABVERTICALSLIDER[337,13,15,74,Min(_FILES,_FILES-11),_POSITION,""]
If Param<>_POSITION
_POSITION=Param
Gosub _DISPLAYLIST
End If
'
Loop
'
_GETDIRECTORY:
'
If Not Exist(_PATH$)
_PATH$=_BPATH$
End If
'
_COUNT=1
While _COUNT<_MAXFILES+1
_FILENAME$(_COUNT)=""
Inc _COUNT
Wend
'
Set Dir 31
_FILES=0
'
If SWITCH=0
'
_FILENAME$(FILES)=Dir First$(_PATH$+_WILD$)
While _FILENAME$(_FILES)<>"" and _FILES<_MAXFILES
If Mid$(_FILENAME$(_FILES),1,1)="*"
Mid$(_FILENAME$(_FILES),31,5)="(Dir)"
End If
Inc _FILES
_FILENAME$(_FILES)=Dir Next$
Wend
'
Else
'
_FILENAME$(FILES)=Dev First$("**")
While _FILENAME$(_FILES)<>"" and _FILES<_MAXFILES
Mid$(_FILENAME$(_FILES),31,5)="(Dev)"
Inc _FILES
_FILENAME$(_FILES)=Dev Next$
Wend
'
End If
'
_BPATH$=_PATH$
_POSITION=1
SWITCH=0
'
Return
'
_DISPLAYPATH:
'
Pen _TEXT
Print At(45,4)+Space$(31);
Print At(45,4)+Left$(_PATH$+_WILD$,31);
Return
'
_DISPLAYFILE:
'
Pen _TEXT
Print At(45,8)+Space$(31);
Print At(45,8)+Left$(_FILE$,31);
Return
'
_DISPLAYLIST:
'
_COUNT=_POSITION
While _COUNT<_POSITION+11
Locate 2,_COUNT-_POSITION+2
If _FILENAME$(_COUNT)<>""
If Left$(_FILENAME$(_COUNT),1)="*"
Pen _LIGHT
Else
Pen _TEXT
End If
Print _FILENAME$(_COUNT);
Else
Print Space$(38);
End If
Inc _COUNT
Wend
'
_VERTICALSLIDER[337,13,15,74,Min(_FILES,_FILES-11),_POSITION,""]
'
Return
'
_PARENT:
'
If Len(_PATH$)>2
_COUNT=Len(_PATH$)-1
While _COUNT>1
A$=Mid$(_PATH$,_COUNT,1)
If(A$="/") or(A$=":")
_PATH$=Left$(_PATH$,_COUNT)
Gosub _GETDIRECTORY
Gosub _DISPLAYPATH
Gosub _DISPLAYLIST
Exit
End If
Dec _COUNT
Wend
End If
Return
'
_CUTWILD:
'
_COUNT=Len(_PATH$)
While _COUNT>1
A$=Mid$(_PATH$,_COUNT,1)
If(A$="/") or(A$=":")
_WILD$=Right$(_PATH$,Len(_PATH$)-_COUNT)
_PATH$=Left$(_PATH$,_COUNT)
Exit
End If
Dec _COUNT
Wend
Return
'
_CHECKFILE:
'
_COUNT=30
While _COUNT>1
If Mid$(_TEMP$,_COUNT,1)<>" "
_TEMP$=Left$(_TEMP$,_COUNT)
Exit
End If
Dec _COUNT
Wend
'
If(Right$(_TEMP$,1)=":") or(Right$(_TEMP$,1)="/")
If Left$(_TEMP$,1)=" "
_PATH$=Mid$(_TEMP$,2)
Else
_PATH$=_TEMP$
End If
Gosub _GETDIRECTORY
SWITCH=0
Gosub _DISPLAYPATH
Gosub _DISPLAYLIST
Goto OK1
End If
'
A$=Left$(_TEMP$,1)
_TEMP$=Mid$(_TEMP$,2)
'
If A$="*"
_PATH$=_PATH$+_TEMP$+"/"
Gosub _GETDIRECTORY
Gosub _DISPLAYPATH
Gosub _DISPLAYLIST
Goto OK1
End If
'
_FILE$=_TEMP$
Gosub _DISPLAYFILE
'
OK1:
Return
'
FIN:
'
_SETFONT[TEMP2$,TEMP3]
_DIALOGBUTTON$=TEMP1$
Screen Close 7
'
End Proc[_TEMP$]
'
Procedure _INPUTREQUESTER[M$,TXT$,L,ML]
'
Shared _DIALOGBUTTON$,_BACK,_COLOUR,_TEXT,_LIGHT,_SHADOW
'
_TEMP1$=_DIALOGBUTTON$
_TEMP2$=_FONTNAME$
_TEMP3=_FONTSIZE
_DIALOGBUTTON$=""
'
OLDTEXT$=TXT$
'
_OPENDIALOGSCREEN[7,58,44]
Get Palette 0
H=57
'
_DRAW3DBOX[0,0,639,H-1,"",4,0,_COLOUR]
Set Pattern 2
_DRAW3DBOX[3,10,636,H-2,"",3,_LIGHT,_BACK]
Set Pattern 0
'
_DRAW3DBOX[2,1,637,9,M$,2,_TEXT,_COLOUR]
_DRAW3DBOX[8,13,632,H-20,"",3,,_BACK]
'
_ADDBUTTON[20,H-18,120,H-5,"Cancel",1]
_ADDBUTTON[519,H-18,619,H-5,"OK",2]
'
L=Min(L,76)
XX=40-Int(L/2)
_ADDINPUTBUTTON[XX,3,TXT$,L,ML,-3]
'
Do
'
_CHECKBUTTONS
_BUTTONZONE=Param
'
If _BUTTONZONE=1
TXT$=OLDTEXT$
Exit
End If
'
If _BUTTONZONE=2
Exit
End If
'
If _BUTTONZONE=3
_ADDINPUTBUTTON[XX,3,TXT$,L,ML,0]
TXT$=Param$
End If
'
Loop
'
_DIALOGBUTTON$=_TEMP1$
_SETFONT[_TEMP2$,_TEMP3]
Screen Close 7
'
End Proc[TXT$]
'
Procedure _FIELDTOTAL
'
Shared _DIALOGBUTTON$,F$(),_TEXT,_BACK,_COLOUR,_LIGHT,F$,NOR
'
_OPENDIALOGSCREEN[7,52,102]
Get Palette 0
'
Scroll Off
'
_TEMP1$=_DIALOGBUTTON$
_DIALOGBUTTON$=""
'
_TXT1$="Total = @"
_TXT2$="0"
'
_DRAW3DBOX[100,4,539,16,"ENTER STRING TO PLACE FIELD TOTAL INSIDE",1,_LIGHT,_COLOUR]
_ADDBUTTON[516,21,628,35,"Cancel",1]
_ADDBUTTON[516,37,580,51,"PRINT",2]
_ADDBUTTON[588,37,628,51,"O.K",3]
_DRAW3DBOX[12,37,76,51,"ADD",1,_TEXT,_BACK]
_DRAW3DBOX[142,37,500,51,"ADD @ SYMBOL TO PLACE TOTAL IN TEXT",2,_TEXT,_BACK]
'
_ADDINPUTBUTTON[2,3,_TXT1$,60,80,-4]
_ADDINPUTBUTTON[11,5,_TXT2$,8,8,-5]
'
TEMP$=""
Do
'
_CHECKBUTTONS
_BUTTONZONE=Param
'
If _BUTTONZONE=4
_ADDINPUTBUTTON[2,3,_TXT1$,60,80,0]
_TXT1$=Param$
End If
'
If _BUTTONZONE=5
_ADDINPUTBUTTON[11,5,_TXT2$,8,8,0]
_TXT2$=Param$
End If
'
If _BUTTONZONE=1
Screen Close 7
Goto FIN
End If
'
If _BUTTONZONE=2
NC=1
Exit
End If
'
If _BUTTONZONE=3
NC=0
Exit
End If
'
Loop
'
_DIALOGBUTTON$=_TEMP1$
'
_ALERTREQUESTER["Total Which Field ?","FIELD 1|FIELD 2|FIELD 3|FIELD 4|NO FIELD"]
If Param=0
Goto FIN
End If
_FLD=Param
'
_ALERTREQUESTER["Totaling Field"+Str$(_FLD),""]
'
TTL#=Val(_TXT2$)
For LOP=1 To NOR
_CUTFIELDS[LOP]
If _FLD=1
TTL#=TTL#+Val(R1$)
End If
If _FLD=2
TTL#=TTL#+Val(R2$)
End If
If _FLD=3
TTL#=TTL#+Val(R3$)
End If
If _FLD=4
TTL#=TTL#+Val(R4$)
End If
Next LOP
'
_ALERTREQUESTER["_Cc_",""]
'
If NC=1
For LOP=1 To Len(_TXT1$)
CHK$=Mid$(_TXT1$,LOP,1)
If CHK$="@"
Lprint Str$(TTL#)-" ";
Else
Lprint CHK$;
End If
Next LOP
Lprint
End If
'
If NC=0
_TMP3$=""
For LOP=1 To Len(_TXT1$)
CHK$=Mid$(_TXT1$,LOP,1)
If CHK$="@"
_TMP3$=_TMP3$+Str$(TTL#)-" "
Else
_TMP3$=_TMP3$+CHK$
End If
Next LOP
_ALERTREQUESTER[_TMP3$,"O.K!"]
End If
'
FIN:
Scroll On
_DIALOGBUTTON$=_TEMP1$
'
End Proc
'
Procedure _LOADRECORDS
'
Shared _DIALOGBUTTON$,F$(),_WILD$,_BACK,_TEXT,_COLOUR
Shared F1$,F2$,F3$,F4$,FL1,FL2,FL3,FL4,TIT$,P,DT$,NOR
'
If NOR>0
_ALERTREQUESTER["All Current Records Will Be Lost, Continue ?","YES|NO"]
If Param<>1
Pop Proc
End If
End If
'
_FILEREQUESTER["Load Database File"]
ED$=Param$
'
If ED$=""
Pop Proc
End If
'
If Not Exist(ED$)
_ALERTREQUESTER["File Does Not Exist !","OOPS"]
Pop Proc
End If
'
Open In 1,ED$
CHK$=Input$(1,9)
If Left$(CHK$,4)<>"DM20"
Close 1
_ALERTREQUESTER["Incorrect File Format !","OOPS"]
Pop Proc
End If
'
_ALERTREQUESTER["Loading Records, Please Wait...||",""]
TIT$=ED$
'
Screen 7
_DRAW3DBOX[55,45,584,55,"",0,0,_BACK]
'
Line Input #1,DT$
'
Line Input #1,F$(1)
_CUTFIELDS[1]
F1$=R1$
F2$=R2$
F3$=R3$
F4$=R4$
'
Input #1,FL1
Input #1,FL2
Input #1,FL3
Input #1,FL4
Input #1,NOR
'
For LOP=1 To NOR
Line Input #1,F$(LOP)
A1#=NOR
A2#=529
A3#=A2#/A1#
A4#=LOP
A5#=A3#*A4#
Cls _COLOUR,56,46 To 56+A5#,55
Next LOP
'
Close 1
'
_ALERTREQUESTER["_Cc_",""]
'
_CHANGEFIELD1[1]
_CHANGEFIELD2[1]
_CHANGEFIELD3[1]
_CHANGEFIELD4[1]
'
_DRAW3DBOX[468,117,620,131,DT$,2,_TEXT,_BACK]
'
P=1
_CUTFIELDS[P]
_DISPLAYRECORD
'
End Proc
'
Procedure _DISPLAYRECORD
'
Shared _TEXT,_BACK,P,F$(),FL1,FL2,FL3,FL4,F1$,F2$,F3$,F4$,NOR
'
SC=Screen
Screen 0
'
If P>0
_CUTFIELDS[P]
Print At(17,17)+Left$(R1$,FL1)+Space$(FL1-Len(Left$(R1$,FL1)))
Print At(17,19)+Left$(R2$,FL2)+Space$(FL2-Len(Left$(R2$,FL2)))
Print At(17,21)+Left$(R3$,FL3)+Space$(FL3-Len(Left$(R3$,FL3)))
Print At(17,23)+Left$(R4$,FL4)+Space$(FL4-Len(Left$(R4$,FL4)))
Else
Print At(17,17)+Space$(FL1)
Print At(17,19)+Space$(FL2)
Print At(17,21)+Space$(FL3)
Print At(17,23)+Space$(FL4)
End If
'
_DRAW3DBOX[12,117,116,131,Str$(P)-" "+" / "+Str$(NOR)-" ",2,_TEXT,_BACK]
'
Screen SC
'
End Proc
'
Procedure _CUTFIELDS[Z]
'
Shared F$()
'
TEMP$=F$(Z)
'
I=Instr(TEMP$,Chr$(255))
R1$=Left$(TEMP$,I-1)
'
TEMP$=Right$(TEMP$,Len(TEMP$)-I)
'
I=Instr(TEMP$,Chr$(255))
R2$=Left$(TEMP$,I-1)
'
TEMP$=Right$(TEMP$,Len(TEMP$)-I)
'
I=Instr(TEMP$,Chr$(255))
R3$=Left$(TEMP$,I-1)
'
R4$=Right$(TEMP$,Len(TEMP$)-I)
'
End Proc
'
Procedure _DELETERECORDS
'
Shared F$(),P,NOR
'
_ALERTREQUESTER["Delete What ?","THIS ONE|FROM-TO"]
'
If Param=0
Pop Proc
End If
'
If Param=1
STA=P
FIN=P
End If
'
If Param=2
'
_INPUTREQUESTER["Enter Record To Start From ?","",4,4]
STA=Val(Param$)
If STA<1 or STA>NOR
Pop Proc
End If
'
_INPUTREQUESTER["Enter Record To Finish At ?","",4,4]
FIN=Val(Param$)
If FIN<0 or FIN>NOR or FIN<STA
Pop Proc
End If
'
End If
'
_ALERTREQUESTER["Delete Record(s), Sure ?","YES|NO"]
If Param<>1
Pop Proc
End If
'
Z=(FIN-STA)+1
'
NNO=NOR
For LOP=FIN+1 To NOR
F$(LOP-Z)=F$(LOP)
Next LOP
'
NOR=NOR-Z
If P>=NOR
P=P-Z
End If
'
If NOR=0
P=0
End If
'
For LOP=NOR+1 To NNO
F$(LOP)=Chr$(255)+Chr$(255)+Chr$(255)
Next LOP
'
_DISPLAYRECORD
'
End Proc
'
Procedure _COPYRECORDS
'
Shared HINO,F$(),P,NOR
'
_ALERTREQUESTER["Choose Copy Option ?","COPY ONCE|MULTIPLE"]
'
If Param=0
Pop Proc
End If
'
If Param=1
Z=1
End If
'
If Param=2
_INPUTREQUESTER["How Many Times Do You Wish To Copy This Record (1 To"+Str$(HINO-NOR)+")","",4,4]
Z=Val(Param$)
If Z<1 or Z+NOR>HINO
Pop Proc
End If
End If
'
For LOP=NOR+1 To NOR+Z
F$(LOP)=F$(P)
Next LOP
'
Add NOR,Z
'
_DISPLAYRECORD
'
End Proc
'
Procedure _SORTRECORDS
'
Shared NOR
'
_ALERTREQUESTER["Sort Records, Sure ?","YES|NO"]
If Param<>1
Pop Proc
End If
'
_ALERTREQUESTER["Sorting Records, Please Wait...||",""]
'
Screen 7
_DRAW3DBOX[55,45,584,55,"",0,0,0]
_SORT[1,NOR]
'
_ALERTREQUESTER["_Cc_",""]
_DISPLAYRECORD
'
End Proc
'
Procedure _SORT[L,R]
'
Shared F$(),_COLOUR,NOR
'
I=L
J=R
'
A1#=NOR
A2#=529
A3#=A2#/A1#
A4#=L
A5#=A3#*A4#
Cls _COLOUR,56,46 To 56+A5#,55
'
R1$=F$((L+R)/2)
'
While I<=J
While F$(I)<R1$
Inc I
Wend
'
While R1$<F$(J)
Dec J
Wend
'
If I<=J
Swap F$(I),F$(J)
Inc I
Dec J
End If
'
Wend
'
If L<J
_SORT[L,J]
End If
'
If I<R
_SORT[I,R]
End If
'
End Proc
'
Procedure _GOTORECORD
'
Shared P,NOR
'
_INPUTREQUESTER["Goto Which Record (1 To "+Str$(NOR)-" "+") ?","",4,4]
Z=Val(Param$)
If Z<0 or Z>NOR
Pop Proc
End If
'
P=Z
_DISPLAYRECORD
'
End Proc
'
Procedure _FILENOTE
'
Shared DT$,_BACK,_TEXT
'
_INPUTREQUESTER["Enter File-Note ?",DT$,18,18]
DT$=Param$
_DRAW3DBOX[468,117,620,131,DT$,2,_TEXT,_BACK]
'
End Proc
'
Procedure _CHANGEFIELD1[N]
'
Shared FL1,F1$,_DIALOGBUTTON$,_COLOUR,_TEXT,_BACK
'
If N=0
'
_INPUTREQUESTER["Enter Field Title #1",F1$,12,12]
TEMP1$=Param$
'
_INPUTREQUESTER["Enter Field Width #1 (0 To 60)",Str$(FL1)-" ",2,2]
TEMP2=Val(Param$)
'
If TEMP2>60
TEMP2=60
End If
'
F1$=TEMP1$
FL1=TEMP2
'
End If
'
_CUTFIELDS[P]
'
_DELETEBUTTON[28,_COLOUR]
_ADDINPUTBUTTON[17,17,R1$,FL1,FL1,-28]
'
_DRAW3DBOX[12,133,116,147,F1$,1,_TEXT,_BACK]
'
End Proc
'
Procedure _CHANGEFIELD2[N]
'
Shared FL2,F2$,_DIALOGBUTTON$,_COLOUR,_TEXT,_BACK
'
If N=0
'
_INPUTREQUESTER["Enter Field Title #2",F2$,12,12]
TEMP1$=Param$
'
_INPUTREQUESTER["Enter Field Width #2 (0 To 60)",Str$(FL2)-" ",2,2]
TEMP2=Val(Param$)
'
If TEMP2>60
TEMP2=60
End If
'
F2$=TEMP1$
FL2=TEMP2
'
End If
'
_CUTFIELDS[P]
'
_DELETEBUTTON[29,_COLOUR]
_ADDINPUTBUTTON[17,19,R2$,FL2,FL2,-29]
'
_DRAW3DBOX[12,149,116,163,F2$,1,_TEXT,_BACK]
'
End Proc
'
Procedure _CHANGEFIELD3[N]
'
Shared FL3,F3$,_DIALOGBUTTON$,_COLOUR,_TEXT,_BACK
'
If N=0
'
_INPUTREQUESTER["Enter Field Title #3",F3$,12,12]
TEMP1$=Param$
'
_INPUTREQUESTER["Enter Field Width #3 (0 To 60)",Str$(FL3)-" ",2,2]
TEMP2=Val(Param$)
'
If TEMP2>60
TEMP2=60
End If
'
F3$=TEMP1$
FL3=TEMP2
'
End If
'
_CUTFIELDS[P]
'
_DELETEBUTTON[30,_COLOUR]
_ADDINPUTBUTTON[17,21,R3$,FL3,FL3,-30]
'
_DRAW3DBOX[12,165,116,179,F3$,1,_TEXT,_BACK]
'
End Proc
'
Procedure _CHANGEFIELD4[N]
'
Shared FL4,F4$,_DIALOGBUTTON$,_COLOUR,_TEXT,_BACK
'
If N=0
'
_INPUTREQUESTER["Enter Field Title #4",F4$,12,12]
TEMP1$=Param$
'
_INPUTREQUESTER["Enter Field Width #4 (0 To 60)",Str$(FL4)-" ",2,2]
TEMP2=Val(Param$)
'
If TEMP2>60
TEMP2=60
End If
'
F4$=TEMP1$
FL4=TEMP2
'
End If
'
_CUTFIELDS[P]
'
_DELETEBUTTON[31,_COLOUR]
_ADDINPUTBUTTON[17,23,R4$,FL4,FL4,-31]
'
_DRAW3DBOX[12,181,116,195,F4$,1,_TEXT,_BACK]
'
End Proc
'
Procedure _SAVERECORDS
'
Shared NOR,DT$,FL1,FL2,FL3,FL4,F1$,F2$,F3$,F4$,TIT$,F$(),_COLOUR,_BACK
'
_FILEREQUESTER["Save Database *.DAT File"]
ED$=Param$
'
If ED$=""
Pop Proc
End If
'
If Exist(ED$)
_ALERTREQUESTER["File Already Exists, Overwrite ?","YES|NO"]
If Param<>1
Pop Proc
End If
End If
'
TIT$=ED$
_ALERTREQUESTER["Saving Records, Please Wait...||",""]
'
Screen 7
_DRAW3DBOX[55,45,584,55,"",0,0,_BACK]
'
Open Out 1,ED$
'
Print #1,"DM20 "
Print #1,DT$
Print #1,F1$+Chr$(255)+F2$+Chr$(255)+F3$+Chr$(255)+F4$
Print #1,Str$(FL1)+","+Str$(FL2)+","+Str$(FL3)+","+Str$(FL4)+","+Str$(NOR)
'
For LOP=1 To NOR
_CUTFIELDS[LOP]
Print #1,Left$(R1$,FL1)+Chr$(255)+Left$(R2$,FL2)+Chr$(255)+Left$(R3$,FL3)+Chr$(255)+Left$(R4$,FL4)
A1#=NOR
A2#=529
A3#=A2#/A1#
A4#=LOP
A5#=A3#*A4#
Cls _COLOUR,56,46 To 56+A5#,55
Next LOP
'
Close 1
_ALERTREQUESTER["_Cc_",""]
'
End Proc
'
Procedure _INSERTRECORD
'
Shared NOR,HINO,F$(),P
'
_ALERTREQUESTER["Choose Insert Option ?","HERE|AT END"]
If Param=0
Pop Proc
End If
'
Inc NOR
If P=0
P=1
End If
'
If Param=1
For LOP=NOR-1 To P Step -1
F$(LOP+1)=F$(LOP)
Next LOP
F$(P)=Chr$(255)+Chr$(255)+Chr$(255)
Else
F$(NOR)=Chr$(255)+Chr$(255)+Chr$(255)
End If
'
_DISPLAYRECORD
'
End Proc
'
Procedure _CLEARALL
'
Shared _TEXT,_BACK,F$()
Shared FL1,FL2,FL3,FL4,F1$,F2$,F3$,F4$,NOR,P,DT$,TIT$,HINO
'
_ALERTREQUESTER["Clear All Records & Fields, Sure ?","YES|NO"]
If Param<>1
Pop Proc
End If
'
F1$="FIELD 1"
F2$="FIELD 2"
F3$="FIELD 3"
F4$="FIELD 4"
FL1=60
FL2=60
FL3=60
FL4=60
DT$=""
P=0
NOR=0
TIT$=""
'
For LOP=1 To HINO
F$(LOP)=Chr$(255)+Chr$(255)+Chr$(255)
Next LOP
'
_CHANGEFIELD1[1]
_CHANGEFIELD2[1]
_CHANGEFIELD3[1]
_CHANGEFIELD4[1]
'
_DRAW3DBOX[468,117,620,131,DT$,2,_TEXT,_BACK]
_DISPLAYRECORD
'
End Proc
'
Procedure _MERGEFILE
'
Shared HINO,F$(),NOR,P,_BACK,_COLOUR
'
_FILEREQUESTER["Select Database File To Merge"]
ED$=Param$
'
If ED$=""
Pop Proc
End If
'
If Not Exist(ED$)
_ALERTREQUESTER["File Does Not Exist !","OOPS"]
Pop Proc
End If
'
TIT$=ED$
'
Open In 1,ED$
CHK$=Input$(1,9)
If Left$(CHK$,4)<>"DM20"
Close 1
_ALERTREQUESTER["Wrong File Format !","OOPS"]
Pop Proc
End If
'
Line Input #1,TD$
If Left$(CHK$,4)="DM20"
Line Input #1,TF1$
Else
Line Input #1,TF1$
Line Input #1,TF2$
Line Input #1,TF3$
Line Input #1,TF4$
End If
Input #1,TFL1
Input #1,TFL2
Input #1,TFL3
Input #1,TFL4
Input #1,TNO
'
If(NOR+TNO)>HINO
_ALERTREQUESTER["Not Enough Room For All Records, Continue ?","YES|NO"]
If Param<>1
Close 1
Pop Proc
End If
TNO=HINO-NOR
End If
'
_ALERTREQUESTER["Merging Records, Please Wait...||",""]
'
Screen 7
_DRAW3DBOX[55,45,584,55,"",0,0,_BACK]
'
For LOP=(NOR+1) To(NOR+TNO)
Line Input #1,F$(LOP)
A1#=TNO
A2#=529
A3#=A2#/A1#
A4#=LOP-NOR
A5#=A3#*A4#
Cls _COLOUR,56,46 To 56+A5#,55
Next LOP
Close 1
_ALERTREQUESTER["_Cc_",""]
NOR=NOR+TNO
_DISPLAYRECORD
'
End Proc
'
Procedure _FINDRECORD
'
Shared _DIALOGBUTTON$,_LIGHT,_COLOUR,_TEXT,_BACK,NOR,P
Shared FL1,FL2,FL3,FL4,F1$,F2$,F3$,F4$,F$()
'
_ALERTREQUESTER["Select A Search Option ?","FIELD|GLOBAL"]
If Param=0
Pop Proc
End If
'
_TEMP1$=_DIALOGBUTTON$
_DIALOGBUTTON$=""
'
If Param=1
_OPENDIALOGSCREEN[7,52,102]
Get Palette 0
Scroll Off
'
_DRAW3DBOX[100,52-(8*6),539,64-(8*6),"ENTER SEARCH STRINGS",1,_LIGHT,_COLOUR]
'
_DRAW3DBOX[12,69-(8*6),116,83-(8*6),F1$,1,_TEXT,_BACK]
_DRAW3DBOX[12,85-(8*6),116,99-(8*6),F2$,1,_TEXT,_BACK]
'
_ADDINPUTBUTTON[16,3,"",15,FL1,-4]
_ADDINPUTBUTTON[16,5,"",15,FL2,-5]
'
_DRAW3DBOX[260,69-(8*6),364,83-(8*6),F3$,1,_TEXT,_BACK]
_DRAW3DBOX[260,85-(8*6),364,99-(8*6),F4$,1,_TEXT,_BACK]
'
_ADDINPUTBUTTON[47,3,"",15,FL3,-6]
_ADDINPUTBUTTON[47,5,"",15,FL4,-7]
'
_ADDBUTTON[516,69-(8*6),628,83-(8*6),"Cancel",1]
_ADDBUTTON[516,85-(8*6),580,99-(8*6),"No Case",2]
_ADDBUTTON[588,85-(8*6),628,99-(8*6),"O.K",3]
'
TEMP1$=""
TEMP2$=""
TEMP3$=""
TEMP4$=""
'
Do
'
_CHECKBUTTONS
_BUTTONZONE=Param
'
If _BUTTONZONE=4
_ADDINPUTBUTTON[16,3,TEMP1$,15,FL1,0]
TEMP1$=Param$
End If
'
If _BUTTONZONE=5
_ADDINPUTBUTTON[16,5,TEMP2$,15,FL2,0]
TEMP2$=Param$
End If
'
If _BUTTONZONE=6
_ADDINPUTBUTTON[47,3,TEMP3$,15,FL3,0]
TEMP3$=Param$
End If
'
If _BUTTONZONE=7
_ADDINPUTBUTTON[47,5,TEMP4$,15,FL4,0]
TEMP4$=Param$
End If
'
If _BUTTONZONE=1
Screen Close 7
Goto FIN
End If
'
If _BUTTONZONE=2
NC=1
Goto SRCH
End If
'
If _BUTTONZONE=3
NC=0
Goto SRCH
End If
'
Loop
'
'
SRCH:
'
_ALERTREQUESTER["Start Searching From Where ?","START|HERE"]
If Param=0
Goto FIN
End If
'
If Param=1
STA=1
Else
STA=P
End If
'
_ALERTREQUESTER["Searching, Please Wait...",""]
'
If NC=1
TEMP1$=Upper$(TEMP1$)
TEMP2$=Upper$(TEMP2$)
TEMP3$=Upper$(TEMP3$)
TEMP4$=Upper$(TEMP4$)
End If
'
For LOP=STA To NOR
'
_CUTFIELDS[LOP]
'
If NC=1
R1$=Upper$(R1$)
R2$=Upper$(R2$)
R3$=Upper$(R3$)
R4$=Upper$(R4$)
End If
'
If(Left$(R1$,Len(TEMP1$))=TEMP1$) and(Left$(R2$,Len(TEMP2$))=TEMP2$) and(Left$(R3$,Len(TEMP3$))=TEMP3$) and(Left$(R4$,Len(TEMP4$))=TEMP4$)
P=LOP
_DISPLAYRECORD
_ALERTREQUESTER["Continue Searching ?","YES|NO"]
If Param<>1
Goto FIN
Else
_ALERTREQUESTER["Searching, Please Wait...",""]
End If
End If
Next LOP
'
_ALERTREQUESTER["No Matching Record Found !","DAMN"]
Goto FIN
End If
'
'
If Param=2
'
_OPENDIALOGSCREEN[7,52,102]
Get Palette 0
'
_DRAW3DBOX[100,4,539,16,"ENTER SEARCH STRING",1,_LIGHT,_COLOUR]
'
_ADDINPUTBUTTON[2,4,"",60,60,-1]
_ADDBUTTON[516,21,628,35,"Cancel",2]
_ADDBUTTON[516,37,580,51,"No Case",3]
_ADDBUTTON[588,37,628,51,"O.K",4]
TEMP$=""
'
Do
'
_CHECKBUTTONS
_BUTTONZONE=Param
'
If _BUTTONZONE=1
_ADDINPUTBUTTON[2,4,TEMP$,60,60,0]
TEMP$=Param$
End If
'
If _BUTTONZONE=2
Screen Close 7
Goto FIN
End If
'
If _BUTTONZONE=3
NC=1
Goto SRCH2
End If
'
If _BUTTONZONE=4
NC=0
Goto SRCH2
End If
'
Loop
'
'
SRCH2:
'
_ALERTREQUESTER["Start Searching From Where ?","START|HERE"]
If Param=0
Goto FIN
End If
'
If Param=1
STA=1
Else
STA=P
End If
'
_ALERTREQUESTER["Searching, Please Wait...",""]
'
If NC=1
TEMP$=Upper$(TEMP$)
End If
'
For Z=STA To NOR
'
If NC=1
FF$=Upper$(F$(Z))
Else
FF$=F$(Z)
End If
If Len(FF$)<Len(TEMP$)
Goto FIN6
End If
'
For LOP=1 To Len(FF$)-Len(TEMP$)
If Mid$(FF$,LOP,Len(TEMP$))=TEMP$
P=Z
_DISPLAYRECORD
_ALERTREQUESTER["Continue Searching ?","YES|NO"]
If Param<>1
Goto FIN
Else
_ALERTREQUESTER["Searching, Please Wait...",""]
Goto FIN6
End If
End If
Next LOP
'
FIN6:
Next Z
_ALERTREQUESTER["No Matching Record Found !","DAMN"]
End If
'
FIN:
_DIALOGBUTTON$=_TEMP1$
Scroll On
'
End Proc
'
Procedure _PRINTRECORDS
'
Shared FL1,FL2,FL3,FL4,NOR,F1$,F2$,F3$,F4$,DAT$,P
Shared _TEXT,_COLOUR,_LIGHT,_BACK,_DIALOGBUTTON$,F$()
'
_ALERTREQUESTER["Choose Print Option ?","ALL|FROM-TO|SEARCH"]
If Param=0
Pop Proc
End If
'
TEMP9$=_DIALOGBUTTON$
_DIALOGBUTTON$=""
'
If Param=1
STA=1
FIN=NOR
Goto PR1
End If
'
If Param=2
'
_INPUTREQUESTER["Enter Record Number To Start Printing From ?","",4,4]
TEMP=Val(Param$)
If TEMP<1 or TEMP>NOR
Goto FIN
End If
STA=TEMP
'
_INPUTREQUESTER["Enter Record Number To Finish Printing At ?","",4,4]
TEMP=Val(Param$)
If TEMP<1 or TEMP>NOR
Goto FIN
End If
FIN=TEMP
Goto PR1
End If
'
If Param=3
'
_OPENDIALOGSCREEN[7,52,102]
Get Palette 0
Scroll Off
'
_DRAW3DBOX[100,52-(8*6),539,64-(8*6),"ENTER SEARCH STRINGS TO PRINT",1,_LIGHT,_COLOUR]
'
_DRAW3DBOX[12,69-(8*6),116,83-(8*6),F1$,1,_TEXT,_BACK]
_DRAW3DBOX[12,85-(8*6),116,99-(8*6),F2$,1,_TEXT,_BACK]
'
_ADDINPUTBUTTON[16,3,"",15,FL1,-4]
_ADDINPUTBUTTON[16,5,"",15,FL2,-5]
'
_DRAW3DBOX[260,69-(8*6),364,83-(8*6),F3$,1,_TEXT,_BACK]
_DRAW3DBOX[260,85-(8*6),364,99-(8*6),F4$,1,_TEXT,_BACK]
'
_ADDINPUTBUTTON[47,3,"",15,FL3,-6]
_ADDINPUTBUTTON[47,5,"",15,FL4,-7]
'
_ADDBUTTON[516,69-(8*6),628,83-(8*6),"Cancel",1]
_ADDBUTTON[516,85-(8*6),580,99-(8*6),"No Case",2]
_ADDBUTTON[588,85-(8*6),628,99-(8*6),"O.K",3]
'
TEMP1$=""
TEMP2$=""
TEMP3$=""
TEMP4$=""
'
Do
'
_CHECKBUTTONS
_BUTTONZONE=Param
'
If _BUTTONZONE=4
_ADDINPUTBUTTON[16,3,TEMP1$,15,FL1,0]
TEMP1$=Param$
End If
'
If _BUTTONZONE=5
_ADDINPUTBUTTON[16,5,TEMP2$,15,FL2,0]
TEMP2$=Param$
End If
'
If _BUTTONZONE=6
_ADDINPUTBUTTON[47,3,TEMP3$,15,FL3,0]
TEMP3$=Param$
End If
'
If _BUTTONZONE=7
_ADDINPUTBUTTON[47,5,TEMP4$,15,FL4,0]
TEMP4$=Param$
End If
'
If _BUTTONZONE=1
Screen Close 7
Goto FIN
End If
'
If _BUTTONZONE=2
NC=1
Goto PRT3
End If
'
If _BUTTONZONE=3
NC=0
Goto PRT3
End If
'
Loop
'
PRT3:
'
_ALERTREQUESTER["Start Printing From Where ?","START|HERE"]
If Param=0
Goto FIN
End If
'
If Param=1
STA=1
Else
STA=P
End If
'
PG=1
Lprint "*** PAGE"+Str$(PG)+" *** "+DT$
Lprint
LIN=1
_ALERTREQUESTER["Searching & Printing, Please Wait... (SPACE Exits)",""]
If NC=1
TEMP1$=Upper$(TEMP1$)
TEMP2$=Upper$(TEMP2$)
TEMP3$=Upper$(TEMP3$)
TEMP4$=Upper$(TEMP4$)
End If
FOUND=0
For LOP=STA To NOR
If Inkey$=" "
Lprint Chr$(12)
_ALERTREQUESTER["_Cc_",""]
Goto FIN
End If
_CUTFIELDS[LOP]
If NC=1
RR1$=R1$
R1$=Upper$(R1$)
RR2$=R2$
R2$=Upper$(R2$)
RR3$=R3$
R3$=Upper$(R3$)
RR4$=R4$
R4$=Upper$(R4$)
End If
If(Left$(R1$,Len(TEMP1$))=TEMP1$) and(Left$(R2$,Len(TEMP2$))=TEMP2$) and(Left$(R3$,Len(TEMP3$))=TEMP3$) and(Left$(R4$,Len(TEMP4$))=TEMP4$)
FOUND=1
TTT=2
If FL1
TMP$=Space$(18)+": "
Mid$(TMP$,1,4)=Str$(LOP)-" "
Mid$(TMP$,6,12)=F1$
Lprint TMP$+RR1$
Inc TTT
End If
If FL2
TMP$=Space$(18)+": "
Mid$(TMP$,6,12)=F2$
Lprint TMP$+RR2$
Inc TTT
End If
If FL3
TMP$=Space$(18)+": "
Mid$(TMP$,6,12)=F3$
Lprint TMP$+RR3$
Inc TTT
End If
If FL4
TMP$=Space$(18)+": "
Mid$(TMP$,6,12)=F4$
Lprint TMP$+RR4$
Inc TTT
End If
Lprint
LIN=LIN+TTT
If LIN>=60
Inc PG
Lprint Chr$(12)
Lprint "*** PAGE"+Str$(PG)+" *** "+DT$
Lprint
LIN=1
End If
End If
Next LOP
_ALERTREQUESTER["_Cc_",""]
Lprint Chr$(12)
If FOUND=0
_ALERTREQUESTER["No Matching Records Found !","DAMN"]
End If
Goto FIN
End If
'
PR1:
_ALERTREQUESTER["Printing Records, Please Wait... (SPACE Quits)",""]
PG=1
Z=STA
3
Lprint "*** PAGE"+Str$(PG)+" *** "+DT$
Lprint
LIN=1
'
While LIN<60
If Inkey$=" "
Lprint Chr$(12)
_ALERTREQUESTER["_Cc_",""]
Goto FIN
End If
TTT=2
_CUTFIELDS[Z]
If FL1
TMP$=Space$(18)+": "
Mid$(TMP$,1,4)=Str$(Z)-" "
Mid$(TMP$,6,12)=F1$
Lprint TMP$+R1$
Inc TTT
End If
If FL2
TMP$=Space$(18)+": "
Mid$(TMP$,6,12)=F2$
Lprint TMP$+R2$
Inc TTT
End If
If FL3
TMP$=Space$(18)+": "
Mid$(TMP$,6,12)=F3$
Lprint TMP$+R3$
Inc TTT
End If
If FL4
TMP$=Space$(18)+": "
Mid$(TMP$,6,12)=F4$
Lprint TMP$+R4$
Inc TTT
End If
Lprint
LIN=LIN+TTT
Inc Z
If Z=FIN+1
Goto 7
End If
Wend
Inc PG
Lprint Chr$(12)
Goto 3
7
Lprint Chr$(12)
_ALERTREQUESTER["_Cc_",""]
'
FIN:
_DIALOGBUTTON$=TEMP9$
'
End Proc
'
'
ER1:
Resume ER2
ER2:
_ALERTREQUESTER["An Error Has Occured !","AARRGH!"]
Goto OK