Jump to content

Intelligent Password Adn Random No


Recommended Posts

Hi all brilliant,

i stuck with 2 things.

1. I need to random 4 number start 1111 - 9999. i use random(1111,9999,0) but result did not give me INTEGER number. Thus how i want only interger number start from 1111 - 9999.

2. How i want to read only 4 number at the middle of 8 number like this:

i need read number only 3456 from 12345678

I know it's nut for u all but not for me. Tq for your help. i so appreciate it

Link to comment
Share on other sites

  • Moderators

$Num = Random(1111, 9999, 1)
MsgBox(0, 'Number', $Num)

$String = 12345678
$Middle = StringTrimLeft(StringTrimRight($String, 2), 2)
MsgBox(0, 'Middle', $Middle)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

1

use random(1111,9999,1) ; notice the "1"

2

$String = "12345678"
$Result = StringTrimLeft($String, 2)
$Final = StringLeft($Result, 4)
MsgBox(64, "test", $Final)

8)

getting slower everyday... lol

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

  • Moderators

getting slower everyday... lol

Comes with age :)

Edit:

Just thought I'd throw another in the mix:

$String = Random(11111111, 99999999, 1)
$Middle = StringMid($String, 3, 4)
MsgBox(0, 'Middle', $String & @CR & $Middle)
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...