Jump to content
Sign in to follow this  
erikson

counter question

Recommended Posts

erikson

hi

i have a script that write me into a file, the content of clibboard, when that content changes.

i whant to put a counter on that

the content of that file to be something like this:

1

line content blah blah

2

line 2 content etc etc

3

line 3 content

the the problem is that i dont`k know how to make the script to count the actions

i atach a piece of script that make the filewrite

Func MY_DEL()
    Local $timer
    ConsoleWrite("Old clip:  " & ClipGet() & @CRLF)
    _Clipboard_Wait('ClipPut("")')
    $timer = TimerInit()
    _Clipboard_Wait('Send("^c")')
    MsgBox(0, "", "Waited:  " & TimerDiff($timer) & @CRLF & @CRLF & ClipGet(),1)
    $file="c:\raport.txt"
    $ordin=1
    
FileOpen  ($file, 1)
filewrite ($file ,ClipGet())
FileWrite ($file,@CRLF & @crlf)
FileClose ($file)

cand anybody give me a hint?

Share this post


Link to post
Share on other sites
Valik

cand anybody give me a hint?

Here's a hint. Try posting on the correct forum next time. The examples forum is not where you ask for support.

Share this post


Link to post
Share on other sites
PsaltyDS

cand anybody give me a hint?

Just create a Global variable (i.e. Global $iCount = 0) that you can increment and write to the file as required. If this count has to be kept across executions of the script, you could read the file to find the last count then increment, or keep it in a separate .ini file, or keep it in a registry key, etc., etc..

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.