Jump to content
PCI

Generate random numbers with validation check digits

Recommended Posts

Hi everyone 

I've read all yesterday forums , i think it's me , but i could not find a clue for this :

I need to generate large numbers and output into csv format or excel format

- Range between 3000000 and 9000000 

- Need 5000000 numbers

- Numbers should not be in series ( Mixed and Random )

- I would prefere to have a check digits at the end

Anyone could help please ?

 

Thank you

 

 

Share this post


Link to post
Share on other sites

PCI,

Random will produce the numbers for you (although 5000000 will take a little time) - and formatting the results as .csv should not prove difficult. But what do you mean by check digits?

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

@Melba23 Thank you so much for your reply !

I need to produce set of 5 millions numbers the numbers , i need to make check digits at the end to validate the numbers with an algorithm like mod10 or luhrn .

I prefer to validate 8 digits

 

Please help

 

Thank you

Share this post


Link to post
Share on other sites

PCI,

Do you mean something like this:

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>


; Create file
$sFile = "Test.csv"

$hFile = FileOpen($sFile, $FO_OVERWRITE)

$sLine = ""


; Produce numbers (100 here as an
 example)
For $i = 1 To 100

    ; Create a random number
    $sNumber = String(3000000 + Random(0, 6000000, 1))

    ; Calculate a check digit
    $iCheckSum = 0
    For $j = 1 To 7
        $iCheckSum += StringMid($sNumber, $j, 1)
    Next
    $iCheckDigit = Mod($iChecksum, 10)

    ; Add the number and check digit to the line
    $sLine &= $sNumber & "-" & $iCheckDigit & ","

    ; Write every a line to the file every 5 numbers
    If Mod($i, 5) = 0 Then
        $sLine = StringTrimRight($sLine, 1)
        FileWrite($hFile, $sLine & @CRLF)
        $sLine = ""
    EndIf

Next


; Close the file
FileClose($hFile)


; And here is the result
$sData = FileRead($sFile)
MsgBox($MB_SYSTEMMODAL, "Random", $sData)

Just out of interest, why do you need so many random numbers?

M23

Edit:

And here is the Luhn version (now I know what it is!):

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>

$sFile = "Test.csv"

$hFile = FileOpen($sFile, $FO_OVERWRITE)

$sLine = ""

For $i = 1 To 100

    $sNumber = String(3000000 + Random(0, 6000000, 1))
    $iCheckSum = 0
    For $j = 1 To 7
        $iCheckSum += StringMid($sNumber, $j, 1)
    Next
    $iCheckSum *= 9
    $sCheckDigit = StringRight(String($iCheckSum), 1)

    $sLine &= $sNumber & $sCheckDigit & ","

    If Mod($i, 5) = 0 Then
        $sLine = StringTrimRight($sLine, 1)
        FileWrite($hFile, $sLine & @CRLF)
        $sLine = ""
    EndIf

Next

FileClose($hFile)

$sData = FileRead($sFile)
MsgBox($MB_SYSTEMMODAL, "Random", $sData)

 

Edited by Melba23

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites


Thank you so much @Melba23 you ROCK !
I'm really suprized how clean and easy to read
I'm trying to distibute a unique code to random friends to access a web page
However i could not generate the results with these requirements
   - Fixed length if possible 
   - Range from 1000000(1M) to 40000000(40M)
   - Mod10 check
   - Could i add carriage return to the output so they are only 1 set per ligne ?
   
   Thank you for making me learn , this i will make a gui with prompt to enter low range and hi range and select mod10 with check then click on output
      
      Great Forum / Great work / Genius Autoit 

Share this post


Link to post
Share on other sites

PCI,

Of course the numbers are not Mod 10 - you did not ask for them to be so.  The code produces a Mod 10 checksum and adds it to the end of the random value - as this checksum will vary between 0 and 9, the final digit will also vary between those values.

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thank you 

You are very helpful .

I will try and add mod10 calculation

I think it will be very hard for a newbie like me. :-)

Any suggestions where to start please ?

Regards

 

Share this post


Link to post
Share on other sites

Melba something looks wrong with your Luhn algorithm code. Here's my version. BTW your _ArrayDisplay range feature was very useful testing my code. :)

