Jump to content

Problem with output of a count variable


Recommended Posts

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!

Link to comment
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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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