Sign in to follow this  
Followers 0
tryout1

problem with stringmid help a newbie ? PLZ

4 posts in this topic

i have write this lines :

;open file .txt

$file = FileOpen("new.txt", 0)

; extract 2 caracters

$var1=StringMid($file,7,2)

ClipPut($var1)

why it not put on clipboard the 2 characters ?

(my file new.txt is :

123456789)

thanks

Share this post


Link to post
Share on other sites



You're using the $file var to search it, FileOpen ($File) only returns an handle, not what the text says, look at FileReadLine() or FileRead().


[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)

i have write this lines :

;open file .txt

$file = FileOpen("new.txt", 0)

; extract 2 caracters

$var1=StringMid($file,7,2)

ClipPut($var1)

why it not put on clipboard the 2 characters ?

(my file new.txt is :

123456789)

thanks

so, something like:

$s_File = FileRead("new.txt", FileGetSize("new.txt"))
ClipPut(StringMid($s_File, 7, 2))

EDIT: Gah, smoke is the fastest gun around here!!

Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

TX TX TX TX I TRY THIS

TX FOR EXPLICATIONS

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