Jump to content
Sign in to follow this  
forever0donotknowme

loop

Recommended Posts

forever0donotknowme

hi my friends,

I do script but I can not get code that return me to main form

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("main form", 442, 169, 192, 124)
$Input1 = GUICtrlCreateInput("", 112, 56, 201, 21)
$Label1 = GUICtrlCreateLabel("type any thing in following box for display in message", 24, 24, 387, 28)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("display", 272, 96, 131, 33)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("Exit", 80, 96, 107, 33)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  case $Button1
   if $Input1 <>"" Then
    MsgBox(0,"", GUICtrlRead($input1))
   Else
    MsgBox(0,""," you do not enter any thing in box therefor you will return to main form")
    ;what is script that return to main form
   EndIf
   case $Button2
    Exit
EndSwitch
WEnd

What is script that return to main form if $input =0

Share this post


Link to post
Share on other sites
Kyan

first you read the input, then you can check if is something in it

case $Button1
$readInput = GUICtrlRead($input1)
if $readInput <> "" Then
MsgBox(0,"", $readInput)
Else
MsgBox(0,"","you do not enter any thing in box therefor you will return to main form")
;what is script that return to main form
EndIf

....

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
forever0donotknowme

case $Button1
    $readInput = GUICtrlRead($input1)
    if $readInput ="" Then
     Exit
    ; do not work any thing
    ;what is script that return to main form
   Else
    MsgBox(0,""," you do not enter any thing in box therefor you will return to main form")
MsgBox(0,"", $readInput)

   EndIf

i want to return to main form if input =" "

Share this post


Link to post
Share on other sites
Kyan

return? like without showing up a msgbox? if so just remove this part

Else
MsgBox(0,""," you do not enter any thing in box therefor you will return to main form")
;what is script that return to main form

btw, you can check help file for any command/function by pressing F1 (the command/func. needs to be clicked before hit F1)

Edited by DiOgO

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
EndFunc

case $Button1
$readInput = GUICtrlRead($input1)
if $readInput ="" Then
     Exit
; do not work any thing
;what is script that return to main form
Else
MsgBox(0,""," you do not enter any thing in box therefor you will return to main form")
MsgBox(0,"", $readInput)

EndIf

i want to return to main form if input =" "

Try this instead. Do not use EXIT. that will terminate the script instead of returning you to the form and continuing the loop.

case $Button1
$readInput = GUICtrlRead($input1)
if $readInput ="" Then
MsgBox(0,""," you do not enter any thing in box therefor you will return to main form")
ContinueLoop
; return to main form
Else
MsgBox(0,"", $readInput)

EndIf
Edited by EndFunc

EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites
somdcomputerguy

If $readInput is blank (= "") Then just do nothing.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
forever0donotknowme

Try this instead. Do not use EXIT. that will terminate the script instead of returning you to the form and continuing the loop.

case $Button1
$readInput = GUICtrlRead($input1)
if $readInput ="" Then
MsgBox(0,""," you do not enter any thing in box therefor you will return to main form")
ContinueLoop
; return to main form
Else
MsgBox(0,"", $readInput)

EndIf

thanks my sir

really you help me.

Share this post


Link to post
Share on other sites
forever0donotknowme

