Sign in to follow this  
Followers 0
liquidwater

Problem with output of a count variable

5 posts in this topic

Hallo,

kurze Frage zu folgendem Problem. Ich habe unten mal einen Auszug aus meinem Code.

Wenn ich das Programm starte wird in die Datei folgende Zeile geschrieben:

----- Script gestartet ----- Durchlauf: 1

In der nächsten Zeile müsste jetzt ja stehen:

Bin gestartet, Durchlauf: 1

allerdings wird dort ausgegeben:

Bin gestartet, Durchlauf: 3020871

Am Ende meiner while Schleife wird die Variable $ScriptCount immer um 1 erhöht, das funktioniert auch, allerdings wird nicht aus 1 - 2 sondern aus 3020871 wird 3020872.

Die Zahl ist immer unterschiedlich wenn das Script erneut gestartet wird, was mache ich hier falsch?

...

$ScriptCount = 1

FileWrite($file, "----- Script gestartet ----- Durchlauf: " & $ScriptCount & @CRLF)

While $run
    if($gestartet) then
        FileWrite($file, "Bin gestartet, Durchlauf:" & $ScriptCount & @CRLF)

...

Vielen Dank für eure Hilfe!

Share this post


Link to post
Share on other sites



This is an english speaking forum:

Translation:

Hello,

quick question to the following problem. I have times below an excerpt from my code.

When I start the program is written to the file the following line:

----- Start script ----- pass 1

The next line should be so now:

I started by running: 1

However, there is displayed:

I started, run: 3020871

At the end of my while loop, the script variable $ count is incremented by 1, that works too, but not from 1-2 but out of 3,020,871 is 3,020,872th

The number is always different when the script is started again, what am I doing wrong?


ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Share this post


Link to post
Share on other sites

Sorry, my mistake. Started the topic in english and completed the post in German. :o)

Share this post


Link to post
Share on other sites

I think the variable $ScriptCount is changed somewhere else in your script. Do you pass the variable to a function as parameter or something similar?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks, I finally figured it out. The Problem was a while loop. So this topic is solved. :)

Thanks all and sorry again for the "german start". :)

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