Jump to content

Recommended Posts

Posted
  On 6/2/2013 at 11:59 AM, Zedna said:

@GreenCan

Good work! :thumbsup:

Just make one ZIP file (attachment) containing UDF+exxamples.for simple download.

Thanks, done...

  Reveal hidden contents

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Posted

A lot better. I just noticed (as I do when I look inside the UDFs) that a couple of 'issues' could be fixed.

  1. In _Inputmask_init you have $iReturn, but it's not used so should be deleted.
  2. In _Inputmask_init change Dim to Global, but ideally I wouldn't do that and instead would ReDim the array on initialising and closing.
  3. If you decide you want to combine $sRegExpMask e.g.  $iIM_INTEGER + $iIM_ALPHA, then let us know and I will show you how with BitAND.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

  On 6/2/2013 at 2:04 PM, guinness said:

1. In _Inputmask_init you have $iReturn, but it's not used so should be deleted.

You are right, I forgot to remove the line when moving _Inputmask_MsgRegister() outside of the function.

Will be corrected in next upload

  On 6/2/2013 at 2:04 PM, guinness said:

2. In _Inputmask_init change Dim to Global, but ideally I wouldn't do that and instead would ReDim the array on initialising and closing.

 

Init:

I understand that the use of DIM is discouraged, although I don't exactly understand what the reason is for not using Dim

I changed as follows, declare Global at the top of the UDF:

    #region Global variables

   Global $aInputMask[1][1], $iInputControls_count ; required Gloabal variables

   #endregion Global variables

and using ReDim in the init function

   ReDim $aInputMask[$iInputControls][6]

Closing:

You mean ReDim $aInputMask[1][1] instead of $aInputMask = "" ?

I understand that you don't like changing the vartype from array to a string, I don't like it neither. But what is the benefit of doing a ReDim $aInputMask[1][1]? This will leave one element containing some garbage.

Would it not be better to set $aInputMask=0 instead? Like you suggested here?

 

  On 6/2/2013 at 2:04 PM, guinness said:

3. If you decide you want to combine $sRegExpMask e.g.  $iIM_INTEGER + $iIM_ALPHA, then let us know and I will show you how with BitAND.

Yes, might be of interest.

Thanks

Edited by GreenCan
  Reveal hidden contents

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Posted (edited)

Well if you know what you're doing then Dim isn't the worst thing in AutoIt, but it's just best to declare Local or Global exclusively. Here is >an example I created that displays when an error can occur due to the user not understanding the complications of Dim.

The changes you made are great, the 'issue' with changing the datatype wasn't what I was getting at initially, but I personally use $aArray = 0 when destroying an array or initialising an array/handle (for example.) As to the changes you've introduced, it's best to use ReDim in the closing function, because if a user decides to initialise the input mask function again, then an error will occur with the Init() ReDim.

As to my suggestion of combining mask values, you will need to change the values of constant variables to 1, 2, 4, 8, 16, 32, 64, 128....however many you have and then use the code below, adjusting depending on the constant variable.

This is an example only!

#include <Constants.au3>

Local Const $IM_INTEGER = 1, $IM_ALPHA = 2, $IM_SOMETHINGELSEIDUNNO = 4
Local $iFlagOrMask = $IM_INTEGER + $IM_SOMETHINGELSEIDUNNO ; BitOR($IM_INTEGER, $IM_SOMETHINGELSEIDUNNO) is preferred.

If BitAND($iFlagOrMask, $IM_INTEGER) = $IM_INTEGER Then MsgBox($MB_SYSTEMMODAL, '', '$IM_INTEGER was called.')
If BitAND($iFlagOrMask, $IM_ALPHA) = $IM_ALPHA Then MsgBox($MB_SYSTEMMODAL, '', '$IM_ALPHA was called.')
If BitAND($iFlagOrMask, $IM_SOMETHINGELSEIDUNNO) = $IM_SOMETHINGELSEIDUNNO Then MsgBox($MB_SYSTEMMODAL, '', '$IM_SOMETHINGELSEIDUNNO was called.')
Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted
  On 6/2/2013 at 3:14 PM, guinness said:
