Jump to content

problem with stringmid help a newbie ? PLZ


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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().

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

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