Jump to content

code help please


Recommended Posts

  • Developers

For the second time: Try to make the script yourself and ask questions when you have AutoIt3 issues. Try to formulate some proper questions explaining what you exactly want and stop begging for code.

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.
  :)

Link to comment
Share on other sites

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("[#] Form1 [#]", 265, 201, 192, 124)

$Label1 = GUICtrlCreateLabel("forum 1", 104, 0, 39, 17)

$Input1 = GUICtrlCreateInput("Input1", 8, 48, 113, 21)

$Label2 = GUICtrlCreateLabel("name", 8, 24, 30, 17)

$Button1 = GUICtrlCreateButton("next", 192, 96, 57, 17, $WS_GROUP)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form2 = GUICreate("[#] Form2 [#]", 266, 205, 192, 119)

$Label1 = GUICtrlCreateLabel("forum2", 8, 0, 36, 17)

$Label2 = GUICtrlCreateLabel("date", 8, 24, 25, 17)

$Input1 = GUICtrlCreateInput("Input1", 8, 40, 105, 21)

$Button1 = GUICtrlCreateButton("back", 120, 128, 57, 17, $WS_GROUP)

$Button2 = GUICtrlCreateButton("next", 192, 128, 65, 17, $WS_GROUP)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form3 = GUICreate("[#] Form3 [#]", 264, 202, 192, 124)

$Label1 = GUICtrlCreateLabel("forum3", 8, 0, 36, 17)

$Label2 = GUICtrlCreateLabel("press for back please", 32, 128, 105, 17)

$Button1 = GUICtrlCreateButton("back", 136, 160, 49, 17, $WS_GROUP)

$Button2 = GUICtrlCreateButton("exit", 200, 160, 49, 17, $WS_GROUP)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

I was new to this topic

I would like to receive information from you

Do not misunderstand me and

................................

which does not extract the same number of

dım $hh[100]

dım $zz[100]

$zz[1]=5

$zz[2]=4

$zz[5]=5

$zz[6}=1

for $kk=1 to 7

for $jj=1 to 7

ıf hh[$kk] <> $zz[$jj] then $hh[$kk]=$zz[$jj]

else

next

Why does not extract the number of

Thank you in advance

Link to comment
Share on other sites

  • Moderators

mesale0077,

We know English is not your language. Please use a translator (Google, BabelFish) before you post. If we cannot understand, we cannot help.

Q1. Look at this code.

Changes:

- Only one include list.

- Different names for all controls.

- GUIs use HIDE/SHOW.

- Functions to help logic flow:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("[#] Form1 [#]", 265, 201, 192, 124)
$Label11 = GUICtrlCreateLabel("forum 1", 104, 0, 39, 17)
$Input11 = GUICtrlCreateInput("Input1", 8, 48, 113, 21)
$Label12 = GUICtrlCreateLabel("name", 8, 24, 30, 17)
$Button11 = GUICtrlCreateButton("next", 192, 96, 57, 17, $WS_GROUP)
GUISetState(@SW_SHOW)

$Form2 = GUICreate("[#] Form2 [#]", 266, 205, 292, 219)
$Label21 = GUICtrlCreateLabel("forum2", 8, 0, 36, 17)
$Label22 = GUICtrlCreateLabel("date", 8, 24, 25, 17)
$Input21 = GUICtrlCreateInput("Input1", 8, 40, 105, 21)
$Button21 = GUICtrlCreateButton("back", 120, 128, 57, 17, $WS_GROUP)
$Button22 = GUICtrlCreateButton("next", 192, 128, 65, 17, $WS_GROUP)
GUISetState(@SW_HIDE)

$Form3 = GUICreate("[#] Form3 [#]", 264, 202, 392, 324)
$Label31 = GUICtrlCreateLabel("forum3", 8, 0, 36, 17)
$Label32 = GUICtrlCreateLabel("press for back please", 32, 128, 105, 17)
$Button31 = GUICtrlCreateButton("back", 136, 160, 49, 17, $WS_GROUP)
$Button32 = GUICtrlCreateButton("exit", 200, 160, 49, 17, $WS_GROUP)
GUISetState(@SW_HIDE)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button11
            _Form2()
    EndSwitch
