Sign in to follow this  
Followers 0
manmoncang

Intelligent Password Adn Random No

4 posts in this topic

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

Share this post


Link to post
Share on other sites



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

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

[center]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.[/center]

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