AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Autohotkey for Pocket PCs / WinCE / Smartphones
Goto page Previous  1, 2, 3 ... 23, 24, 25 ... 28, 29, 30  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
codybear



Joined: 15 Sep 2009
Posts: 560

PostPosted: Mon Apr 26, 2010 1:32 am    Post subject: Reply with quote

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!!
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 537
Location: Germany

PostPosted: Mon Apr 26, 2010 10:43 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
thewer



Joined: 12 Feb 2008
Posts: 13
Location: Munich, Germany

PostPosted: Wed Apr 28, 2010 9:23 am    Post subject: Reply with quote

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! Very Happy
Back to top
View user's profile Send private message Visit poster's website
OceanMachine



Joined: 15 Oct 2007
Posts: 780
Location: England

PostPosted: Thu Apr 29, 2010 11:56 am    Post subject: Reply with quote

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:



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?
Back to top
View user's profile Send private message
codybear



Joined: 15 Sep 2009
Posts: 560

PostPosted: Thu Apr 29, 2010 3:40 pm    Post subject: Reply with quote

Weird, the icon worked fine for me in windows mobile 6.5
Back to top
View user's profile Send private message
OceanMachine



Joined: 15 Oct 2007
Posts: 780
Location: England

PostPosted: Thu Apr 29, 2010 3:54 pm    Post subject: Reply with quote

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. Sad

Micha - what emulator are you using - is it a Win Mobile one? Or Win CE?
Back to top
View user's profile Send private message
codybear



Joined: 15 Sep 2009
Posts: 560

PostPosted: Fri Apr 30, 2010 4:34 am    Post subject: Reply with quote

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. Sad

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

Windows Mobile's core is WinCE.
Wink

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.
Back to top
View user's profile Send private message
OceanMachine



Joined: 15 Oct 2007
Posts: 780
Location: England

PostPosted: Fri Apr 30, 2010 2:16 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 537
Location: Germany

PostPosted: Sat May 01, 2010 8:35 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 537
Location: Germany

PostPosted: Tue May 11, 2010 7:41 pm    Post subject: Reply with quote

Hi, I've uploaded a new version with minor bugfixes and additional tests
Ciao
Micha
Back to top
View user's profile Send private message
codybear



Joined: 15 Sep 2009
Posts: 560

PostPosted: Wed May 12, 2010 6:14 am    Post subject: Reply with quote

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!!
Back to top
View user's profile Send private message
OceanMachine



Joined: 15 Oct 2007
Posts: 780
Location: England

PostPosted: Thu May 13, 2010 11:01 am    Post subject: Reply with quote

Awesome, thanks! I am eager to try it out Smile
Back to top
View user's profile Send private message
codybear



Joined: 15 Sep 2009
Posts: 560

PostPosted: Sat May 15, 2010 5:22 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
None



Joined: 28 Nov 2009
Posts: 3086

PostPosted: Sat May 15, 2010 5:54 am    Post subject: Reply with quote

Hi codybear apparently daonlyfreez wanted that option also.
AutoHotkey Documentation alternatives
Back to top
View user's profile Send private message
codybear



Joined: 15 Sep 2009
Posts: 560

PostPosted: Sat May 15, 2010 6:30 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 23, 24, 25 ... 28, 29, 30  Next
Page 24 of 30

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group