WEnd

Func _Form2()
    
    GUISetState(@SW_HIDE, $Form1)
    GUISetState(@SW_SHOW, $Form2)
    
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $Button21
                GUISetState(@SW_HIDE, $Form2)
                GUISetState(@SW_SHOW, $Form1)
                Return
            Case $Button22
                _Form3()
                Return
        EndSwitch
    WEnd    

EndFunc

Func _Form3()
    
    GUISetState(@SW_HIDE, $Form2)
    GUISetState(@SW_SHOW, $Form3)
    
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $Button32
                Exit
            Case $Button31
                GUISetState(@SW_HIDE, $Form3)
                GUISetState(@SW_SHOW, $Form1)
                Return
        EndSwitch
    WEnd
    
EndFunc

Q2. I do not understand what you want to do. Do you want array $hh to be the same as array $zz? If yes then code $hh = $zz.

When posting code, please type [ c o d e ] before code and [ / c o d e ] after code. Omit spaces.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Developers

My guess looking at the second code is that you are trying to order the Array from High to Low?

If so, look at ArraySort(). The code you posted is containing many errors. Use Tidy and Aur3Check to properly format and verify your code.

This is done easily when you first install the full SciTE4AutoIt3 installer.

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.
  :)

Link to comment
Share on other sites

Relating to your first post. You need to create 3 GUI windows (forms as you call it) and use GUISwitch:

Dim $hGUI1, $hGUI2, $hGUI3
Dim $btnG1, $btnG2, $btnG3

For $i = 1 To 3
    Assign('hGUI' & $i, GUICreate('GUI Window ' & $i, 180, 50))
    Assign('btnG' & $i, GUICtrlCreateButton('Button&' & $i, 60, 10, 60, 25))
Next

_First()

Func _First()
    GUISwitch($hGUI1)
    GUISetState(@SW_SHOW, $hGUI1)
    
    While 1
        Switch GUIGetMsg()
            Case -3 ;GUI_EVENT_CLOSE
                Exit
                
            Case $btnG1
                GUISetState(@SW_HIDE, $hGUI1)
                ExitLoop
        EndSwitch
    WEnd
    _Second()
EndFunc

Func _Second()
    GUISwitch($hGUI2)
    GUISetState(@SW_SHOW, $hGUI2)
    
    While 1
        Switch GUIGetMsg()
            Case -3 ;GUI_EVENT_CLOSE
                Exit
                
            Case $btnG2
                GUISetState(@SW_HIDE, $hGUI2)
                ExitLoop
        EndSwitch
    WEnd
    _Third()
EndFunc

Func _Third()
    GUISwitch($hGUI3)
    GUISetState(@SW_SHOW, $hGUI3)
    
    While 1
        Switch GUIGetMsg()
            Case -3 ;GUI_EVENT_CLOSE
                Exit
                
            Case $btnG3
                GUISetState(@SW_HIDE, $hGUI3)
                ExitLoop
        EndSwitch
    WEnd
    _First()
EndFunc

There are few (or many more) other ways to do this example.

About the array, what are you trying to achieve?

Link to comment
Share on other sites

#include <Array.au3>

Dim $a1[100], $i

For $i = 0 To UBound($a1)-1
    $a1[$i] = Random(1, 100, 1)
Next

$i = 0

While $i < UBound($a1)-1
    Local $Tmp = $a1[$i]
    Local $j = _ArraySearch($a1, $Tmp, $i+1)
    
    If $j <> -1 Then
        _ArrayDelete($a1, $j)
    Else
        $i += 1
    EndIf
WEnd

_ArrayDisplay($a1)
_ArraySort($a1)
_ArrayDisplay($a1)oÝ÷ ØV¬µêíyÈg«jëh×6$i = 0
$j = 1

While $i < UBound($a1)-1
    Local $Tmp = $a1[$i]
    $j = _ArraySearch($a1, $Tmp, $j)
    
    If $j <> -1 Then
        _ArrayDelete($a1, $j)
    Else
        $i += 1
        $j = $i + 1
    EndIf
WEnd

Edited by Authenticity
Link to comment
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
 Share

  • Recently Browsing   0 members

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