Jump to content

Recommended Posts

Posted (edited)

yes i didn't do any megic lol.. i will give the credit..

I forgot about that..

Edited by Guest
Posted (edited)

  On 2/25/2013 at 12:01 AM, 'gil900 said:

line 1:

for what the Local $iPID = 0 ?

line 2:

for what the "Const" and what Const do?

line 3-4:

If FileExists($sNirPath) Then

Local Const $iValue = (Int($iPercent) / 100) * 65535

Run($sNirPath & ' setsysvolume ' & $iValue)

EndIf

??

why use if?

why use Int($iPercent) and not just $iPercent ?

line 5:

again for what the $iPID?

In lieu of guinness I will try to answer.

1 $PID is a variable to hold the return value of Run(), guinness just forgot to add it.

2 Const is a Keyword it keeps the data variable it is assigned to from being altered.

3 Use if in the case that the file does not exist

4 Use int($iPercent) in the case it arrives as a sting, there is a math function being performed with it you see

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

  On 2/25/2013 at 12:08 AM, 'gil900 said:

yes i didn't do any megic lol.. i will give the credit..

I forgot about that..

While you are at it, be wise, and just change this line

Run($nircmd & "nircmd.exe setsysvolume "&$a_Val) to Run($nircmd & "setsysvolume "&$a_Val)

Unless you know better, or enjoy the headaches you will get over it.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

Thanks JohnOne. I fixed that $iPID issue.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

  On 2/25/2013 at 12:22 AM, 'JohnOne said:

While you are at it, be wise, and just change this line

Run($nircmd & "nircmd.exe setsysvolume "&$a_Val) to Run($nircmd & "setsysvolume "&$a_Val)

Unless you know better, or enjoy the headaches you will get over it.

ok i did it.

actually i didn't used nircmd in that way in my previous scripts..

i meen that i always wrote $nircmd & "setsysvolume "& $SOME_Variable

but it seems that now i did mistake and thought it was fine because it worked ..

Edited by Guest
Posted (edited)

  On 2/25/2013 at 12:31 AM, 'gil900 said:

ok i did it.

actually i didn't used nircmd in that way in my previous scripts..

i meen that i always wrote $nircmd & "setsysvolume "&SOME_Variable

but it seems that now i did mistake and thought it was fine because it worked ..

Great, you learned something, you'll get a lot of that here :)

Just try not to be so defensive about your code, it's generally good constructive advice you get from the men in blue (MVP)

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

I'm not worried if they didn't believe me, it's just when multiple members jump on-board stating the mistake, then it's time to pay attention..

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...