thanks my sir for help

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  

  • Similar Content

    • Schneeflocke
      By Schneeflocke
      #RequireAdmin
      #include <NomadMemory.au3>
      $Value = _Pointer()
      MsgBox(0,"", "Value: " = $Value)
      Func _Pointer()
      Global $iBase = 0x7FF649DB0000, $iStaticofsset = 0x01559C08
      Global $hOpen, $sRead
      $hOpen = _MemoryOpen(ProcessExists("Tutorial-i386.exe"))
      $sRead = _Memoryread($iBase + $iStaticoffset, $hOpen, 'Float') + 0x70
      $sRead = _Memoryread($iBase + $iStaticoffset, $hOpen, 'Float') + 0xA0
      $sRead = _Memoryread($iBase + $iStaticoffset, $hOpen, 'Float') + 0x20
      $sRead = _Memoryread($iBase + $iStaticoffset, $hOpen, 'Float') + 0x1B0
      $sRead = _Memoryread($iBase + $iStaticoffset, $hOpen, 'Float') + 0x40
      $sRead = _Memoryread($iBase + $iStaticoffset, $hOpen, 'Float') + 0x10
      $sRead = _Memoryread($iBase + $iStaticoffset, $hOpen, 'Float') + 0x368
      $sValue = _Memoryread($sRead, $hOpen, 'Float')
      _MemoryClose($hOpen)
      Return $sValue
      EndFunc
      I Would like to create an Round Timer and Kers BoT for Assetto Corsa.
      Intelliboost need too many Performance
    • Pagi
      By Pagi
       
      <a href="index.php=4143b27b41db0a40c499202865c3e24d" class="menuitem " target="\_self"> "Menu Item 1" </a>
      Can you tell me if it´s possible to click this menu button? If yes, how? Cause I have no idea, I think i should use _IETagNameGetCollection
    • milkmoron
      By milkmoron
      https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/?do=findComment&comment=1156373 At least we have an element title: [Entered By:] class: [WindowsForms10.EDIT.app.0.30495d1_r9_ad1] Having the following values for all properties: Title is: <Entered By:> Class := <WindowsForms10.EDIT.app.0.30495d1_r9_ad1> controltype:= <UIA_EditControlTypeId> ,<50004> , (0000C354) 322;370;736;184 *** Parent Information top down *** 3: Title is: <View Activity> Class := <WindowsForms10.Window.8.app.0.30495d1_r9_ad1> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370) 306;72;784;605 "Title:=View Activity;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1"" 2: Title is: <> Class := <WindowsForms10.Window.8.app.0.30495d1_r9_ad1> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) 314;103;768;542 "Title:=;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1"" 1: Title is: <> Class := <WindowsForms10.Window.8.app.0.30495d1_r9_ad1> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) 314;103;749;451 "Title:=;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1"" 0: Title is: <Delete> Class := <WindowsForms10.Window.8.app.0.30495d1_r9_ad1> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) 314;122;749;432 "Title:=Delete;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1"" ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=View Activity;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1") ;View Activity _UIA_setVar("oP2","Title:=;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1") ; _UIA_setVar("oP3","Title:=;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1") ; _UIA_setVar("oP4","Title:=Delete;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1") ;Delete _UIA_setVar("EnteredBy:.mainwindow","title:=Entered By:;classname:=WindowsForms10.EDIT.app.0.30495d1_r9_ad1") ;~ Actions split away from logical/technical definition above can come from configfiles ;~_UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") ;~_UIA_Action("oP2","highlight") _UIA_Action("oP2","setfocus") ;~_UIA_Action("oP3","highlight") _UIA_Action("oP3","setfocus") ;~_UIA_Action("oP4","highlight") _UIA_Action("oP4","setfocus") _UIA_action("EnteredBy:.mainwindow","setfocus") ;~ *** Standard code Flexible*** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP3=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=View Activity;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1", $treescope_children) _UIA_Action($oP3,"setfocus") Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1", $treescope_children) _UIA_Action($oP2,"setfocus") Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1", $treescope_children) _UIA_Action($oP1,"setfocus") Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=Delete;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1", $treescope_children) _UIA_Action($oP0,"setfocus") _UIA_setVar("EnteredBy:.mainwindow","title:=Entered By:;classname:=WindowsForms10.EDIT.app.0.30495d1_r9_ad1") _UIA_action("EnteredBy:.mainwindow","setfocus") Need some help selecting this defining it as a variable to save and then insert the text within, to the same application but different account.
    • PleaseHelpMEIWillLoveyou
      By PleaseHelpMEIWillLoveyou
      Is there a way to use a custom terminal or something from my pc and run a script on another pc.
      please let me know if its possible
      (not for anything bad just for a project im working on)
    • kelso
      By kelso
      Hello Guru's,
       
      I'm trying to write an autoit script to select from the dropdown list as you see in the attached picture. 
      I read the help page for _IEFormElementOptionSelect, but I cannot grasp how to correlate that with the source code that I'm seeing. any suggestions?

×