Jump to content
UBot Underground

Convert String to Integer from UI Text Box or Drop Down - Is this possible?


Recommended Posts

Is there a work around as to how to convert a string variable to integer from UI text box or drop down?

 

I am trying to create a script that will loop for a number of times which will be determined by the user input via text box or drop down. I always get this error when I run it "Conversion from string "" to type 'Integer' is not valid."

 

Your help is highly appreciated!

 
Link to post
Share on other sites

Here's my code:

 

ui drop down("No. of Loops", "3,5,8,10,15", #cycle)
set(#loopcounter, 0, "Global")
loop(#cycle) {
    increment(#loopcounter)
    alert(#loopcounter)
}

 

 

Thanks!

Link to post
Share on other sites

I don't see any errors when running the code you posted above. I take it that the actual code that is receiving an error is different than this code?? usually you would increment the loop after it has run its cycle, not as it starts the cycle.

Link to post
Share on other sites

That's weird! That's the same code I tested when I got the error and I tried it several times.

 

Apparently, when I updated Ubot today the error doesn't show up anymore.

 

Anyway, thanks for your help guys!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...