HANDLE_PROMPT Function

RAMP-NL

HANDLE_PROMPT Function


Causes an associated prompter form (VL Handler) to appear next to a field. The fields and the prompter forms are specified in the Special Field Handling area as described in Advanced Prompting.

Optionally additional information can be passed to or retrieved from the prompter form.

Syntax

HANDLE_PROMPT(sArgument1 [, sArgument2] [, sArgument3]...)

Parameters

SArgumentn

Optional. String that contains any value the user defined prompter may require. Note that by default the user defined prompter has bi-directional access to all named fields in the 5250 screen.

Return Value

None

Example

 

if ( HANDLE_PROMPT() ) return;

 

 

Accessing the values passed as sArgument1, sArgument2, etc., in the prompter form

A function like this in a RAMP script:

HANDLE_PROMPT("HELLO","THERE",123);

  

Is accessed like this in the prompter form:

Invoke Method(#Com_Owner.uGet5250Field) Name(UARG1) Value(#Arg1Value) ... returns "HELLO" in #Arg1Value.

Invoke Method(#Com_Owner.uGet5250Field) Name(UARG2) Value(#Arg2Value) ... returna "THERE" in #Arg2Value.

Invoke Method(#Com_Owner.uGet5250Field) Name(UARG3) Value(#Arg3Value) ... returns "123" as a string in #Arg3Value.

 

There is no limit on how many arguments you can pass.

Numeric values can be passed, but they will turn up as strings in the VL component, so they need to be converted back to a number again.

Referencing an un-passed argument does not cause a problem. This code:

#Arg15Value := "TEST"

Invoke Method(#Com_Owner.uGet5250Field) Name(UARG15) Value(#Arg15Value)

 

Would execute and leave #ARG15Value unchanged as "TEST", but you can actually tell whether the value was passed by doing this:

Invoke Method(#Com_Owner.uGet5250Field) Name(UARG15) Value(#Arg15Value) Found(#Found)

If (#Found = TRUE) /* 15th argument was passed to HANDLE_PROMPT */

Else                      /* 15th argument was not passed)

 

As an example, you can use the additional arguments in a HANDLE_PROMPT function if you need access to values which are not on the screen from which the prompter form is invoked. 

For instance, this could be used in a situation where customer information is entered on the first screen and an invoice number is prompted for on the second screen.  If this invoice number is dependent on the customer information initially entered on the first screen and the information is not available to you on the second screen, you could store the required customer information in an objGlobal variable and pass it as HANDLE_PROMPT() parameters for proper select criteria in the prompter form code.