Sign in to follow this  
Followers 0
GeoTrail

Problem With Isnumber

5 posts in this topic

I'm experimenting with some of the functions in the latest version of AutoIt 3 build 101.

When I run this code I want the script to end if the value $Loop is NOT numeric and continue on if the value is numeric but all I get is error.

I've tried using

If IsNumber($Loop) Then
too but that didn't work either. Is there something wrong with my code or is there a bug with that function?

$Loop = InputBox ( "Enter loop ammount", "Please enter the number of times the mouse should move." & " A too larg ammount is not recommended." & "Click on Cancel to about this option immidiatly." , "10")
If @Error = 1 Then
    Exit
EndIf
If IsNumber($Loop) = 1 Then
    $file = FileOpen("movement.log", 1)
; Check if file opened for writing OK
    If $file = -1 Then
     MsgBox(0, "Error", "Unable to open file.")
     Exit
    EndIf
    
    $i = 0
    Do
    $i = $i + 1
  $Height = round(Random(1,@DesktopHeight), -1)
  $Width = round(Random(1,@DesktopWidth), -1)
  MouseMove($Width, $Height)
  FileWriteLine($file, "Movement number " & $i &". Mouse moved to position " & $Width & "x" & $Height & " at " & @HOUR&":"&@MIN&":"&@SEC)
    Until $i = 10
    
    FileClose($file)
Else
  MsgBox(0,"Error","The value you entered is NOT a numeric value!")
  Exit
EndIf

Share this post


Link to post
Share on other sites



Aaaaa I see.

Didn't even think about that.

Thanks Larry.

BTW, don't you ever sleep?

Everytime I'm in here I see you lurking around :whistle:B)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

He he he

sounds like a versitail guy.

I have used computers since C64 was the latest fasion.

I used to work at a bus garage before I joined to army. After the army I have concentrated on programming and other computer related fields.

Edited by GeoTrail

Share this post


Link to post
Share on other sites

I have 24/7 internet everywhere I am... Central US time you will not see me from 1 am to 8 am. Otherwise, when I am home or at work, I have a computers everywhere...

I am hoping to start doing work as a handyman and changing all that. My first love is carpentry, mechanics, and generally fixing things.... I fell into computers cause it's boringly stable...

LAr.

How long before you fix your "rent-a-boss" by taking your hammer to his head?

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  
Followers 0