AutoHotkey Community

It is currently May 27th, 2012, 5:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 453 posts ]  Go to page Previous  1 ... 21, 22, 23, 24, 25, 26, 27 ... 31  Next
Author Message
 Post subject:
PostPosted: April 26th, 2010, 2:32 am 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
Micha wrote:
I've uploaded a new version. The compiler and the autohotkey.exe are both unicode now.

@codybear You can change the icon of the compiled exe with the new compiler now

Autohotkey.exe and autohotkeysc.bin are in sync now. Everything that is working as script should work as exe, too

Ciao
Micha


THANK YOU very much!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2010, 11:43 am 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
OceanMachine wrote:
Hi Micha,
Are these 3 things now also working for the non-Unicode build (V36)? Or have all updates and fixes gone to just the Unicode version? I will try the Unicode build and see how it works for me.
Thanks for your work on this again!

Hi,
the changes are only made in the unicode version.
At the moment the unicode version is nearly untested. I've created a huge testscript for ahkce to test a lot of its functions. I'll use that script to test every function again of the unicode version. Please have a look at
http://www.autohotkey.net/~Micha/AutohotkeyCE/html/WorkingCommands.html for working commands. I've made every (even tested) commands black again and I've begun to make the working commands of the unicode version green or red. (working / not working)
I'm intending to work just on the unicode version because it's better to maintain than a version where I have to convert strings from and to unicode hundred times. I hope a few bugs are just gone away now.
Ciao
Micha


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2010, 10:23 am 
Offline

Joined: February 12th, 2008, 2:25 pm
Posts: 13
Location: Munich, Germany
Hi -

haven't checked this post for a while... sorry!

Just wanted to thank you for your efforts and help - you're really doing a great job here! :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2010, 12:56 pm 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
Hi Micha,

I tried to compile my script with the new Unicode build on the device (WinCE).

1. I still can't choose the icon in the AHK2EXE window - I click 'browse' and the window flashes up and then disappears straight away so I can't choose anything. I can choose the source and destination for the Src and Dest, but just not the "Ico" still. I also tried to edit the resources of the resulting exe using PE Explorer, it still doesn't change the icon.

2. After compiling my script, I try to run it and I get an error:

Image

The section of code it appears to be failing on is where the function is called below:
Code:
ButtonFind: ; the g-label handler for the Find button
   FindPostcode() ; <-- seems to be failing here
Return

Here is the script I compiled:
Code:
OnExit, ExitSub ; this is the sub to run when the script exits
#SingleInstance, FORCE ; automatically overwrite an existing session
#NoEnv ; dont try to resolve environment variables (better for performance).
; #NoTrayIcon ; don't show a tray icon

PostcodeDataFileName := "PostcodeData.txt" ; the file that contains all the postcode > bag mappings
BagLocDataFileName := "BagLocData.txt" ; the file that contains all the bag number > location mappings
AppName := "Postcode Finder" ; the app name to be displayed on the window
AppVersion := "v1.0" ; the version to be displayed on the window

; Process, Exist, DWTray.exe ; this is to check that the DataWedge (scanner) process is running
; If ( !ErrorLevel )
;   Run, \Application\Motorola DataWedge\DWTray.exe

; some variables to change/calculate control positioning more easily
ButtonWidth := 30
ControlHeight := 20
BorderWidth := 10
ButtonXPos := A_ScreenWidth - ButtonWidth - BorderWidth
InputWidth := ButtonXPos - (BorderWidth * 2)

; the main GUI
Gui, Add, Edit, w%InputWidth% h%ControlHeight% vBarcodeInput ; the edit box where the barcode will be scanned
Gui, Add, Button, w%ButtonWidth% h%ControlHeight% x%ButtonXPos% yp gButtonFind Default, Find ; the button that triggers the searching
Gui, Font, s11
Gui, Add, Text, xm w160, Last Scanned Barcode: ; label
Gui, Font, w2000
Gui, Add, Text, xp+170 w150 yp vLastScannedText, ; the dynamic text that will display the last scanned value that was looked up
Gui, Font, s60 cBlue
Gui, Add, Text, xm-20 yp+10 w%A_ScreenWidth% vBagNum Center, ; the large bag number
Gui, Font, s20 cBlue
Gui, Add, Text, xm-20 w%A_ScreenWidth% vBagName Center, ; the name of the location that the bag will go to
Gui, Show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%, %AppName% %AppVersion% ; the title line of the window
GuiControl, Focus, BarcodeInput ; focus the edit box to begin with ready for the first scan

