Commodore
Commodore
530 views

Micro Focus Visual Studio Dialog System

Is there any way of moving one character of a string variable into another variable in the Dialog System? For example:

 

YES-STRING  X 3

Y-STRING      X 1

 

The 'YES-STRING' contains the word "YES" and I would like to move the letter 'Y' from the 'YES-STRING' to the 'Y-STRING'. I can do this in the COBOL program by doing the following :

MOVE YES-STRING(1:1) TO Y-STRING.   

 

But can this be done in the dialog? I know the Dialog System can move entire variable such as:

  MOVE YEST-STRING Y-STRING

 

But I want to be able to move just a character of a string to another variable in the Dialog System. Thanks in advance for your help.

 

- Alex Castro

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Reference modification does not appear to be supported directly in Dialog System script. Subscripting is but not reference modification. The standard COBOL rules for truncation will apply so if you move a 3 character field to a 1 character field then only 1 character will be moved. If you need to do more extensive formatting then you could always do a callout to a COBOL subprogram that would format the data fields for you and then return to Dialog System script afterwards.
0 Likes
Commodore
Commodore

Okay, thanks for your response.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.