Re: Fastcode Template B&V's



Dennis wrote:
>
> No protection against the problem with releasing to different
> functions with the same name.

How does 'the other system' protect against this?

> The library manager sees no reason to update the function in the
> library from Function1 to Function1, because functions with the
> same ID are the same ?

Release date of function1?

> In short: The rule of strong function ID is not enforced and this
> will lead to a reduction of quality.

I took a look into the B&V source, and it seems the following change may
help. It will show a message box about the problem, and not add the function
to the function list.

(FastcodeChallengeUnit.pas, line 117, 118)

uses
UtilsUnit, Windows, Dialogs;

(FastcodeChallengeUnit.pas, line 237-)

function TFastcodeChallenge.RegisterFunction(const FunctionData:
TFastcodeChallengeFunction): PFastcodeChallengeFunction;
var
i: Integer;
begin
// -- Added check for duplicates
for i := 0 to Pred(FFunctionList.Count) do
begin
if CompareText(PFastcodeChallengeFunction(FFunctionList[i]).Name,
FunctionData.Name) = 0 then
begin
ShowMessage('Duplicate function name: ' + FunctionData.Name +
#13#10 + 'Not added to function list!');
Exit;
end;
if (PFastcodeChallengeFunction(FFunctionList[i]).Addr =
FunctionData.Addr) then
begin
ShowMessage('The same function is used under different names: ' +
#13#10 +
FunctionData.Name + #13#10 +
PFastcodeChallengeFunction(FFunctionList[i]).Name +
#13#10 + 'Not added to function list!');
Exit;
end;
end;
// --- end of added code
New(Result);
try
Result^ := FunctionData;
FFunctionList.Add(Result);
except
Dispose(Result);
raise;
end;
end;

--
Anders Isaksson, Sweden
BlockCAD: http://web.telia.com/~u16122508/proglego.htm
Gallery: http://web.telia.com/~u16122508/gallery/index.htm


.



Relevant Pages

  • Re: Unprotect and Protect template when user enters a Formfield
    ... I know the Exit Macro doesn't work. ... the formfield description so the template is protected again. ... "Charles Kenyon" schreef: ... when he goes to the next formfield the protection should be ...
    (microsoft.public.word.vba.general)
  • Re: Unprotect and Protect template when user enters a Formfield
    ... what is the point of protection if you are going to unprotect ... I know the Exit Macro doesn't work. ... the formfield description so the template is protected again. ...
    (microsoft.public.word.vba.general)
  • Re: Unprotect and Protect template when user enters a Formfield
    ... An onexit macro is activated when the user leaves a formfield in a protected ... when he goes to the next formfield the protection should be ... Marco on Entry and Exit) ...
    (microsoft.public.word.vba.general)
  • Re: dropdown box in form
    ... I ran it on exit from the Dropdown1 formfield. ... >macro to the keyboard or to a toolbar button, ... enabled when protection ... >> answered on a paid ...
    (microsoft.public.word.vba.userforms)