home *** CD-ROM | disk | FTP | other *** search
- Program RkpDemo;
-
- {
- This is a demonstration program using rkPlus.
- It uses 2 registration levels (0 and 1).
- If a Level 1 key has expired, it will be treated as Level 0.
- If a Level 0 key has expired, it will be treated as Unregistered.
- This is a very simple program that doesn't actually do anything, but it
- should demonstrate some of what can be done with rkPlus.
- }
-
-
- Uses
- Crt, Dos, RkPlus;
-
-
- Const
- RkpDemoVer = '3.4';
- MonthNames : Array[1..12] of String[3]
- = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
-
-
- Var
- kc : Char;
-
-
- Procedure BadRegBeep;
-
- Begin
- Sound(1200);
- Delay(200);
- Sound(600);
- Delay(200);
- Sound(1200);
- Delay(200);
- Sound(600);
- Delay(200);
- NoSound;
- End;
-
-
- Procedure NotRegBeep;
-
- Begin
- Sound(600);
- Delay(200);
- Sound(1200);
- Delay(200);
- NoSound;
- End;
-
-
- Procedure DoView;
-
- Begin
- WriteLn('Sample data :');
- WriteLn;
- WriteLn('4.465536 7.918270 0.118373 5.367233');
- WriteLn('1.396349 4.868343 7.079323 4.783021');
- WriteLn('3.947924 8.864673 8.846264 2.999999');
- WriteLn('8.490832 6.874378 5.338329 3.729270');
- WriteLn('6.839882 8.873478 6.750373 7.018948');
- WriteLn('5.034784 3.003763 3.253290 4.892387');
- WriteLn('3.874378 8.314159 9.880869 3.987842');
- WriteLn('2.764947 9.265358 4.013002 9.903278');
- End;
-
-
- Procedure DoCalc;
-
- Begin
- If (Reg.Status = Registered) then Begin
- Write('The calculated result is ');
- WriteLn(4.465536+7.918270+0.118373+5.367233+1.396349+4.868343+7.079323+4.783021
- +3.947924+8.864673+8.846264+2.999999+8.490832+6.874378+5.338329+3.729270
- +6.839882+8.873478+6.750373+7.018948+5.034784+3.003763+3.253290+4.892387
- +3.874378+8.314159+9.880869+3.987842+2.764947+9.265358+4.013002+9.903278);
- End Else
- WriteLn('Only available in registered version!');
- End;
-
-
- Procedure DoTest;
-
- Begin
- If (Reg.Status = Registered) then Begin
- If (Reg.Level > 0) then Begin
- Write('Performing tests...');
- Delay(300);
- WriteLn;
- WriteLn('All tests passed.');
- End Else
- WriteLn('Not available in demo version!');
- End Else
- WriteLn('Only available in registered version!');
- End;
-
-
- Begin
- If BadSystemDate then Begin
- WriteLn('You must correctly set your system clock to run RkpDemo!');
- BadRegBeep;
- Halt(1);
- End;
- OwnerCode := 'ArgleBarbWotsLeeb';
- ProgramCode := 'RkpDemo Three';
- KeyFile := 'RKPDEMO';
- GetRegInfo;
- Write('RkpDemo ' + RkpDemoVer);
- If (Reg.Status in [InvalidKey, FileError, InvalidFile]) then
- WriteLn(' [invalid]')
- Else If (Reg.Status = Registered) and (Reg.Level > 0) then
- WriteLn(' [registered]')
- Else If (Reg.Status = Registered) then
- WriteLn(' [demo]')
- Else
- WriteLn(' [unregistered]');
- WriteLn('(c) 1991 TrendSoft, Inc.');
- WriteLn;
- If (Reg.Status in [InvalidKey, FileError, InvalidFile]) then Begin
- WriteLn(Reg.KeyPath+' has been altered!');
- WriteLn('Please contact TrendSoft, Inc. to obtain a valid key file.');
- BadRegBeep;
- Halt(1);
- End Else If (Reg.Status = ExpiredKey) then Begin
- If (Reg.Level > 0) then Begin
- WriteLn('Your registration key has expired!');
- WriteLn('You will be given access at the DEMO level.');
- WriteLn('Contact TrendSoft, Inc. to renew your registration.');
- NotRegBeep;
- Reg.Level := 0;
- End Else Begin
- WriteLn('Your limited use demo key has expired!');
- WriteLn('You will be given access at the UNREGISTERED level.');
- WriteLn('Contact TrendSoft, Inc. to register.');
- NotRegBeep;
- Reg.Status := NotRegistered;
- End;
- End Else If (Reg.Status = Registered) then Begin
- If (Reg.Level > 0) then Begin
- WriteLn('This version of RkpDemo is registered to '+Reg.Name1);
- If (Reg.ExpYear <> 0) and (Reg.ExpMonth <> 0) then
- WriteLn('This registration will expire ','1-',MonthNames[Reg.ExpMonth],'-',Reg.ExpYear,'.');
- WriteLn('Thank you for registering!');
- End Else Begin
- WriteLn('This version of RkpDemo is a limited use demo for '+Reg.Name1);
- If (Reg.ExpYear <> 0) and (Reg.ExpMonth <> 0) then
- WriteLn('This limited use demo will expire ','1-',MonthNames[Reg.ExpMonth],'-',Reg.ExpYear,'.');
- WriteLn('Don''t forget to register!');
- End;
- End Else Begin
- WriteLn('This version of RkpDemo is unregistered.');
- WriteLn('Contact TrendSoft, Inc. to register or obtain a limited use demo key.');
- NotRegBeep;
- Delay(500);
- End;
- WriteLn;
- WriteLn('RkpDemo ' + RkpDemoVer + ' Menu');
- WriteLn;
- WriteLn('[V]iew sample data');
- Write('[C]alculate');
- If (Reg.Status <> Registered) then
- WriteLn(' (only available in registered version)')
- Else
- WriteLn;
- Write('[T]est results');
- If (Reg.Status < Registered) then
- WriteLn(' (only available in registered version)')
- Else If (Reg.Level <= 0) then
- WriteLn(' (not available in demo version)')
- Else
- WriteLn;
- WriteLn;
- Write('Selection : ');
- kc := UpCase(ReadKey);
- WriteLn;
- WriteLn;
- Case kc of
- 'V' :
- DoView;
- 'C' :
- DoCalc;
- 'T' :
- DoTest;
- Else
- WriteLn('Invalid selection!');
- End;
- End.