Jump to content
Sign in to follow this  
ojef1

variable types question

Recommended Posts

In my program I use an input box to accept an excel row number. However, isInt($row) returns a 0. I assume this is because inputBox only accepts strings, but when I use $row to do an _ExcelReadCell it works no problem. How is _ExcelReadCell able to decipher this without an error?

The reason I ask is because I'd like to make sure the user inputs a valid integer. Any suggestions?

Share this post


Link to post
Share on other sites

the InputBox can also be set to only accept digits.

afaik not, I only know this for Controls created by GuiCtrlCreateInput, GuiCtrlEdit but Bot for InputBox.

autoBert

Edited by AutoBert

Share this post


Link to post
Share on other sites

afaik not, I only know this for Controls created by GuiCtrlCreateInput, GuiCtrlEdit but Bot for InputBox.

autoBert

Well .... this should do it?

$Number = 'Yes'
While StringRegExp($Number, "[^0-9]")
    $Number = InputBox("Numbers only!", "Enter a 1 or 2 Number Row .", "", " M2")
    If @error > 0 Then Exit
    Sleep(13)
WEnd
MsgBox(0, '', 'Yes, This was Row number: ' & Number($Number)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...