KludgeCode

is Ben Rudgers

Remarks on the Extrude Demo

A first attempt at writing a limited demo – in order to force the user to buy my wonderful utility. Writing the demo wrapper was the bulk of the effort:


PROCEDURE super;

   VAR
    index : integer;
    handleBin:ARRAY[1..1000] of HANDLE;
    Obj_class : string;
    Start_class : string;

Procedure Democode;

var
    strTime : string;
    strTest : string;
    intTest : integer;
    intLen : integer;
    status : boolean; {for openURL call}
Begin
    strTime := Date (2,2);
    intLen := Len (strTime);

    {Check for Time ends 40-49 seconds and run popup if it is}
    strTest := copy (strTime, (intLen - 4), 1);
    If str2num (strTest) = 4 Then
    AlrtDialog ('Demo Version:  Purchase Full Version at KludgeCode.com');

    {Check for Time ends with 4 minutes and open URL if it is}
    strTest := copy (strTime, (intLen - 5), 1);
    If str2num (strTest) = 4 Then
    status := OpenURL ('http://www.kludgecode.com');

  End;

Procedure loadBin(h1:HANDLE);
   Begin
      index:=index+1;
      handleBin[index]:=h1;
   End;

PROCEDURE change_it(objectHand:HANDLE);
   Begin
        dselectall;
        obj_class := getclass (objectHand);
        Nameclass (obj_class);
        setselect (objectHand);
        domenutextbyname ('extrude and edit', 0);
    End;      

BEGIN
       Start_class := ActiveClass;  
    index:=0;
         ForEachObject(loadBin,sel=true);
         index:=1;
         while handleBin[index] <> nil Do begin    
            change_it (handleBin[index]);
            index := index+1;
            DEMOCODE;
        end;
    Nameclass (Start_class);
     End;
Run (super);