AutoHotkey Community

It is currently May 27th, 2012, 11:59 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: November 17th, 2010, 4:28 pm 
Offline
User avatar

Joined: July 17th, 2008, 12:58 am
Posts: 270
there is some wierd behavior in my script that i cant explain

when i copy some data from one edit control and try to paste it with "ctrl+v" to another edit control it wont do anything or sometimes the list of global variables comes up

when i rightclick and select paste from the menu it works like normal

anyone knows what could be causing this?

_________________
QuickSubs | Popcorn Movie Db
All my scripts are just in AutoHotkey v1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2010, 7:23 pm 
Offline

Joined: February 29th, 2008, 8:36 pm
Posts: 901
Location: Vault 7
What happens if you paste to notepad or something outside your script?

But it seems like Ctrl+v is the problem... Does this happen with a simple GUI (none of the rest of your script, just 2 edit controls)?

_________________
ImageDebugging,Container,FileContainer,Object Preferences,ShellFileOperation


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2010, 7:29 pm 
Offline

Joined: June 4th, 2010, 9:04 pm
Posts: 1347
Location: california
I'm not quite sure under what conditions your control+v seems to fail, but I have noticed that with some games I play the control key doesn't work at all if I have the SciTE editor open at the same time while testing my program. It seems to me that the editor is intercepting the control keystroke. What I generally end up doing is saving my work, shutting down the editor, and then checking if the Control key works. I have to do this each time I need to use the Control key in my target application. Hope this helps.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2010, 7:52 pm 
Offline
User avatar

Joined: July 17th, 2008, 12:58 am
Posts: 270
it works normally on a more simple gui with 2 edit controls and i can paste it also to notepad without a problem

i tried also shutting down my editor but same thing

what i dont understand is why the list of global variables comes up

_________________
QuickSubs | Popcorn Movie Db
All my scripts are just in AutoHotkey v1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2010, 8:02 pm 
Offline

Joined: February 29th, 2008, 8:36 pm
Posts: 901
Location: Vault 7
For sanity, search your scripts for ^v and ListVars. Also right click on the tray icon and check what hotkeys they are covering. If nothing interesting is found, start deleting parts of your script until you get down to a bare minimum that still produces the problem. Try to delete about half of the remaining script each time. If it is a bug, this is the quickest way to find it.

Longshot: do you have Windows updates that need you to restart? I've had scripts do very strange things after installing updates but before restarting.

_________________
ImageDebugging,Container,FileContainer,Object Preferences,ShellFileOperation


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2010, 10:12 pm 
Offline
User avatar

Joined: July 17th, 2008, 12:58 am
Posts: 270
i did a search and didnt find anything interesting

no i dont have any windows updates that need restarting

i remember it worked some while ago so i guess i have to go the hard way and start deleting parts of my script like you said

but its going to be a real pain in the *ss on a 3000 line script :x

thanks for your answers 8)

_________________
QuickSubs | Popcorn Movie Db
All my scripts are just in AutoHotkey v1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2010, 10:17 pm 
Offline

Joined: February 29th, 2008, 8:36 pm
Posts: 901
Location: Vault 7
I highly recommend some form of subversion for big scripts. I use tortoiseSVN and Dropbox. Either one would probably work fine individually. Nothing like being able to visual diff broken code with the last known working version.

_________________
ImageDebugging,Container,FileContainer,Object Preferences,ShellFileOperation


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2010, 11:55 pm 
Offline

Joined: June 4th, 2010, 9:04 pm
Posts: 1347
Location: california
You shouldnt really have to delete code to debug it. You can use block comments (/* and */) to block out sections of code or goto's to jump around the code. Also, if you are getting variables showing up, there's probably a ListVars command buried somewhere in your program. Here's a small debug module you can use to help see what's going on. I use it in all my code when i'm building it.

Code:
;------------------------------------------------------------
Dbg(CalledFrom)
{   msgBox,, Debug Routine, % "Debug Routine entered from " CalledFrom
   ListVars
   Pause
   return
}


To call this routine use
Dbg("name of routine you are debugging")
you can also add the text for the line number you are debugging too like
Dbg("name of routine - at line 22")
for example
when you are through debugging that section just comment out the
Dbg call in your main code with a ; and move on to the next section.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2010, 12:04 am 
Offline

Joined: February 29th, 2008, 8:36 pm
Posts: 901
Location: Vault 7
I've found that making a copy of the script (or relying on subversion to be able to revert) and then deleting is much easier to narrow things down. Especially as /**/ doesn't nest. Also gets the working code out of the way visually. Seeing as he didn't find any ListVars or anything, it sounds like it is a weird bug/mistake.

As for debugging, see my signature for my debugging library. It started out very similar to your function, girlgamer! The nice thing is that you don't have to IfMsgBox or ListVars all the time. Its default behavior is to OutputDebug. That lets you debug just while running the script as usual.

_________________
ImageDebugging,Container,FileContainer,Object Preferences,ShellFileOperation


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2010, 7:55 pm 
Offline

Joined: June 4th, 2010, 9:04 pm
Posts: 1347
Location: california
I'll check that out. Thank you. Yes i use Code revisioning but havent tried TortoiseSVN yet. I'll look that one up and give it a shot. Most of my routines are heavily modularized with #Includes so once i get a functional block I extract it and re-use as necessary.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google Feedfetcher, Yahoo [Bot] and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group