Error handling Log Out | Topics | Search
Moderators | Edit Profile

WAK Productions Support » TRegware » Error handling « Previous Next »

Author Message
Oliver Bock
Posted on Tuesday, November 16, 2004 - 6:02 pm:   

Regware sometimes ignores programmer errors rather than reporting them. This makes it hard to work out what you are doing wrong. I suggest the following changes:

1. Change line 134 of regware4gen.pl to:
 
length($UserID) <= 108 or die "UserID too long: maximum 108 characters";
length($UserID) >= 5 or die "UserID too short: minimum 5 characters";


2. In regware_example.pl, change the getopts bit to:
 
getopts('s:');
defined($opt_s) or die "usage: $0 -s LicenseID\n";
(You were trying to check this, but the check was wrong.)


3. In reggen4.pas, change line 91 to:
 
if Length(LicenseID) > FMaxChars then
raise Exception.Create('LicenseID is too long: maximum '+IntToStr(FMaxChars)+' characters');
if Length(LicenseID) < FMinChars then
raise Exception.Create('LicenseID is too short: minimum '+IntToStr(FMinChars)+' characters');


4. In demo1main.pas, line 114, change whole procedure to:
 
try
RegCodeGenBox.Text := GenerateCode;
except on e: Exception do
RegCodeGenBox.Text := e.Message;
end;
(If you do not use this, please fix the bug in the old version of this procedure, which uses <and> where it should use <=>=.)

5. In demo1main.pas, TMainForm.GenerateProgInfoFrameProgNameComboChange , call DisplayCode instead of duplicating its contents.

(Personally I would prefer it if Regware padded too short license IDs to avoid the minimum error ever occurring, but I can see that this would not suit everybody.)
Winston Kotzan (Wak)
Posted on Tuesday, November 16, 2004 - 6:25 pm:   

Thank you for the suggestions! I'm not sure if the changes will be implemented or how soon. But the good news is that your contributions help other programmers who are reading these message boards.

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration