Jump to content

Recommended Posts

Posted

hi there,

i wana use

if then, else if statement. i put this

If ProcessExists (help.Exe) Then

MsgBox(4096,"", "Value might be hexadecimal!")

Else

ShellExecute ("help.exe")

EndIf

simply i want my application to do nothing if the help.exe in alredy opened, but it uses condition MsgBox(4096,"", "Value might be hexadecimal!"). please tell me how i can fix it.

Posted

If you don't want it to do anything under one condition, then you don't need an else.

If Not ProcessExists("help.exe") then ShellExecute("help.exe")

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Posted

actually if the help file is already opened, it should not do anything. and if not opened then it should open help.exe through shell execute.

If you don't want it to do anything under one condition, then you don't need an else.

If Not ProcessExists("help.exe") then ShellExecute("help.exe")
Posted

skruge's solution does what you are asking.

Alternatively you could also simply comment out (or delete) the MsgBox line:

If ProcessExists(help.Exe) Then
    ;MsgBox(4096, "", "Value might be hexadecimal!")
Else
    ShellExecute("help.exe")
EndIf

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Posted

leaving blank msg box do not show any msg. :D wen i del the complete msg box line, it show the error for then condition

is there any command to pause script?

no way without box?

:o

skruge's solution does what you are asking.

Alternatively you could also simply comment out (or delete) the MsgBox line:

If ProcessExists(help.Exe) Then
    ;MsgBox(4096, "", "Value might be hexadecimal!")
Else
    ShellExecute("help.exe")
EndIf
Posted

If you just want to pause it for a set period of time use sleep()

If you want to pause it till a certain condition

while $condition = false

sleep(100)

wend

or

do

sleep(100)

untill $condition = true

Giggity

Posted

@ youknowwho

i wana use shell execute as a "else" statement

this (If ProcessExists("help.exe") = 0 then ShellExecute("help.exe)

shows this

C:\Documents and Settings\vindos\Desktop\new.au3(1,52) : ERROR: syntax error (illegal character)

If ProcessExists("help.exe") = 0 then ShellExecute("

:D

Posted

i've been using "" :D

sleep(100)

untill $condition = true

it will just make sleep for some moments

what if i use

sleep(2147483647) for 24 day?????

lol

Posted

no a do until loop will sleep until the set condition is true. What ever you want to set that condition to.

Same with the while loop except inverse. It will repeat the sleep until the condition is no longer not true (so I guess not inverse)

Giggity

Posted

can u paste my complete script with your idea

actually i cant understand

$condition=true

here

If ProcessExists("help.Exe") Then

sleep(100)

untill $condition=true

Else

ShellExecute("help.exe")

EndIf

is it correct?

  • Developers
Posted (edited)

can u paste my complete script with your idea

actually i cant understand

$condition=true

here

If ProcessExists("help.Exe") Then

sleep(100)

untill $condition=true

Else

ShellExecute("help.exe")

EndIf

is it correct?

Try learning some programming/scrip basics before starting to script.

Open the helpfile and look at the commands used in your little piece of code and sort out what is wrong.

Learn....

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Guest
This topic is now closed to further replies.
×
×
  • Create New...