Sign in to follow this  
Followers 0
d4rk

a While - WEnd issue

8 posts in this topic

hello every1,

i have a problem like this .... As you can see, if you press "d" so the $Count=$Count+1 and write to the console, but the problem that : It in a loop (While) , so it will count to a great great number with just a 'd' pressed ... and i can't give any more idea how to keep coding with it ... but if i strip it out the loop, so it exit after running for a few seconds ...

It would be great to receive some help !

Thanks

$String="duy"
$Array=StringSplit($String,"")
;_ArrayDisplay($Array,"")
$Count=0


while 1
_Start()
WEnd

Func _Start()
Select
    Case _IsPressed(_StringToHex(StringUpper(StringLeft($String,1))))
    $Count=$Count+1
    ConsoleWrite($Count)

EndSelect
EndFunc

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites



After to catch that it is pressed, wait for it to be released. Keep a value waiting and if the value is true, wait for the key to be released before checking to see if it's pressed again.

This also belongs in support, not chat.

Share this post


Link to post
Share on other sites

OMG :):P :P, i'm even didn't know , i'm using View New Posts but i think i'm in General and support forum ,i'm sorry

... and about your post, can you tell me a little more ?


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I doubt that your God cares which forum you posted to.

Try this code:

#include <misc.au3>
#include <string.au3>


$String = "duy"
$Array = StringSplit($String, "")
;_ArrayDisplay($Array,"")
$Count = 0


While 1
    _Start()
WEnd

Func _Start()
    Select
        Case _IsPressed(_StringToHex(StringUpper(StringLeft($String, 1))))
            $Count = $Count + 1
            ConsoleWrite($Count)
            Do
                Sleep(100)
            Until Not _IsPressed(_StringToHex(StringUpper(StringLeft($String, 1))))
    EndSelect
EndFunc   ;==>_Start
Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks you both


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

I doubt that your God cares which forum you posted to.

Try this code:

#include <misc.au3>
#include <string.au3>


$String = "duy"
$Array = StringSplit($String, "")
;_ArrayDisplay($Array,"")
$Count = 0


While 1
    _Start()
WEnd

Func _Start()
    Select
        Case _IsPressed(_StringToHex(StringUpper(StringLeft($String, 1))))
            $Count = $Count + 1
            ConsoleWrite($Count)
            Do
                Sleep(100)
            Until Not _IsPressed(_StringToHex(StringUpper(StringLeft($String, 1))))
    EndSelect
EndFunc   ;==>_Start
hjgjgh

HotKeySet("","addcode")
HotKeySet("","alldone")

while 1


            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
            




  
  
    Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
  


        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
Richard Robertson   

    
        
    
             186
    
        
    

        
            
                Universalist
            
            

            
                

    
        
    

            
            Active Members
            
            
                

    
        
    
             186
    
        
    

                10,165 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #8 · 
            Posted 
            
            
            
        
    

    


            
        
            hjgjgh
 

HotKeySet("","addcode")

HotKeySet("","alldone")

while 1

Martin, what was that?

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