on 2024 Jul 31 1:30 PM
Hi,
This is a question on SAP Analytics Cloud scripting.
I would like to be able to enter either a number of spaces into a ListBox item, or perhaps some other non-visible character. The reason for this is that I want to be able to create entries that essentially, look blank. An issue is that they need to be unique.
A part example of some of my current code would be:
if (diff >0)
{
console.log("diff is greater than zero");
list_Box_Positive_Variances.addItem("+"+diff.toString().substr(0,5));
list_Box_Negative_Variances.addItem(".").repeat(i);
}
This is part of a FOR loop (that increments i ) and it puts a full stop in a listbox item for as many iterations of i that we are. So, for 1 to 5 iterations, it looks like this:
.
..
...
....
.....
This is fine, it works because each entry into the list box is unique. However, I can see it and I would rather enter something that is different, but not visible.
What I cannot do is replace the full stops with " ". Which is a standard space. If I enter a space character in there, nothing is shown. This means entries are not unique. The code does not error, it just does not enter unique items in the list.
As well as standard spaces, I have attempted to try entering other non-visible characters such as:
Em Space
Nonbreaking Space
No-Width Optional Break
Tab
They do not work either.
I have also attempted to do this:
list_Box_Negative_Variances.addItem(". .").repeat(i);
but the spaces between the full stops just dissappear.
Is there any way for me to put a special character in there and repeat it so to create unique rows of 'invisible' text?
Kind Regards,
Steve
P.S. apologies I have posted to the wrong location. There did not appear to be an appropriate one for what I'm doing.
Request clarification before answering.
User | Count |
---|---|
41 | |
15 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.