View Single Post
  #3  
Unread 07-06-2011, 02:47 PM
Fortunis's Avatar
Fortunis Fortunis is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Mar 2011
Location: Leeds, UK
Posts: 72
Hehe, ive just added an if-then-end before it to check if its not tonumber( IAI )

I guess the small break from staring at code gave me a little brain boost.

p.s. thanks for your fast response btw MrJackdaw



edit-


Code:
ImageAmountInput:SetWantsKeyEvents( true );
    ImageAmountInput.KeyDown = function( sender, args )
        
        if args.Action == 162 then
            OpWindow:Activate();
            ImageAmountInput:SetSelection(1, 4);
            IAI = ImageAmountInput:GetText();
            IAI = tonumber( IAI );
            if not tonumber( IAI ) then -- <--- Fixes everything
                ImageAmountInput:SetText( "" );
                print ( "You entered an illegal entry" );
            elseif  IAI >= 0 and IAI <= 9999 then -- ERROR produced here if string characters used in user input box. Need to figure out a way to ignore erroring.
                ImageAmountInput:SetSelection(0,0);
            end
        end
    end
__________________
Author of Mouse Cursor Highlighter Advanced

Last edited by Fortunis : 07-06-2011 at 02:52 PM.
Reply With Quote