AutoHotkey Community

It is currently May 27th, 2012, 12:11 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: April 5th, 2011, 10:29 pm 
Hi guys.

Today I encountered a problem with AHK_L again. I wanted to convert a script that downloads a file with httpQuery [Unicode version by HotKeyIt] and uses a MD5 check afterwards. The problem is that the MD5 sum function uses the
Code:
SetFormat, Integer, h
and afterwards
Code:
SetFormat, Integer, d
to set the format back.
But this command crashes AHK_L (Windows throws an exception that AHK_L does not work anymore, search for problem blabla).
Even though the line will be never executed, like in this example:
Code:
url := "http://www.letsgomobile.org/images/reviews/0149/sony-ericsson-test-pictures.jpg"
length := httpQuery(data,url)
MsgBox %length%
ExitApp

; This line gets never executed
SetFormat, Integer, %A_FormatInteger%


#Include inc\httpQuery_modified.ahk
#Include inc\Struct.ahk

There are two things I can do to get around this issue:
1. Remove all lines, which use SetFormat, Integer
2. Don't use a url with binary files, e.g. http://google.com/ works

It would be great, if someone knows how to fix this problem or what the issue might be.

Kindly regards,
nfl

BTW: I am using the latest AHK_L unicode version (1.0.97.1)

[Moved from 'Ask for Help' ~MacroMan!]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 6th, 2011, 6:40 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
The script crashes for me with or without SetFormat. I suspect that it is crashing in Struct_getVar, which relies on undocumented implementation details to do things that AutoHotkey is not designed to do. For the most part, it isn't even necessary. I recommend against using these methods because they are prone to break (and cause crashes like these) whenever the implementation changes even slightly, as it did when #Warn was introduced.

Furthermore, IntegerFast should be used in place of Integer. Using Integer causes binary number write-caching (added in v1.0.48) to be disabled, for backward compatibility. (Side note: SetFormat is being removed in v2 in favour of a more flexible formatting function.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 2:57 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
I have missed to upload Struct.ahk with latest fix :oops:
Now it should work, sorry about that. Struct.ahk

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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