Sign in to follow this  
Followers 0
ismael

as I replace the jump of goto?

4 posts in this topic

hi

as I replace the jump of goto?,concretely example q I give you

1 goto,jump

2 Send("{xxxx}")

3 WinSetState("xxxxx -", "", @SW_SHOW)

4 label, jump

5 Run("notepad")

6 Send("hello")

7 exit

as I can replace the jump ?thanks :whistle:

Share this post


Link to post
Share on other sites



As I'm sure you've realized, the command "goto" does not exist in autoit v3+. Instead, look into using if-elseif statements, and function calls.

if ... then
;do what you want to here
elseif ... then
;do something else here
else
;if all else fails...
endif

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

For that simple example, like this:

If 0 Then
  Send("{xxxx}")
  WinSetState("xxxxx -", "", @SW_SHOW)
EndIf
Run("notepad")
Send("hello")
Exit
oÝ÷ ØZ+Þr©ì^Å©©ëºÚ"µÍÎÎÐZÝYBÚ[HHÑÝX[ÎÈZÝYÛÛ[YSÛÜÒHØ[È[ÈÝX[ÎÈZÝYÂ^]ÛÜÒHØ[È[ÈÙXÛÛX[ÎÈZÝY^]ÛÜÑ^]HÛÜÙ[ÔÙXÛÛX[ÎÐZÝYB

You get the point. =) But I wouldn't recommend it. Use functions instead.

#)

Edited by nfwu

Share this post


Link to post
Share on other sites

hi :D

friend watches, it works :lmao:

$salto=Random(1,3,1)

If $salto = 1 Then

MsgBox(4096, "salto nº1", $salto, 10)

EndIf

If $salto = 2 Then

MsgBox(4096, "salto nº2", $salto, 10)

EndIf

If $salto = 2 Then

MsgBox(4096, "salto nº3", $salto, 10)

EndIf

---------------------------------------------------------------------------------

when I add to him this function does not work :whistle:

it reports east error "If" statement has no matching "EndIf" statement.:

it also reports east error with While... WEnd

it also reports east error with Do...Until

;aleatorio

$salto=Random(1,3,1)

If $salto = 1 Then

MsgBox(4096, "salto nº1", $salto, 10)

;abrir google

#include <IE.au3>

$oIE = _IECreate ("http://www.google.com")

$oForm = _IEFormGetCollection ($oIE, 0)

$oQuery = _IEFormElementGetCollection ($oForm, 1)

_IEFormElementSetValue ($oQuery, "autoit")

_IEFormSubmit ($oForm)

EndIf

If $salto = 2 Then

MsgBox(4096, "salto nº2", $salto, 10)

;abrir altavista

#include <IE.au3>

$oIE = _IECreate ("http://www.altavista.com")

$oForm = _IEFormGetCollection ($oIE, 0)

$oQuery = _IEFormElementGetCollection ($oForm, 1)

_IEFormElementSetValue ($oQuery, "autoit")

_IEFormSubmit ($oForm)

EndIf

If $salto = 3 Then

MsgBox(4096, "salto nº3", $salto, 10)

;abrir yahoo

#include <IE.au3>

$oIE = _IECreate ("http://search.yahoo.com")

$oForm = _IEFormGetCollection ($oIE, 0)

$oQuery = _IEFormElementGetCollection ($oForm, 1)

_IEFormElementSetValue ($oQuery, "autoit")

_IEFormSubmit ($oForm)

EndIf

:P who exempt gotooooooooo,jejejejej

chuuuuuuu :P

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