If ( !FileExist(A_ScriptDir . "\" . PostcodeDataFileName) ) ; check the main data file exists, this script is useless without it!
{
   MsgBox, File "%PostcodeDataFileName%" not found.  Exiting.
   ExitApp ; exit (will trigger the ExitSub)
}

FileRead, PostcodeData, %A_ScriptDir%\%PostcodeDataFileName% ; if found, read the file

If ( !FileExist(A_ScriptDir . "\" . BagLocDataFileName) ) ; check if the location data file exists, if not advise user that the loc will not be displayed.
   MsgBox, File "%BagLocDataFileName%" not found.  Only Bag Numbers will be displayed, not their corresponding locations.
Else
   FileRead, BagLocData, %A_ScriptDir%\%BagLocDataFileName% ; if found, read the file

Return ; end of auto-execute section

ButtonFind: ; the g-label handler for the Find button
   FindPostcode()
Return

; this is the main function that does the data validation and searching
FindPostcode()
{
   global PostcodeData, BagLocData ; global vars to access the data from the data text files
   global BarcodeInput, LastScannedText, BagNum ; global vars to access the GUI controls
   Gui, Submit, NoHide ; retreive values of all controls

   StringReplace, BarcodeInput, BarcodeInput, *, , All ; get rid of Code39 start and stop characters
   Loop, Parse, BarcodeInput ; parse the scanned input character-by-character and pull out the alpha and numeric sections of the postcode
    {
      If ( InStr("abcdefghijklmnopqrstuvwxyz", A_LoopField) ) ; if its alpha
         PCAlpha .= A_LoopField ; add it to the alpha string
      Else If ( InStr("0123456789", A_LoopField) ) ; if its numeric
         PCNum .= A_LoopField ; add it to the numeric scring
      Else
      {
         SynErr := "Scanned Data" ; define the error message that will be shown
         Goto, SyntaxError ; skip the rest and go to this label below
      }

      BarcodeInputClean := PCAlpha . PCNum ; this is the barcode that we will actually be looking up
   }

   Loop, Parse, PostcodeData, `n, `r ; loop through the postcode data file line-by-line
   {
      If ( ! A_LoopField ) ; if the line was empty, get the next line
         Continue

      If ( !PCFound ) ; if we haven't already found a match in the last iteration, check this line
      {
         If ( !InStr(A_LoopField, "[" . PCAlpha . "]") ) ; check if the line contains the alpha barcode (e.g. [ST] )
            Continue ; if not found, go to the top of the loop again
         Else
         {
            PCFound := A_LoopField ; if it was found in this line, save the line and go to the top of the loop again
            Continue
         }
      }
      Else ; if the PCFound was saved in the last iteration, it means we have found the right alpa section of the file for the postcode that was scanned
      {
         If ( InStr(A_LoopField, "[") ) ; this means we have hit the next section, so break
            Break

         StringSplit, Bags, A_LoopField, :
      
         If ( Bags0 != 2 ) ; if there weren't 2 'halves' of the line, the syntax is wrong
         {
            SynErr := "PCData Ln " . A_Index ; set the syntax error message to show the file and line number of the problem
            Goto, SyntaxError
         }

         RangeStr := Bags1 ; this will be the range of the postcode numbers that the bag covers (e.g. 1-9 )
         Destbag := Bags2 ; this is the corresponding bag number

         Loop, Parse, RangeStr, `, ; there may be more than one range that this covers, so check each (e.g. 1-9,11-15 )
         {
            If ( InStr( A_LoopField, "-" ) ) ; find if it is a range or a single number
            {
               StringSplit, Range, A_LoopField, `-
               
               If ( Range0 != 2 ) ; check there were only 2 halves to the range, otherwise there is a syntax error
               {
                  SynErr := "PCData Ln " . A_Index
                  Goto, SyntaxError
               }
   
               If Range1 is not integer ; if either of the range numbers are not integers, there was a syntax error
               {
                  SynErr := "PCData Ln " . A_Index
                  Goto, SyntaxError
               }
   
               If Range2 is not integer ; if either of the range numbers are not integers, there was a syntax error
               {
                  SynErr := "PCData Ln " . A_Index
                  Goto, SyntaxError
               }

               If ( Range1 > Range2 ) ; swap numbers around if they are the wrong order
               {
                  RangeT := Range1
                  Range1 := Range2
                  Range2 := RangeT
               }
               
               If PCNum between %Range1% and %Range2% ; find out if the number that we are searching for is in the current range being looked at
               {
                  BagNumFound := Destbag ; save the bag number to be displayed later
                  Break ; exit the loop as we have found a match
               }
               Else
                  Continue ; if it wasn't in the range, check the next one
            }
            Else ; it wasn't a range, so should be a single number
            {
               If ( A_LoopField = PCNum or A_LoopField = "*" ) ; if it matches the one we are looking for (or is a * which means 'match all')
               {
                  BagNumFound := Destbag ; save the bag number to be displayed later
                  Break ; exit the loop as we have found a match
               }
               Else
                  Continue ; if it wasn't a match, check the next one
            }
         }

         If ( BagNumFound ) ; if we found the bag number, exit this outer loop
            Break
         Else ; otherwise, check the next line in the data file
            Continue
      }
   }

   If ( BagNumFound ) ; if we managed to find the corresponding bag number in the file
   {
      Loop, Parse, BagLocData, `n, `r ; check the bag name file to get the name of the city/area that the bag corresponds to
      {
         StringSplit, BagLoc, A_LoopField, `=
         If ( BagLoc0 != 2 ) ; if there weren't 2 'halves' to the line then there was a syntax error
         {
            SynErr := "BagLoc Ln " . A_Index
            Goto, SyntaxError
         }
         Else ; split the string and try to find a match for the bag number
         {
            BagLoc1 = %BagLoc1% ; autotrim
            BagLoc2 = %BagLoc2% ; autotrim

            If ( BagNumFound = BagLoc1 ) ; if we found a match for the number
            {
               BagNameFound := BagLoc2 ; save the area name for display later
               Break ; finish looking as we have found a match
            }
            Else ; otherwise continue looking
               Continue
         }
      }

      If ( ! BagNameFound ) ; if after looking in the bag name file we didn't find a match, show an appropriate string instead
         BagNameFound := "Not Found"
   }

SyntaxError:
   GuiControl, , LastScannedText, ; clear this to ensure it is shown correctly
   GuiControl, , LastScannedText, %BarcodeInputClean% ; show the last scanned barcode that we searched for
   GuiControl, , BagNum, ; clear the bag number control to ensure it is shown correctly later

   If ( SynErr ) ; if there was a syntax error, display "Error" and the error text
   {
      GuiControl, , BagNum, Error
      GuiControl, , BagName, %SynErr%
   }
   Else If ( BagNumFound ) ; otherwise, if we found a matching bag, display the number and location text
   {
      GuiControl, , BagNum, Bag %BagNumFound%
      GuiControl, , BagName, %BagNameFound%
   }
   Else ; otherwise, there wasn't a syntax error but we didn't find a match, so show appropriate "unknown" message
   {
      GuiControl, , BagNum, Bag `?
      GuiControl, , BagName, Unknown
   }

   GuiControl, , BarcodeInput ; clear the edit box of the previously scanned barcode
   GuiControl, Focus, BarcodeInput ; focus the edit box ready for the next scan
}

ExitSub: ; this sub will run when the script exits
GuiClose: ; or someone closes the window
GuiEscape: ; or someone presses escape on the window
Esc:: ; or presses escape anywhere
OnExit
   ExitApp ; exit the script unconditionally
Return


Is there something I am doing wrong?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2010, 4:40 pm 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
Weird, the icon worked fine for me in windows mobile 6.5


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2010, 4:54 pm 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
It would probably work OK for me if I could actually use the dialog box that pops up when I click the Ico's Browse button, but like I said it just closes straight away on its own. :(

Micha - what emulator are you using - is it a Win Mobile one? Or Win CE?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 30th, 2010, 5:34 am 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
OceanMachine wrote:
It would probably work OK for me if I could actually use the dialog box that pops up when I click the Ico's Browse button, but like I said it just closes straight away on its own. :(

Micha - what emulator are you using - is it a Win Mobile one? Or Win CE?

Windows Mobile's core is WinCE.
;)

Sometimes the only thing that pops up on the compiler is just the background/border. I just close out of it and reopen it a couple of times and then it works fine.

As far as I know, microsoft only has a mobile device emulator...I could be wrong though...It comes with the mobile device sdk or as a standalone, but I'm not sure how old the standalone is compared to the one in the sdk.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 30th, 2010, 3:16 pm 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
OK, but I thought you might be able to change the image that you were emulating to different versions of the OS. Obviously there are differences between different versions of CE and WM, so I wondered which image(s) Micha was testing on/developing for.

Maybe it shouldn't matter... but clearly something is not working on my devices (Motorola/Symbol WT4090c50 with WinCE 5.0.14).

If you need any more info about the system, please let me know.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 1st, 2010, 9:35 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
Hi I'm using Microsoft Device Emulator V3 9.0 - Pocket PC 2003 SE.

I'm using my huge test script (119 KB). Before the unicode version it worked. After using the unicode version the script does not load. It says " {rectangle-symbol} is not a recognized action.
I debugged it and some memory was being overwritten. I've changed
TCHAR var[16000] to TCHAR *pvar = new.... and the script was loaded a few hundred lines further.
I always had problems with a corrupted stack. If huge variables in some huge ahk functions are allocated the limited stack got overwritten so I had to rewrite the code to allocate the variables not on the stack (using new / delete).
That time not the stack is being overwritten, but some "normal" memory of variables got overwritten. I think I have to change some more code to limit the memory consumption.
I'm working on that for weeks now. Please be patient.
Thanks
Micha


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 11th, 2010, 8:41 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
Hi, I've uploaded a new version with minor bugfixes and additional tests
Ciao
Micha


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 12th, 2010, 7:14 am 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
Micha wrote:
Hi, I've uploaded a new version with minor bugfixes and additional tests
Ciao
Micha

Thanks for the update. You're doing excellent work here!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 13th, 2010, 12:01 pm 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
Awesome, thanks! I am eager to try it out :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 15th, 2010, 6:22 am 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
I personally do a bunch of writing of AutoHotkeyCE scripts right on my device, and got tired of going online to the documentation when I was just not able to remember the syntax or optional parameters for a certain command.
This is why I have taken the liberty of downloading AutoHotkey.com html files, and have saved all of them in a folder.
Basically every link works, the links in the download section will attempt to connect to the actual site. Same goes for the Wiki and Forum as obviously it'd be quite tedious and resource hungry to download all of those pages...not to mention the fact that the information on those pages tend to change quite rapidly.

On the documentation page I had added a "Working Commands" link that will show the list of working commands for AutoHotkeyCE. (Screenshot).

Just download this zip file, and copy to your phone/sd card.
It's roughly 7.8mb in total size when uncompressed.

I will try and keep the working commands list updated...if someone notices that it is outdated, please do let me know.

To use this, you just open the folder and double press the index.html file, do not mess with the other folders and data unless you know what you're doing as it could completely screw everything up.

Now without further ado, here's the download link.

If I had missed something, a link doesn't work, etc. please do let me know so I can fix it!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 15th, 2010, 6:54 am 
Offline

Joined: November 28th, 2009, 4:45 am
Posts: 3089
Hi codybear apparently daonlyfreez wanted that option also.
AutoHotkey Documentation alternatives


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 15th, 2010, 7:30 am 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
None wrote:
Hi codybear apparently daonlyfreez wanted that option also.
AutoHotkey Documentation alternatives

Nice...wish I would have found that even though it only took like 5 minutes to get the website saved.

The only difference with mine then would be the working commands link in the documentation page for AutoHotkeyCE.
I will probably be optimizing it for a mobile screen later on though.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 453 posts ]  Go to page Previous  1 ... 21, 22, 23, 24, 25, 26, 27 ... 31  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Stigg and 10 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