When managing the user data entry for the ClientParms Client interaction method, the MacroParms class acts to manage the displayed parameters as well as the returned data entered by the client.
In the ServerMacro class, there is a class-level member pre-defined named "parms" which is initialized to null. For the simplest implementation, prior to calling the ClientParms method, the parms member can be set to a new MacroParms class object. This is then used both to present the dialog to the user as well as utilize the returned data.
public MacroParms(string title, string fieldSetLegend [, MacroParm[] parms])
Parameter |
Type |
Description |
---|---|---|
title |
Required String |
Title to display at the top of the dialog |
fieldSetLegend |
Required String |
Header that is part of the field set group containing the labels and input elements |
parms |
optional MacroParm array |
Array defining the individual parameters, default=null. If omitted, use the indexer on the MacroParms object to add parameters one at a time (see example in MacroParm section) |
Parameter |
Type |
Description |
---|---|---|
title |
String |
Title to display at the top of the dialog |
fieldSetLegend |
String |
Header that is part of the field set group containing the labels and input elements |
this[name] |
MacroParm [string index] |
Individual MacroParm objects can be accessed using the name of the MacroParm as a string index |
public override MacroRunResult run()
{
OrderedDictionary options = new OrderedDictionary();
options.Add("stop", "Stop after signing On to View Signon Message");
options.Add("go", "Complete all Initial Screens");
this.parms = new MacroParms("Logon Parameters", "Please Enter your UserID and Password",
new MacroParm[]
{
new MacroParm("UserID","uid","Simmy","Enter the UserID"),
new MacroParm("Password","pw",null,"Enter the Password-hint: host",FVInpEnum.password)
new MacroParm("Options","opt","stop",
"Select how far the logic runs",FVInpEnum.radioButtons,options),
new MacroParm("End Message","msg","false","Display Message at End", FVInpEnum.checkbox)
});
MacroDialogRC rc = this.ClientParms(MacroButtons.ok | MacroButtons.cancel, MacroMessageType.info);
if (rc == MacroDialogRC.ok)
{
this.oScreen.putCommand(parms["uid"].text+"[enter]", 2000);
this.oScreen.putCommand("2[enter]", 2000);
this.oScreen.putCommand(parms["uid"].text+"[tab]"+parms["pw"].text+"[enter]", 2000);
if (oScreen.getText(1,1,3)=="DFH")
{
this.oScreen.putCommand("[clear]", 1000);
this.oScreen.putCommand("info[enter]");
}
}
if (parms["msg"].text == "true")
this.ClientMessageBox("The Parameter-based Logon Server Macro has completed...", "Macro Completed");
return MacroRunResult.ok;
}