PCI - The numbers you want to generate seem rather a lot. The method I use below generates Luhn numbers of 8 digits. Using _ArrayShuffle to create larger numbers is not a simple procedure. The reason is that arrays have a maximum limit of approx 16000000 elements. Only some clever work-around will allow you to exceed this range limit: assuming the numbers must be unique, as random as possible (within the range) and appear in any order. I have suspicions that you don't actually need all these numbers, but hopefully the code below will help. If there's something you don't understand then ask.

#include <Array.au3>

; Maximum valid 8 digits Luhn Number = 99999997

; Generate numbers from 1000000 to 9999999
Local $iMin = 1000000
Local $iMax = 9999999
Local $iBound = $iMax - $iMin +1

Local $aArray[$iBound]
For $i = 0 To $iBound -1
    $aArray[$i] = $iMin + $i
Next

_ArrayShuffle($aArray) ; Shuffle the numbers

Local $iIterations = 1000 ; Suppose we only need 1000 random 8 digit Luhn numbers (for quick demonstration purposes)

ReDim $aArray[$iIterations] ; Delete most of the array

; Aquire the last digit: needed to convert each 7 digit number to a valid 8 digit Luhn number
For $i = 0 To $iIterations -1
    $aArray[$i] &= GenerateLastLuhnDigit($aArray[$i])
Next

_ArrayDisplay($aArray)

Func GenerateLastLuhnDigit($vNumber)
    Local $iSum = 0, $sCurrDigit
    For $i = StringLen($vNumber) To 1 Step -2 ; Every second number from the right will be doubled.
        $sCurrDigit = StringMid($vNumber, $i, 1) ; Read each digit to be doubled starting from the right.
        $sCurrDigit *= 2 ; Multiply by 2.
        If $sCurrDigit > 9 Then $sCurrDigit = StringLeft($sCurrDigit, 1) + StringRight($sCurrDigit, 1) ; Make sure $sCurrDigit is not greater than 9.
        $iSum += $sCurrDigit + StringMid($vNumber, $i -1, 1) ; Also add the odd step value (not multiplied by 2)
    Next
    $iSum *= 9 ; Multiply the result by 9.
    Return Mod($iSum, 10) ; This digit can be appended to $vNumber to create a valid Luhn number.
EndFunc

 

Edited by czardas
spelling

Share this post


Link to post
Share on other sites

Hi czardas 

You guys are Genius !!!

I'm testing as we speak , i'm trying to make a GUI to Input low range and High Range in this GUI also any possibility to have it output to a text file ?

Thank you so much

Share this post


Link to post
Share on other sites

No problem, I guess you might just want to use the function GenerateLastLuhnDigit() to generate the final digit. It should work on any number size, but very large numbers must be passed as strings. The rest of my code is really intended to give you some ideas to play around with. Good luck. :)

Edited by czardas

Share this post


Link to post
Share on other sites

Cool worked just fine :)

Very happy guys Thank you

However , i have limitations to the output due to the maximum row 65524 , any thing i could do to output this as text file ?

Thank you for the help 

God bless you

 

 

Share this post


Link to post
Share on other sites

You can also change the iterations to a maximum of 9000000 (any higher and the code will give you an error), but I don't know how long it will take to generate all the numbers. Probably not too long - you can try it if you want. However you will not be able to display all of the array - only parts of it. Write to file as you yourself suggested.

