Sign in to follow this  
Followers 0
Saymaad Mansoor

How to make this for & next loop stop ?

3 posts in this topic

I created a small script :

#NoTrayIcon

#include <GUIConstants.au3>

If $CmdLine[1] = "FadeIn" Then

For $i = 1 to 255

WinSetTrans ($CmdLine[2], "", $i )

Next

ElseIf $CmdLine[1] = "FadeOut" Then

For $i = 255 to 1 Step -1

WinSetTrans ($CmdLine[2], "", $i )

If $i = 1 Then

Exit

EndIf

Next

EndIf

But when I use it with command line prameter :

example "FadeOut" "Untitled - Notepad"

it keeps notepad fadeout again and again and wuit after some random execution of the for & next loop.

please help me if I am doing something wrong, or atleast tell me the prob and howto fix it I've spent 4 hours but no work around :D

Share this post


Link to post
Share on other sites



The program works for me. You can take out the If $i = 1 Then exit part


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

Works for me too...you can also add

If NOT WinExists($CmdLine[2]) Then
    MsgBox(0,"Error","Window not found or not enough parameters")
    Exit
EndIf

just below your #includes to make sure that the second parameter is a valid window.

This is a pretty slick-looking script - nice and simple. Gives me ideas :D


"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

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