# question mark to invoke help routine

**URL:** <https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [February 21, 2007, 9:44am UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999 "2007-02-21T09:44:08Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![just\_natural](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@just\_natural](https://techcommunity.softwareag.com/u/just_natural)\
**Post date:** [February 21, 2007, 9:44am UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/1 "2007-02-21T09:44:08Z")

</div>

Hi  
I have an array in the map which when I put “?” in the field, I like to know the position of question mark in this array. so when I select the field from the help routine I like to go back and replace that position with new selected value.

---

<div class="post-metadata">

**Author:** ![Yehuda](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/yehuda/32/115_2.png) [@Yehuda](https://techcommunity.softwareag.com/u/Yehuda)\
**Post date:** [February 21, 2007, 4:04pm UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/2 "2007-02-21T16:04:58Z")

</div>

In the Define Data Parameter of the Helproutine, you can define another parameter following the definition of the help-field, in format I2, and that parameter will automatically contain the index of the array on which you placed the question mark.

DEFINE DATA PARAMETER  
1 HELP-FIELD (A10) /\* the field that triggered this helproutine  
1 ARRAY-INDEX (I2) /\* The index  
END-DEFINE

---

<div class="post-metadata">

**Author:** ![just\_natural](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@just\_natural](https://techcommunity.softwareag.com/u/just_natural)\
**Post date:** [February 22, 2007, 4:44am UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/3 "2007-02-22T04:44:14Z")

</div>

Hi  
Thank you for the help  
my help on the map is like this at the moment.

HE= ‘PAL530H’,#PDA-SELECTION-FIELD,  
#INPUT-CIDS-FLAG-MESSAGE(_),\_\_\_  
 #INCIDENT-DESC1(_)  
and helproutine is

DEFINE DATA

PARAMETER  
01 #PDA-SELECTION-FIELD (A1)  
01 #PDA-CIDS-FLAG-MESSAGE (A1/1:V)  
01 #INCIDENT-DESC (A40/1:V)

are you suggesting to add this field at the end. and where do I have to define it on the map?

---

<div class="post-metadata">

**Author:** ![Wilfried\_B](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wilfried_b/32/83_2.png) [@Wilfried\_B](https://techcommunity.softwareag.com/u/Wilfried_B)\
**Post date:** [February 22, 2007, 1:39pm UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/4 "2007-02-22T13:39:12Z")

</div>

RTFM!  
[url][http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat422mf/pg/pg\_obj\_help.htm#Array\_Indices[/url]](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat422mf/pg/pg_obj_help.htm#Array_Indices%5B/url%5D)  
It took me 1 minute to find the topic!

---

<div class="post-metadata">

**Author:** ![Yehuda](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/yehuda/32/115_2.png) [@Yehuda](https://techcommunity.softwareag.com/u/Yehuda)\
**Post date:** [February 22, 2007, 1:45pm UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/5 "2007-02-22T13:45:23Z")

</div>

Hi,

The field that contains what you wrote above “HE= ‘PAL530H’,#PDA-SELECTION-FIELD, #INPUT-CIDS-FLAG-MESSAGE(_),\_\_\_ #INCIDENT-DESC1(_)” should be defined in the helproutine as the LAST field in the define data parameter and therefore i conclude that it is missing in the above quote. You may pass up to 20 parameters to a help routine, the field that the helproutine is invoked from IS NOT written as a parameter in the map, as the index is also not written in the HE and does not have to be defined anywhere in the map. These two fields (the field itself and the index) are not specified as parameters in the “HE=” but have to be specified as the 2 last parametewrs in the define data parameter of the helproutine.

---

<div class="post-metadata">

**Author:** ![Earkkai](https://avatars.discourse-cdn.com/v4/letter/e/4bbf92/32.png) [@Earkkai](https://techcommunity.softwareag.com/u/Earkkai)\
**Post date:** [February 22, 2007, 8:40pm UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/6 "2007-02-22T20:40:48Z")

</div>

In the given example, ‘PAL530H’ is the help routine. I learn that helpmap name can be given here as well. Is that true? Is there any distinction in the syntax that is evident from the code generated by the mapo editor? i.e., to identify without using the map editor.

HE= ‘PAL530H’

---

<div class="post-metadata">

**Author:** ![just\_natural](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@just\_natural](https://techcommunity.softwareag.com/u/just_natural)\
**Post date:** [February 23, 2007, 6:55am UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/7 "2007-02-23T06:55:15Z")

</div>

I tried that  
and at the moment it is like this  
DEFINE DATA  
GLOBAL USING COP000G  
\*\*SAG DEFINE EXIT PARAMETER  
PARAMETER  
01 #PDA-SELECTION-FLAG (A1)  
01 #PDA-CIDS-FLAG-MESSAGE (A1/1:15)  
01 #INCIDENT-DESC (A40/1:15)  
01 #FINDEX1 (I2)  
\*

‘PAL530H’,#PDA-SELECTION-FIELD,#INPUT-CIDS-FLAG-MESSAGE(_),  
 #INCIDENT-DESC1(_)\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

and I get this  
A syntax/runtime error has occurred.  
Source line … 0088  
Error number … 0936

Press enter to call the map editor for error recovery

Format/length conflict in parameter 4 (Helproutine PAL530H/COPLIB/9/124).

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [February 24, 2007, 12:35am UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/8 "2007-02-24T00:35:04Z")

</div>

Here is a program, map, and helproutine that do what you want:

program first:

> ```
> > + Program HARR1 Lib XSTRO    
> 
> ```

All …+…1…+…2…+…3…+…4…+…5…+…6…+…7..  
0010 DEFINE DATA LOCAL  
0020 1 #DARRAY (A1/1:7)  
0030 INIT \<‘A’,‘B’,‘C’,‘D’,‘E’,‘F’,‘G’\>  
0040 END-DEFINE  
0050 \*  
0060 INPUT USING MAP ‘HARR2’ #DARRAY (\*)  
0070 END

Now the Helproutine:

> ```
> > + Helproutine HARR3 Lib XSTRO    
> 
> ```

All …+…1…+…2…+…3…+…4…+…5…+…6…+…7..  
0010 DEFINE DATA PARAMETER  
0020 1 #VALUE (A1)  
0030 1 #INDEX (I2)  
0040 END-DEFINE  
0050 \*  
0060 WRITE ‘IN HELPROUTINE, INDEX IS’ #INDEX  
0070 END

Now two screen snaps from within the Map; first the .a screen

## Name #DARRAY Top Dim 7\_\_\_\_\_\_\_\_\_\_ 1\_\_\_\_\_\_\_\_\_\_ 1\_\_\_\_\_\_\_\_\_\_

Dimensions Occurrences Starting from Spacing  
1 . Index vertical 7\_\_ 1\_\_\_\_\_\_\_\_\_\_ 0 Lines  
0 . Index horizontal 1\_\_ \_\_\_\_\_\_\_\_\_\_\_ 1 Columns  
0 . Index (h/v) V 1\_\_ \_\_\_\_\_\_\_\_\_\_\_ 0 Cls/Ls

001 --010—±—±—±–030—±—±—±–050—±—±—±–070—±—

```
                        .A                                                  
                        :X                                                  
                        :X                                                  
                        :X                                                  
                        :X                                                  
                        :X                                                  
                        :X                                                  

```

Enter-PF1—PF2—PF3—PF4—PF5—PF6—PF7—PF8—PF9—PF10–PF11–PF12—  
Help Mset Exit – - + \< \> Let

Now the .e screen

## Arr #DARRAY Fmt A1

AD= MILT\_\_\_\_\_\_ ZP= SG= HE= ‘HARR3’\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Rls 0  
AL= \_\_\_\_\_ CD= \_\_ CV= \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Mod Data  
PM= \_\_ DF= DY= \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
EM= \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ SB= \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

001 --010—±—±—±–030—±—±—±–050—±—±—±–070—±—

```
                        .E                                                  
                        :X                                                  
                        :X                                                  
                        :X                                                  
                        :X                                                  
                        :X                                                  
                        :X                                                  

```

Enter-PF1—PF2—PF3—PF4—PF5—PF6—PF7—PF8—PF9—PF10–PF11–PF12—  
HELP Mset Exit \<— —\> – - + \< \> Let

start from here and you should get it to work

steve

---

<div class="post-metadata">

**Author:** ![Wilfried\_B](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wilfried_b/32/83_2.png) [@Wilfried\_B](https://techcommunity.softwareag.com/u/Wilfried_B)\
**Post date:** [February 26, 2007, 2:23pm UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/9 "2007-02-26T14:23:48Z")

</div>

The problem with helproutines, I think, is the confusing documentation about explicit and implicit parameters. It reads:

> [@](#):
>
> A helproutine may have up to 20 explicit parameters and one implicit parameter. :!:

And some lines later, it states:

> [@](#):
>
> …its indices are supplied as implicit parameters (1 - 3 depending on rank, regardless of the explicit parameters) :?:

Now is the question: does a helproutine have one or up to three or even up to four parameters? And, what is the sequence of the parameters?

When I interpret the docs correctly, the parameters of a helproutine must be ordered in this manner:

```auto
DEFINE DATA PARAMETER
1 explicit-parm1 (format) /* list of up to 20 explicit parameters
...(20)
1 field-value (format) /* the value of the field where help was invoked for
/* if arrays are concerned:
1 index1 (I2) /* the index of the first dimension
1 index2 (I2) /* the index of the second dimension(if applicable)
1 index3 (I2) /* the index of the third dimension (if applicable)
```

A special explicit parameter is the field name. It must be of format (A65) (the maximum length a field name can have in Natural). To pass the field name as explicit parameter, you use the placeholder ‘=’ in the “HE”-parameter.  
  
If you want to have access to any of the implicit parameters within the helproutine, the prior parameters must be mentioned, too. Thus you have to specify a parameter for field-value, if you want to have access to any of the indexes, and you have to specify the whole list of implicit parameters, if you want to have access to the third index index3. But you do not have to mention any of the indexes, if you are only interested in the field value.

---

<div class="post-metadata">

**Author:** ![florian\_gaulier](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@florian\_gaulier](https://techcommunity.softwareag.com/u/florian_gaulier)\
**Post date:** [January 4, 2012, 9:52am UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/10 "2012-01-04T09:52:23Z")

</div>

Hello, i have a problem with help routine.  
I have an array with 2 fiels in my map and i have to pass those fields to the helproutine.  
It work with one field implicitly, but not with two fields.

I try to pass all fields explicitly  
but how passing the index explicitly ?

Thanks for your answer.  
Sorry for my english, i’m french.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [January 4, 2012, 10:05am UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/11 "2012-01-04T10:05:42Z")

</div>

Florian,

this is described in detail &nbsp;&nbsp;[here](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat427mf/pg/pg_obj_help.htm#Array_Indices)

Hth, best regards

&nbsp;&nbsp;&nbsp;Wolfgang

---

<div class="post-metadata">

**Author:** ![florian\_gaulier](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@florian\_gaulier](https://techcommunity.softwareag.com/u/florian_gaulier)\
**Post date:** [January 4, 2012, 11:57am UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/12 "2012-01-04T11:57:19Z")

</div>

my problem is that when I specify a field, the help routine no longer starts.  
I have to explicitly specify all the fields I think.  
how to send the index of the map to help routine?

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [January 4, 2012, 12:46pm UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/13 "2012-01-04T12:46:36Z")

</div>

Hi Florian;

I am not sure I understand the problem, so perhaps you could answer some questions:

1. Is your data structure like (a) or (b)

2. In your INPUT statement (or Map), do you have one or two helproutines? For example:

or

```
   INPUT ... #A (*) (HE='HELP'....) // #B (*) (HE='HELP'....) 

```

or, do you have a map level help, for example:

```
  INPUT (HE='ONEHELP', #A (*) #B(*)) ....

```

1. Do you want to distinguish both whether the user wanted help for #A or #B and which subscript, or do you just want to know which subscript?

2. Are you aware that data entered into the two arrays on the map will NOT be transferred to the helproutine unless you do some special programming?

Finally, could you provide more information about what you are trying to accomplish.

steve

---

<div class="post-metadata">

**Author:** ![florian\_gaulier](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@florian\_gaulier](https://techcommunity.softwareag.com/u/florian_gaulier)\
**Post date:** [January 4, 2012, 1:16pm UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/14 "2012-01-04T13:16:22Z")

</div>

1. 

fields are defined in the style b) 1 #A (A3/1:10)

1. 

I have a single help routine.  
It is defined in the fields of the map with the parameter HE.  
Helproutine must react on my two fields on the screen  
The field A gives the format.  
The field B is the value depending on the format. The routine is help on the field B.

1. see 2

2. my help routine will be used to fill the field B by helping the user.

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [January 5, 2012, 4:17pm UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/15 "2012-01-05T16:17:10Z")

</div>

Hi Florian;

I am posting a program, map and helproutine. Hopefully I have understood your problem so the solution matches it.

As I understand it, you have two arrays, one is for output (the format) and one is for input (values that have the format shown in the other array).

Here is the code:

First the program:

> ```
> > + Program HHARR1 Lib XSTRO    
> 
> ```

All …+…1…+…2…+…3…+…4…+…5…+…6…+…7..  
0010 DEFINE DATA LOCAL  
0020 1 #DARRAY (A1/1:7)  
0030 INIT \<‘A’,‘B’,‘C’,‘D’,‘E’,‘F’,‘G’\>  
X 0040 1 #UVALUE (A10/1:7)  
0050 1 #SEL (A10) /\* not really needed but you might have some use for it.  
0060 END-DEFINE  
0070 \*  
0080 INPUT USING MAP 'HHARR2 ’  
0090 #DARRAY(_) #UVALUE(_)  
0100 END

Now the helproutine:

> ```
> > + Helproutine HHARR3 Lib XSTRO    
> 
> ```

All …+…1…+…2…+…3…+…4…+…5…+…6…+…7..  
0010 DEFINE DATA PARAMETER  
0020 1 #DARRAY (A1/1:7)  
0030 1 #UVARRAY (A10/1:7)  
0040 1 #VALUE (A10)  
0050 1 #INDEX (I2)  
0060 END-DEFINE  
0070 \*  
0080 INPUT ‘IN HELPROUTINE, INDEX IS’ #INDEX (AD=O)  
0090 // 'FORMAT FOR #DARRAY (#INDEX) IS ’ #DARRAY (#INDEX) (AD=O)  
0100 // ‘INSERT VALUE FOR #UVARRAY (#INDEX) ==\>’ #UVARRAY (#INDEX)  
0110 \*  
0120 \* INSERT VALIDATION CODE FOR ENTERED VALUE  
0130 \*  
0140 MOVE #UVARRAY (#INDEX) TO #VALUE  
0150 \*  
0160 END

I am assuming that if the user puts the question mark on say the third value spot, you will be showing them the third format, plus, perhaps, other info as well. The INPUT statement here is mainly just to show that the right field values are available.

Now the Map.

Ob \_ Ob D CLS ATT DEL CLS ATT DEL  
. . T D Blnk T I ?  
. . A D \_ A I )  
. . A N ¬ M D &  
. . M I : O D +  
. . O I (  
. .  
001 --010—±—±—±–030—±—±—±–050—±—±—±–070—±—

```
          format info value                                   
          ----------- ------                                  
                                                                            
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             

```

Enter-PF1—PF2—PF3—PF4—PF5—PF6—PF7—PF8—PF9—PF10–PF11–PF12—  
Help Mset Exit Test Edit – - + Full \< \> Let

And here is a .e on the UVALUE array

## Arr #UVALUE Fmt A10

AD= MILT\_\_\_\_\_\_ ZP= SG= HE= +\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Rls 0  
AL= \_\_\_\_ HELP PARAMETER EXTENSION  
PM= \_\_ HE= ‘HHARR3’,#DARRAY(_),#UVALUE(_)\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
EM= \_\_\_\_ \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

001 –

```
          format info value                                   
          ----------- ------                                  
                                                                            
          (X .EXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             
          (X :XXXXXXXXXX                             

```

Enter-PF1—PF2—PF3—PF4—PF5—PF6—PF7—PF8—PF9—PF10–PF11–PF12—  
HELP Mset Exit \<— —\> – - + \< \> Let

If you want the entered value separate from the array, I created #sel to hold that value

15:36:40 Field and Variable Definitions - Summary 2012-01-05

Cmd Field Name (Truncated) Mod Format Ar Ru Lin Col  
\_\_\_ #DARRAY\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ D A1 A 5 15  
\_\_\_ #UVALUE\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ D A10 A 5 41

```
                         LOCAL DATA DEFINITIONS                             

```

Cmd Name of Local Variable (Truncated) Format Ar  
\_\_ #SEL\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ A10\_\_\_\_\_\_\_\_

* * *

* * *

Let me know if this is what you are looking for.

steve

---

<div class="post-metadata">

**Author:** ![florian\_gaulier](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@florian\_gaulier](https://techcommunity.softwareag.com/u/florian_gaulier)\
**Post date:** [February 27, 2012, 10:00am UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/16 "2012-02-27T10:00:06Z")

</div>

thanks  
i will try as soon as possible

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:41pm UTC](https://techcommunity.softwareag.com/t/question-mark-to-invoke-help-routine/61999/17 "2021-04-02T14:41:05Z")

</div>


