Is there a way to generate a .pas file with constants for the commands and command parameters from a daschema (similar to what happens for the tables and table fields.
I see this data is missing in the DASchemaClient_Intf file
It would be useful to be able to execute the commands from the client.
An even better solution would be if code was generated that executes the command
My daschema is hosted in a .NET RO server.
My client is delphi code
function Execute(aCommandName: string): Integer; overload;
function Execute(aCommandName: string; aInputParameters: DataParameterArray): Integer; overload;
function Execute(aCommandName: string; aInputParameters: DataParameterArray; out aOutputParameters: DataParameterArray): Integer; overload;
function Execute(aCommandName: string; aParamNames: array of string; aParamValues: array of Variant): Integer; overload;
function Execute(aCommandName: string; aParamValues: array of Variant): Integer; overload;
I don’t think that it needs strongly-typed file for commands.
Hello Evgeny,
I am using the bottom format with output parameters.
My question is a bit different:
I don’t like using string literals ‘mycommand1’.
I prefer using constant identifiers generated by a RO tool (similar to nme_XXX for DA schema names)
Is that possible.
The code to call a command is indeed simple, I was only hinting that RO could generate these simple functions (with all the input and output parameters and an extra TRORemoteService parameter)
FYI: My calling code below
procedure addDataParameter(dpa:DataParameterArray;const name:string;value:variant);
var
dp:DataParameter;
begin
dp:=dpa.Add();
dp.Name:=name;
dp.Value:=value;
end;
function Execute(aCommandName: string; aParamNames: array of string; aParamValues: array of Variant; out aOutputParameters: DataParameterArray): Integer; overload;
function Execute(aCommandName: string; aParamValues: array of Variant; out aOutputParameters: DataParameterArray): Integer; overload;