Sign in to follow this  
Followers 0
KnALLE

Called Function Not Executed

5 posts in this topic

Greetings,

try to understand how doing the modern way without goTo, but it isnt working.

The following code has no error, but it isnt executing a select line. It is working through, till the WinWaitActive line after EndSelect, please have a look:

$one = 1
$multible = 2
Do
    WinWaitActive("Registrierungs-Editor", "Arbeitsplatz")
    Send("{ENTER}")
    Select
    Case WinExists("Zeichenfolge bearbeiten", "Abbrechen")
        Call("_oneLine" & $one)
    Case WinExists("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen")
        Call("_multibleLines" & $multible)
    EndSelect
    WinWaitActive("Registrierungs-Editor", "Arbeitsplatz")
    Send("{F3}")
Until WinActive("Registrierungs-Editor", "Das Durchsuchen der Registrierung ist beendet")

#region; section for functions
Func _oneLine($one)
    Send("{CTRLDOWN}c{CTRLUP}")
    WinActivate("Unbenannt - Editor","")
    WinWaitActive("Unbenannt - Editor","")
    Send("{CTRLDOWN}v{HOME}{CTRLUP}")
    Do
        Send("{F3}")        Send("{SHIFTDOWN}f.{SHIFTUP}{CTRLDOWN}{ALTDOWN}ß{CTRLUP}{ALTUP}")
    Until WinExists("Editor", "kann nicht gefunden werden.")
    Send("{Space}")
    Send("{CTRLDOWN}ax{CTRLUP}")
    WinActivate("Zeichenfolge bearbeiten","Abbrechen")
    WinWaitActive("Zeichenfolge bearbeiten","Abbrechen")
    Send("{CTRLDOWN}v{CTRLUP}{ENTER}")
    Return
EndFunc

Func _multibleLines($multible)
    Send("{CTRLDOWN}c{CTRLUP}")
    WinActivate("Unbenannt - Editor","")
    WinWaitActive("Unbenannt - Editor","")
    Send("{CTRLDOWN}v{HOME}{CTRLUP}")
    Do
        Send("{F3}")        Send("{SHIFTDOWN}f.{SHIFTUP}{CTRLDOWN}{ALTDOWN}ß{CTRLUP}{ALTUP}")
    Until WinExists("Editor", "kann nicht gefunden werden.")
    Send("{Space}")
    Send("{CTRLDOWN}ax{CTRLUP}")
    WinActivate("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen")
    WinWaitActive("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen")
    Send("{CTRLDOWN}v{CTRLUP}{ENTER}")
    Return
EndFunc

KnALLE

Share this post


Link to post
Share on other sites



what should this line do?

Call("_oneLine" & $one)

It will try to perform function: _oneLine1() which doesn't exists.......


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

HI,

try this:

$one = 1
$multible = 2
Do
    WinWaitActive("Registrierungs-Editor", "Arbeitsplatz")
    Send("{ENTER}")
    Select
    Case WinExists("Zeichenfolge bearbeiten", "Abbrechen")
        _oneLine(1)
    Case WinExists("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen")
        Call("_multibleLines" & $multible)
    EndSelect
    WinWaitActive("Registrierungs-Editor", "Arbeitsplatz")
    Send("{F3}")
Until WinActive("Registrierungs-Editor", "Das Durchsuchen der Registrierung ist beendet")

#region; section for functions
Func _oneLine($one)
    Send("{CTRLDOWN}c{CTRLUP}")
    WinActivate("Unbenannt - Editor","")
    WinWaitActive("Unbenannt - Editor","")
    Send("{CTRLDOWN}v{HOME}{CTRLUP}")
    Do
        Send("{F3}")        
        Send("{SHIFTDOWN}f.{SHIFTUP}{CTRLDOWN}{ALTDOWN}ß{CTRLUP}{ALTUP}")
    Until WinExists("Editor", "kann nicht gefunden werden.")
    Send("{Space}")
    Send("{CTRLDOWN}ax{CTRLUP}")
    WinActivate("Zeichenfolge bearbeiten","Abbrechen")
    WinWaitActive("Zeichenfolge bearbeiten","Abbrechen")
    Send("{CTRLDOWN}v{CTRLUP}{ENTER}")
    Return
EndFunc

