The SetApwNumber function

Make sure that the apw.pas file is showing in the Delphi code editor.

After the line declaring the GetApwNumber function add the SetApwNumber declaration.

function SetApwNumber( variable : Pchar ; value : LongInt ; wnd : hWnd ) : Boolean;

The SetApwNumber looks like this. Add it after the GetApwNumber function.

function SetApwNumber( variable : Pchar ; value : LongInt ; wnd : hWnd ) : Boolean;
var
   varPB : APWC_VARPB;
   err: LongInt;
begin
   result := false;
   varPB.var_name := variable;
   varPB.at_icon_name := nil;
   varPB.at_icon_id := 0;
   varPB.flags := SV_DONTCREATE;
   varPB.eval.ev_type := APW_LONG_TYPE;
   varPB.eval.long_value := value;
   err := SendMessage( wnd , APWC_SETVAR , 0 , LongInt( @varpb ) );
   if err = EXPR_OK then result := true;
end;

This is quite similar to the GetApwNumber function.

On to: Setting a variable value

Back to: Testing the Add function      Start