ATuringtest 14 Posted April 17, 2020 Report Share Posted April 17, 2020 This must be simple but I just cant get the syntax I want to add +1 to a position, the variable holds the amount of characters so I can insert or add the next list item to #charCountPos1 but I need to add a space so the two list items are separated. set(#listItem2,$insert text(#listItem2,$next list item(%listList),#charCountPos1),"Global") I could pad the list item but that seems a bit of a waste of code. Stay Safe Quote Link to post Share on other sites
ibins 0 Posted April 17, 2020 Report Share Posted April 17, 2020 if i get it right, you are looking for increment(#charCountPos1) if not, and if you want to just add some text to a text, you could do it like set(#new,$nothing,"Global")set(#one,0,"Global")set(#rand,$rand(3,9),"Global")loop(#rand) { increment(#one) set(#addd,$text length(#new),"Global") set(#new,$insert text(#new,"{#one}|",#addd),"Global")}alert(#new) Quote Link to post Share on other sites
ATuringtest 14 Posted April 17, 2020 Author Report Share Posted April 17, 2020 if i get it right, you are looking for increment(#charCountPos1) if not, and if you want to just add some text to a text, you could do it like set(#new,$nothing,"Global")set(#one,0,"Global")set(#rand,$rand(3,9),"Global")loop(#rand) { increment(#one) set(#addd,$text length(#new),"Global") set(#new,$insert text(#new,"{#one}|",#addd),"Global")}alert(#new) Thanks man I'll give it a go Quote Link to post Share on other sites
Pete 121 Posted April 17, 2020 Report Share Posted April 17, 2020 set(#charCount,5,"Global") set(#listItem2,$insert text(#listItem2,$next list item(%listList),$add(#charCount,1)),"Global") 1 Quote Link to post Share on other sites
ATuringtest 14 Posted April 17, 2020 Author Report Share Posted April 17, 2020 set(#charCount,5,"Global") set(#listItem2,$insert text(#listItem2,$next list item(%listList),$add(#charCount,1)),"Global") That's very beautifully simple thanks Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.