home *** CD-ROM | disk | FTP | other *** search
- PROGRAM RkSample;
-
- {
- This is a sample program using rKey. It does not use registration levels.
- This is a very simple program that doesn't actually do anything, but it
- should demonstrate some of what can be done with rKey.
- }
-
-
- USES
- Crt, rKey; { to use StrLib change rKey to rKeyS }
-
-
- CONST
- RkSampleVer = '2.4';
-
-
- 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 RegStatus 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('Not available in evaluation version!');
- END;
-
-
- PROCEDURE DoTest;
-
- BEGIN
- IF RegStatus THEN BEGIN
- Write('Performing tests...');
- Delay(300);
- WriteLn;
- WriteLn('All tests passed.');
- END ELSE
- WriteLn('Not available in evaluation version!');
- END;
-
-
- BEGIN
- OwnerCode := 'ArgleBarbWotsLeeb';
- ProgramCode := 'RkSample Two';
- KeyFileName := 'RKSAMPLE';
- GetRegInfo;
- Write('RkSample v' + RkSampleVer);
- IF RegError THEN
- WriteLn(' [invalid]')
- ELSE IF RegStatus THEN
- WriteLn(' [registered]')
- ELSE
- WriteLn(' [evaluation]');
- WriteLn('(c) 1990 TrendSoft, Inc.');
- WriteLn;
- IF RegError THEN BEGIN
- WriteLn(KeyFilePath+' has been altered!');
- WriteLn('Please contact TrendSoft, Inc. to obtain a valid key file.');
- BadRegBeep;
- Halt(1);
- END ELSE IF RegStatus THEN BEGIN
- WriteLn('This version of RkSample is registered to '+RegName);
- WriteLn('Thank you for registering!');
- END ELSE BEGIN
- WriteLn('This version of RkSample is a limited evaluation copy.');
- WriteLn('Contact TrendSoft, Inc. for information on obtaining a registered version.');
- NotRegBeep;
- Delay(500);
- END;
- WriteLn;
- Write('RkSample v' + RkSampleVer);
- IF NOT RegStatus THEN
- Write(' Evaluation');
- WriteLn(' Menu');
- WriteLn;
- WriteLn('[V]iew sample data');
- Write('[C]alculate');
- IF NOT RegStatus THEN
- WriteLn(' (not available in evaluation version)')
- ELSE
- WriteLn;
- Write('[T]est results');
- IF NOT RegStatus THEN
- WriteLn(' (not available in evaluation 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.