Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
586 views

HELP, how to write string into array of char

Jump to solution

Hi Expert,

I'm trying to write js to pass string value into the request module resolution field (which OOB is array of 1 char)

when I try the following 

vars.$L_file.resolution = "test";

I got the error of "cannot store a string into an object of type array at char 1"

Please advice how to push value into data type array of char

 

Thanks

Soong 

Regards
Soong
0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: HELP, how to write string into array of char

Jump to solution

Try:

vars.$L_file.resolution[0] = "test";

View solution in original post

0 Likes
3 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: HELP, how to write string into array of char

Jump to solution

Try:

vars.$L_file.resolution[0] = "test";

View solution in original post

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: HELP, how to write string into array of char

Jump to solution
Hi Soong, As it is an array, you should refer it with index. vars.$L_file.resolution[0] = "test";
Cheers,
Hardit Singh
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: HELP, how to write string into array of char

Jump to solution

Thanks for the solution and explanation 

Regards
Soong
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.