As to the changes you've introduced, it's best to use ReDim in the closing function, because if a user decides to initialise the input mask function again, then an error will occur with the Init() ReDim.

Clear example. And yes, you are right.  I have to use ReDim in the UDF of course.

#include <Constants.au3>

Local Const $IM_INTEGER = 1, $IM_ALPHA = 2, $IM_SOMETHINGELSEIDUNNO = 4
Local $iFlagOrMask = $IM_INTEGER + $IM_SOMETHINGELSEIDUNNO ; BitOR($IM_INTEGER, $IM_SOMETHINGELSEIDUNNO) is preferred.

If BitAND($iFlagOrMask, $IM_INTEGER) = $IM_INTEGER Then MsgBox($MB_SYSTEMMODAL, '', '$IM_INTEGER was called.')
If BitAND($iFlagOrMask, $IM_ALPHA) = $IM_ALPHA Then MsgBox($MB_SYSTEMMODAL, '', '$IM_ALPHA was called.')
If BitAND($iFlagOrMask, $IM_SOMETHINGELSEIDUNNO) = $IM_SOMETHINGELSEIDUNNO Then MsgBox($MB_SYSTEMMODAL, '', '$IM_SOMETHINGELSEIDUNNO was called.')

This is also a clear example. Thanks.

I will have to check if this is useful in the UDF. Combination of any of the existing mask presets doesn't make sense I guess.

  Reveal hidden contents

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Posted

Hexadecimal mask: 

$sLabel_Mask = "14. Hexadecimal number(6)"
    GuiCtrlCreateLabel($sLabel_Mask, 10, 410, 200, 15)
    $Input_14 = GUICtrlCreateInput("",210,410,110,20)
    _Inputmask_add($Input_14,"[^A-Fa-f0-9]", 6, "U")
  Reveal hidden contents

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Posted
  On 6/2/2013 at 6:25 PM, GreenCan said:

I will have to check if this is useful in the UDF. Combination of any of the existing mask presets doesn't make sense I guess.

That's true, each is pretty distinct for now. But who knows? Another project you might need something like this.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • 2 weeks later...
Posted (edited)

_InputMask Version 1.0.0.5 uploaded with better input control.

See Post 1 for download

Edited by GreenCan
  Reveal hidden contents

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

  • 1 year later...
Posted (edited)

Really like this so far.

I am not good with regex however so looking for a bit of guidance.

I want to tighten up a date input where the format must be MM/DD/YY

right now I am just using this to ensure its 8 characters long and can only use numbers and slashes.

_Inputmask_add($End, "[^0123456789/]", 8, "U")

I would like to tighten this up further if possible as people can still type bad dates.  

The most common would be not including the 0 for single digit months, so I think making the first character required as a 0 or 1 would help this but with RegEx I have no idea how to do it.

Also it seems we are working with "reverse" regex?  I looked up regex tutorials and ^ means "do not match" but this UDF lets me only type those characters.

Just learning as I go, but a little help can go a long way.

Thanks! 

Edited by ViciousXUSMC
  • 8 months later...
Posted
  On 9/25/2014 at 3:28 PM, ViciousXUSMC said:

No dice guys?

Sorry, I missed this one because I didn't mark to follow the topic. have you found a way to solve your problem?

 

  Reveal hidden contents

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Posted

Well, I have also issues with regex, real hard stuff to get grip on.

May I ask you why you would bother creating an input mask for a date input, while you can use GUICtrlCreateDate?

 

  Reveal hidden contents

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

  • 3 weeks later...
Posted

For those who are having troubles with Undefined _Iif function, just add it to the UDF file:

Func _Iif($a, $b, $c)
    Return $a ? $b : $c
EndFunc

 

My stuff

  Reveal hidden contents

 

  • Moderators
Posted

Jefrey,

Better still - convert the lines use to ternary operator which replaced it.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

  • 1 month later...
Posted (edited)

I was actually looking for this today.

