Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
698 views

SM 9.4 - RAD - how to insert into array BEFORE current values?

Jump to solution

I am trying to insert data into an ARRAY ( the action field in probsummary) and I want the values to be the first value instead of at the end... is this possible? I can add values to the array but at the end

 

$new.comment=action.comments in $L.file
action in $L.file=insert(action in $L.file,,,$new.comment)

I tried the following "0" during the insert and that deletes the array and then puts in JUST my comment and the existing array is deleted.

$new.comment=action.comments in $L.file
action in $L.file=insert(0 in action in $L.file,,,$new.comment)

 

Is there a way I can copy the array to a variable and a way for me to add the array back (completely intact) to the array AFTER i add the comment to the array at the beginning?

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: SM 9.4 - RAD - how to insert into array BEFORE current values?

Jump to solution

The insert function will insert at the beginning, but by default the position is 0 which is at the end of the array.  You will need to set the position to 1.

action in $L.file=insert(action in $L.file,1,1,$new.comment)

View solution in original post

2 Replies
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: SM 9.4 - RAD - how to insert into array BEFORE current values?

Jump to solution

The insert function will insert at the beginning, but by default the position is 0 which is at the end of the array.  You will need to set the position to 1.

action in $L.file=insert(action in $L.file,1,1,$new.comment)

View solution in original post

Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: SM 9.4 - RAD - how to insert into array BEFORE current values?

Jump to solution

I was so close - it worked- thanks!

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.