Notifications
Clear all

[Closed] convert 1,3,5-7,10 editText.text to array

  1. Please help me to convert “1,3,5-7,10” editText.text to array as integers #(1,3,5,6,7,10)
    This is an array with ids.
  2. please help me make an editText in maxscript like here: http://key.ciel-design.md/ where min price or maxprice.
    You can see inside a text for reference. I would like to have inside “1,3,5-7,10” like an example – written with grey, but once you entered inside to add ids, all this data is cleaned automatically.

Thank you in advance!

7 Replies

etxt = “1,3,5-7,10”
barrayStr = “#{” + (substitutestring etxt “-” “…”) + “}”
fArray = (execute barrayStr) as array

3 Replies
(@gazybara)
Joined: 11 months ago

Posts: 0

Hmmm… maybe this one

str = "1,2,3,5,7-10"
filterstring str ",-"
--#("1", "2", "3", "5", "7", "10")
(@denist)
Joined: 11 months ago

Posts: 0

as i can guess it’s about frames… it looks like a render frame sequence. so it should allow negative frames, zero frame, and repeated frames… a bitarray solution can’t work in general case

(@try2script)
Joined: 11 months ago

Posts: 0

hey, I love this idea with bitarray because It’s giving fast result, but now, when I wanted to implement this to my needs I found that it gives #{1…6} instead of #(1,2,3,4,5,6) and this is not what my script is expecting now. Is it possible to convert this values somehow? If yes, please help me

Thank you soo much. It’s working great. In my case it’s for ID and it should not repeat.

But tell me please, how to change the color of the text inside textbox?

as any other .net form control… ForeColor

#{1..6} as array