Edited by czardas

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

  • Similar Content

    • By Garrik
      Hi guys!
       
      I need some help here, is there a way to use Random with While? 
      I need this script to run in between 1 and 4 times but I dont know how to do it, can you please help me?
       
      dim $i=1
      While $i<=4
      Sleep(3000)
      Send("{LWINDOWN}r{LWINUP}")
      Sleep(3000)
      Send("C:\Users\123\Catalogos\tags.txt{ENTER}")
      Sleep(3000)
      WinActivate("tags: Bloc de notas","")
      Sleep(3000)
      Send("{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{DEL}{DEL}")
      Sleep(3000)
      Send("{CTRLDOWN}g{CTRLUP}{ALTDOWN}{F4}{ALTUP}")
      Sleep(3000)
      Send("{CTRLDOWN}v{CTRLUP}{SPACE}")
      $i=$i+1
      WEnd
    • By Inpho
      Hi All,
      I intend on keeping custom functions/UDFs (works in progress) here; if anyone wants to use any code, feel free.
      String functions:
      #AutoIt3Wrapper_AU3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include-once ; #FUNCTION# ==================================================================================================================== ; Name ..........: _DateTimeGet ; Description ...: Returns the date and time formatted for use in sortable filenames, logs, listviews, etc. ; Syntax ........: _DateTimeGet(iType = 1[, $bHumanFormat = False]) ; Parameters ....: $iType - [optional] an integer value. Default is 1. ; 1 - Date and time in file-friendly format; 20190115_113756 ; 2 - Date in file-friendly format; 20190115 ; 3 - Time in file friendly format; 113756 ; $bHumanFormat - [optional] a boolean value. Default is False. ; True - Includes slashes in the date and colons in the time with a space inbetween ; False - No slashes or colons included with an underscore inbetween ; Return values .: Success - String ; Failure - Sets @error to non-zero and returns an empty string ; Author ........: Sam Coates ; =============================================================================================================================== Func _DateTimeGet($iType = 1, $bHumanFormat = False) If $iType < 1 Or $iType > 3 Then Return (SetError(-1, 0, "")) ;; Param1: ;; 1 = Date and time in file friendly format: 20190115_113756 ;; 2 = Date in file friendly format: 20190115 ;; 3 = Time in file friendly format: 113756 ;; Param2: ;; True = Use human-readable format: 15/01/2019 11:37:56 Local $sTime = @HOUR & ":" & @MIN & ":" & @SEC Local $sDate = @MDAY & "/" & @MON & "/" & @YEAR If $iType = 1 Then If $bHumanFormat = False Then $sTime = StringReplace($sTime, ":", "") $sDate = StringReplace($sDate, "/", "") $sDate = StringTrimLeft($sDate, 4) & StringMid($sDate, 3, 2) & StringLeft($sDate, 2) Return ($sDate & "_" & $sTime) Else Return ($sDate & " " & $sTime) EndIf ElseIf $iType = 2 Then If $bHumanFormat = False Then $sDate = StringReplace($sDate, "/", "") $sDate = StringTrimLeft($sDate, 4) & StringMid($sDate, 3, 2) & StringLeft($sDate, 2) EndIf Return ($sDate) ElseIf $iType = 3 Then If $bHumanFormat = False Then $sTime = StringReplace($sTime, "/", "") EndIf Return ($sTime) EndIf EndFunc ;==>_DateTimeGet ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileToFileExtension ; Description ...: Returns a file extension from a filename/FQPN (Fully Qualified Path Name) ; Syntax ........: _FileToFileExtension($sPath) ; Parameters ....: $sPath - a string value. ; Return values .: Success - String ; Failure - Empty string as returned from StringTrimLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _FileToFileExtension($sPath) Return (StringTrimLeft($sPath, StringInStr($sPath, ".", 0, -1))) EndFunc ;==>_FileToFileExtension ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileToFileName ; Description ...: Returns a filename from a FQPN (Fully Qualified Path Name) ; Syntax ........: _FileToFileName($sPath[, $bIncludeExtension = True]) ; Parameters ....: $sPath - a string value. ; $bIncludeExtension - [optional] a boolean value. Default is True. ; Return values .: Success - String ; Failure - Empty string as returned from StringLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _FileToFileName($sPath, $bIncludeExtension = True) Local $sReturn = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1)) If $bIncludeExtension = False Then $sReturn = StringLeft($sReturn, StringInStr($sReturn, ".", 0, -1) - 1) Return ($sReturn) EndFunc ;==>_FileToFileName ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileToFilePath ; Description ...: Returns a folder path from a FQPN (Fully Qualified Path Name) ; Syntax ........: _FileToFilePath($sPath) ; Parameters ....: $sPath - a string value. ; Return values .: Success - String ; Failure - Empty string as returned from StringLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _FileToFilePath($sPath) Return (StringLeft($sPath, StringInStr($sPath, "\", 0, -1) - 1)) EndFunc ;==>_FileToFilePath ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringLeft ; Description ...: Searches for a string inside a string, then removes everything on the right of that string ; Syntax ........: _StringLeft($sString, $sRemove[, $iCaseSense = 0, $iOccurrence = 1]) ; Parameters ....: $sString - a string value. The string to search inside. ; $sRemove - a string value. The string to search for. ; $iCaseSense - an integer value. Flag to indicate if the operations should be case sensitive. ; $iOccurrence - an integer value. Which occurrence of the substring to find in the string. Use a ; negative occurrence to search from the right side. ; Return values .: Success - String ; Failure - Empty string as returned from StringLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _StringLeft($sString, $sRemove, $iCaseSense = 0, $iOccurrence = 1) Return (StringLeft($sString, StringInStr($sString, $sRemove, $iCaseSense, $iOccurrence) - 1)) EndFunc ;==>_StringLeft ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringRandom ; Description ...: Returns a string of random characters ; Syntax ........: _StringRandom($iAmount[, $iType = 1]) ; Parameters ....: $iAmount - an integer value. Length of returned string ; $iType - [optional] an integer value. Default is 1. ; 1 - Return digits (0-9) ; 2 - Return hexadecimal (0-9, A - F) ; 3 - Return Alphanumeric upper (0-9, A - Z) ; 4 - Return Alphanumeric (0-9, A - Z, a - z) ; 5 - Return Alpha upper (A - Z) ; 6 - Return Alpha (A - Z, a - z) ; Return values .: Success - String ; Failure - Empty string and @error flag as follows: ; @error : 1 - $iAmount is not a positive integer ; 2 - $iType is out of bounds ; Author ........: Sam Coates ; =============================================================================================================================== Func _StringRandom($iAmount, $iType = 1) If $iAmount < 1 Or IsInt($iAmount) = 0 Then Return (SetError(-1, 0, "")) Local $sString = "" Local $iRandomLow = 1, $iRandomHigh = 62 #Tidy_Off Local Static $aCharId[63] = [0, Chr(48), Chr(49), Chr(50), Chr(51), Chr(52), Chr(53), Chr(54), Chr(55), Chr(56), Chr(57), Chr(65), Chr(66), Chr(67), _ Chr(68), Chr(69), Chr(70), Chr(71), Chr(72), Chr(73), Chr(74), Chr(75), Chr(76), Chr(77), Chr(78), Chr(79), Chr(80), _ Chr(81), Chr(82), Chr(83), Chr(84), Chr(85), Chr(86), Chr(87), Chr(88), Chr(89), Chr(90), Chr(97), Chr(98), Chr(99), _ Chr(100), Chr(101), Chr(102), Chr(103), Chr(104), Chr(105), Chr(106), Chr(107), Chr(108), Chr(109), Chr(110), Chr(111), _ Chr(112), Chr(113), Chr(114), Chr(115), Chr(116), Chr(117), Chr(118), Chr(119), Chr(120), Chr(121), Chr(122)] #Tidy_On If $iType = 1 Then ;; digits: 1 - 10 $iRandomHigh = 10 ElseIf $iType = 2 Then ;; hexadecimal: 1 - 16 $iRandomHigh = 16 ElseIf $iType = 3 Then ;; alnumupper: 1 - 36 $iRandomHigh = 36 ElseIf $iType = 4 Then ;; alnum: 1 - 62 $iRandomHigh = 62 ElseIf $iType = 5 Then ;; alphaupper: 11 - 36 $iRandomLow = 11 $iRandomHigh = 36 ElseIf $iType = 6 Then ;; alpha: 11 = 62 $iRandomLow = 11 $iRandomHigh = 62 Else Return (SetError(-2, 0, "")) EndIf For $i = 1 To $iAmount $sString &= $aCharId[Random($iRandomLow, $iRandomHigh, 1)] ;; append string with corresponding random character from ascii array Next Return ($sString) EndFunc ;==>_StringRandom ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringTrimLeft ; Description ...: Searches for a string inside a string, then removes everything on the left of that string ; Syntax ........: _StringTrimLeft($sString, $sRemove[, $iCaseSense = 0, $iOccurrence = 1]) ; Parameters ....: $sString - a string value. The string to search inside. ; $sRemove - a string value. The string to search for. ; $iCaseSense - an integer value. Flag to indicate if the operations should be case sensitive. ; $iOccurrence - an integer value. Which occurrence of the substring to find in the string. Use a ; negative occurrence to search from the right side. ; Return values .: Success - String ; Failure - Empty string as returned from StringTrimLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _StringTrimLeft($sString, $sRemove, $iCaseSense = 0, $iOccurrence = 1) Return (StringTrimLeft($sString, StringInStr($sString, $sRemove, $iCaseSense, $iOccurrence) + StringLen($sRemove) - 1)) EndFunc ;==>_StringTrimLeft Examples:
      ConsoleWrite(_StringRandom(100, 6) & @CRLF) ConsoleWrite(_StringTrimLeft("C:\Windows\System32\cmd.exe", "C:\Windows\System32\") & @CRLF) ConsoleWrite(_StringLeft("C:\Windows\System32\cmd.exe", "cmd.exe") & @CRLF) ConsoleWrite(_FileToFileName("C:\Windows\System32\cmd.exe") & @CRLF) ConsoleWrite(_FileToFilePath("C:\Windows\System32\cmd.exe") & @CRLF) ConsoleWrite(_FileToFileExtension("C:\Windows\System32\cmd.exe") & @CRLF) ConsoleWrite(_StringRandom(6, 4) & "-" & _StringRandom(4, 4) & "-" & _StringRandom(4, 4) & "-" & _StringRandom(4, 4) & "-" & _StringRandom(6, 4)& @CRLF)  
    • By v0id
      I am starting out using AutoIt. Here is a simple form with username and password. I want to check if information entered is valid once user clicks a button.
      My problem now is that it only validates once. E.g.: if I type 5 character username, it will complain it is not 7 character (good). But once I correct that mistake and press the button again it will still say the same thing.
      Do I need to have a loop?
       
      #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> Opt("GUIOnEventMode", 1) $main = GUICreate("Test Tool", 600, 600) $hyourlabel = GUICtrlCreateLabel("YOUR CREDENTIALS", 30, 10, 256) GUICtrlSetFont($hyourlabel, Default, 600) Local $adminfrejalabel = GUICtrlCreateLabel("Username:", 8, 38, 64, 17) Global $adminfrejaid = GUICtrlCreateInput("", 80, 38, 110, 17) Local $adminpasswordlabel = GUICtrlCreateLabel("Password:", 8, 62, 64, 17) Global $adminpassword = GUICtrlCreateInput("", 80, 62, 110, 17, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) $userButton_Check = GUICtrlCreateButton("VALIDATE", 32, 480, 85, 25) GUICtrlSetOnEvent($userButton_Check, "startvalidation") GUISetOnEvent($GUI_EVENT_CLOSE, "ExitGUI") GUISetState(@SW_SHOW) While 1 Sleep(10) WEnd Func startvalidation() ;CHECK VALIDATIONS $adminfrejaid = GUICtrlRead($adminfrejaid) $adminpassword = GUICtrlRead($adminpassword) If StringLen($adminfrejaid) <> '7' Then MsgBox($MB_SYSTEMMODAL, "User ID", "Please enter exactly 7 characters.") ;Exit EndIf If StringLen($adminpassword) < '5' Then MsgBox($MB_SYSTEMMODAL, "Your Password", "Please enter a valid password.") ;Exit EndIf EndFunc Func ExitGui () Exit ; Exit the program EndFunc  
    • By matwachich
      HI everybody! It's been a (very) long time since I posted something useful!
      Here I come with a new functions that I needed in a project that needs many different forms to insert different data into a database. Instead of creating a different Koda form for each data type, I decided to create this function, inspired by this one (from the excellent IUP GUI library).
      To create an input dialog, you first must create a JSON definition of this dialog. Simple example of a login form:
      { title: "Dialog Title", controls: [ {type:"label", value:"Please login"}, {type:"input", id:"user", label:"User name"}, {type:"input", id:"pass", label:"Password", style:$ES_PASSWORD}, {type:"check", id:"remember", label:"Remember me", value:true} ] } Then pass it to the advInputBox function:
      #include "advInputBox.au3" Dim $oRet = advInputBox($sJSON) If @error Then MsgBox(64, "Example1", "Dialog canceled") Else MsgBox(64, "Example1", "Return: " & Json_Encode($oRet, 128)) ; you can access individual values by ids: ; Json_ObjGet($oRet, "username") ; Json_ObjGet($oRet, "password") ; Json_ObjGet($oRet, "remember") EndIf And you will get an InputBox like this one:

      The code is on GutHub
      Enjoy!
       
    • By JustinZandee
      I need a random string generator which creates 15 letters/numbers.
      How can I make that?
×
×
  • Create New...