Func _multibleLines($multible)
    Send("{CTRLDOWN}c{CTRLUP}")
    WinActivate("Unbenannt - Editor","")
    WinWaitActive("Unbenannt - Editor","")
    Send("{CTRLDOWN}v{HOME}{CTRLUP}")
    Do
        Send("{F3}")       
        Send("{SHIFTDOWN}f.{SHIFTUP}{CTRLDOWN}{ALTDOWN}ß{CTRLUP}{ALTUP}")
    Until WinExists("Editor", "kann nicht gefunden werden.")
    Send("{Space}")
    Send("{CTRLDOWN}ax{CTRLUP}")
    WinActivate("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen")
    WinWaitActive("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen")
    Send("{CTRLDOWN}v{CTRLUP}{ENTER}")
    Return
EndFunc

So long,

Mega

GERMAN: KnALLE: Wenn du die Übergabe-Parameter nicht nutzt, dann kannst du sie auch gleich weglassen und der Funktion nicht übergeben. Es gibt auch ein deutsches Forum und ein deutsches Help-File.


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

I would do somthing like this

$one = 1
$multible = 2
do
    ConsoleWrite("Do select case" & @LF)
    Select
        
        Case 1 = WinWaitActive("Untitled -", "", 1); You need a timeout on WinWaitActive
            _oneLine($one )                       ;Normal function call
        Case 1 = WinExists("C:\","")
                        Call("_multibleLines",  $multible ) ;You used & rather than a seperator ","
        case else 
            ConsoleWrite("NOTHING DONE: @errror:=" & @error & @LF)
    EndSelect
    sleep(1000) 
Until GUIGetMsg() = -3

#region; section for functions
Func _oneLine($one)
    Msgbox(0,"MSG", "_oneLine(" & $one & ")",10)
EndFunc

Func _multibleLines($multible)
    Msgbox(0,"MSG", "_multibleLines(" & $multible & ")",10)
EndFunc

This works on my system. Scite has "C:\" as its window title. Notepad should be easy to start.

Share this post


Link to post
Share on other sites

Solution is working perfectly

As JdeB has pointed out I call a function which is not present because of the missed parameter.

And right th.meger I dont work which these parameters before, but the Call- command only works with a parameter.

So Im happy with the following code to make this TabletPC System independent from his first Partition.

$one = 1
$multible = 2
Do
    WinWaitActive("Registrierungs-Editor", "Arbeitsplatz")
    Send("{ENTER}")
    Select
    Case WinExists("Zeichenfolge bearbeiten", "Abbrechen")
        _line(1)
    Case WinExists("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen")
        _lines(2)
    EndSelect
    WinWaitActive("Registrierungs-Editor", "Arbeitsplatz")
    Send("{F3}")
Until WinExists("Registrierungs-Editor", "Das Durchsuchen der Registrierung ist beendet")
Exit

#region; section for functions
Func _line($one)
    Send("{CTRLDOWN}c{CTRLUP}")
    WinActivate("Unbenannt - Editor","")
    WinWaitActive("Unbenannt - Editor","")
    Send("{CTRLDOWN}v{HOME}{CTRLUP}")
    Do
        Send("{F3}")
        Send("{SHIFTDOWN}f.{SHIFTUP}{CTRLDOWN}{ALTDOWN}ß{CTRLUP}{ALTUP}")
    Until WinExists("Editor", "kann nicht gefunden werden.")
    Send("{Space}")
    Send("{CTRLDOWN}ax{CTRLUP}")
    WinActivate("Zeichenfolge bearbeiten","Abbrechen")
    WinWaitActive("Zeichenfolge bearbeiten","Abbrechen")
    Send("{CTRLDOWN}v{CTRLUP}")
    ControlClick("Zeichenfolge bearbeiten", "Abbrechen", 1)
    Return
EndFunc

Func _lines($multible)
    Send("{CTRLDOWN}c{CTRLUP}")
    WinActivate("Unbenannt - Editor","")
    WinWaitActive("Unbenannt - Editor","")
    Send("{CTRLDOWN}v{HOME}{CTRLUP}")
    Do
        Send("{F3}")
        Send("{SHIFTDOWN}f.{SHIFTUP}{CTRLDOWN}{ALTDOWN}ß{CTRLUP}{ALTUP}")
    Until WinExists("Editor", "kann nicht gefunden werden.")
    Send("{Space}")
    Send("{CTRLDOWN}ax{CTRLUP}")
    WinActivate("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen")
    WinWaitActive("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen")
    Send("{CTRLDOWN}v{CTRLUP}")
    ControlClick("Mehrteilige Zeichenfolge bearbeiten", "Abbrechen", 1)
    Return
EndFunc

In former times of NT4.0 the system was so concise, that this was possible doing manually

good old days. And with the hint from Uten I keep it as well as with such old systems:

· Never change it as long as it is working out what you want, NEVER. Gladly next time, thank you.

KnALLE, improve his English because of staying abroad soon :)

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