I got a great answer from some of the forum members that did what I needed, but for the sake of learning I wanted to see if I could also use this UDF to produce the desired results.

As I was looking through the example I found I get an error in line 90/91 in regards to this function: _Iif

You can create the error by typing something into example section 2 (Integer) the error itself is from the UDF not the example

Regards,

Edited by ViciousXUSMC
  • Moderators
Posted

ViciousXUSMC,

The Iif function was replaced by the ternary operator a couple of releases ago. Just replace the function calls with the correct ternary syntax and everything will work.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Well that works :P

Here is the fixed line 91 & 92 if anybody needs / is interested.

If StringLen($Read_Input) - StringInStr($Read_Input, "-") - (StringInStr($Read_Input, ".") ?  1 : 0) > $aInputMask[$i][4] Then ; Precision
                            $Read_Input = StringLeft($Read_Input, $aLocation[0] - 1) & StringRight($Read_Input,  $aInputMask[$i][4] + StringInStr($Read_Input, "-") + (StringInStr($Read_Input, ".") ? 1 : 0) - $aLocation[0] + 1)

 

Posted (edited)

I appreciate the author's contribution of this UDF very much.  (And thank you to @ViciousXUSMC  for posting the ready-to-use "Undefined _Iif function" fix.)

For my level of expertise it would be wonderful if this thread had at least one simple, working example. The example included with the UDF is a fine overview of the UDF's capabilities but for a moron like me more is needed.

My code below "works" and it accomplishes what I wanted InputMask for, but I'd appreciate any suggested fixes and improvements as well as answers to the following:

1. The Example says: "Before using _Inputmask_add() don't forget to initialize the UDF with _Inputmask_init(x) where x is the number of input masks that you will create." In response, my brain thinks: "I want to limit the number of characters, I want to limit input to uppercase and  Alpha. That sounds like 3 criteria -- 3 "masks". Or, maybe the author means "the number of times I will use the InputMask function in my script"  What does "x" mean?

2. In the UDF, what is the purpose of the "_ImputMask" function when all examples use "_Inputmask_add"? 

3. When I compile or syntax check my code below the following warning appears. Ignore or what?

inputmask_warning.thumb.png.3cf72b1fd516

 

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

#include <GUIConstantsEx.au3>
#include <_inputmask.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Example ()


Func Example()

    Local $GUI, $sLabel_Mask, $MyInput
    #forceref $GUI, $sLabel_Mask
    Local $iInputs = 1

    _Inputmask_init($iInputs) ; Initialize InputMasks for Inputs controls
    _Inputmask_MsgRegister() ; Register for _InputMask

    $GUI = GUICreate("InputMask Example",373,230)
    GuiCtrlCreateLabel("Enter Drive Letter", 110, 40,190,33)
    GUICtrlSetFont(-1, 14, 600, 0, "MS Sans Serif")
    $MyInput = GUICtrlCreateInput("",175,96,33,32,$ES_CENTER)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    Local $Button1 = GUICtrlCreateButton("OK", 296, 168, 49, 41,BitOR($BS_DEFPUSHBUTTON,$WS_BORDER))
    _Inputmask_add($MyInput, $iIM_ALPHA,1, "U")
    GUISetState()

    While 1
        Switch GUIGetMsg()
            Case $Button1
                ExitLoop
        EndSwitch

    WEnd

    _Inputmask_MsgRegister(False) ; Unregister for _InputMask
    _Inputmask_close() ; Memory cleanup for Input masks

EndFunc

 

Edited by timmy2
add #forceref, improve snippet
Posted

Are you telling me the warnings don't make sense? You're using advanced parameters for Au3Check, one of which is telling you about when a variable has been declared but not used. I don't know how to make the warnings anymore clearer.

This is why it's important that UDF creators (like me, you or everyone) run their UDF against these checks, as when someone like you or I decides to use this directive in our code, we don't get warnings. So the fix is to remove those variables and for those you can't remove like $iMsg or $hWnd, then use #forceref (search the help file for its usage).

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
×
×
  • Create New...