Allow2010 Posted March 13, 2012 Posted March 13, 2012 hi all, i am trying to convert some code from php to autoit. There are some functions that may exist in autoit, but are unknown to me. So if anyone can point me to the right func or has an idea how to code the needed func i would be glad fo any hint. Thanks in Advance !! The PHP function i need in autoit are: simplexml_load_string http://php.net/manual/en/function.simplexml-load-string.php mb_convert_encoding http://de3.php.net/manual/en/function.mb-convert-encoding.php and i also need curl function that allow for curl_init(...) curl_setopt(...) curl_exec(...) curl_close(...) The curl function i found did not allow this kind of usage... Again, any hint, link or code is welcome. Thank you very much!
James Posted March 14, 2012 Posted March 14, 2012 This is where the AutoIt community comes into its own. There is an XML UDF floating about around here. Although the last update was in 2010, there may be other UDFs that are newer and better, I don't know.As for mb_convert_encoding... I don't know.And for cURL functions, seangriffin has an excellent UDF here.The function names wont match PHP precisely, but I'm sure you'll be able to work them out. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ProgAndy Posted March 15, 2012 Posted March 15, 2012 (edited) To convert encdoings, those functions should cover the usual cases: _WinAPI_MultiByteToWideChar _WinAPI_WideCharToMultiByte BinaryToString StringToBinary Depending on th extend you use curl, InetRead / InetGet could suffice. Another alternative is WinHTTP (my signature contains a link) Edited March 15, 2012 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Allow2010 Posted March 16, 2012 Author Posted March 16, 2012 thanks, looks interesting...will start right away:-)
Allow2010 Posted March 17, 2012 Author Posted March 17, 2012 (edited) Thanks for pointing me to winhttp.I am having a problem there, any help is apreciated: Edited March 17, 2012 by Allow2010
Allow2010 Posted March 18, 2012 Author Posted March 18, 2012 Problem solved... now i am looking for something like this: http://php.net/manual/de/function.http-build-query.php it translates an array to an url in the from of foo=bar&baz=boom&cow=milch&php=hypertext+processor is the a func in autoit to do this?
czardas Posted March 18, 2012 Posted March 18, 2012 I get totally engrossed when I look at the PHP website, not that I have much experience with it. Anyway, there is no associative array type in AutoIt. I think some people have attempted to create something like that, and it's possible you might find something useful in Example Scripts. You could create a similar function using a 2D array. I'm not sure if this helps you. Dim $array[4][2] = _ [["foo","bar"], _ ["baz","boom"], _ ["cow","milch"], _ ["php","hypertext+processor"]] MsgBox(0, "Result",_BuildString($array)) Func _BuildString($array, $delim1 = "=", $delim2 = "&") If UBound($array, 2) < 2 Then Return SetError (1, 0, "") Local $sRet = "" For $i = 0 To UBound($array) -1 $sRet &= $array[$i][0] & $delim1 & $array[$i][1] & $delim2 Next Return StringTrimRight($sRet, 1) EndFunc operator64 ArrayWorkshop
jchd Posted March 18, 2012 Posted March 18, 2012 Search for "scripting dictionary" and you're done. czardas 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Allow2010 Posted March 18, 2012 Author Posted March 18, 2012 Search for "scripting dictionary" and you're done.Sorry, i do not get what you mean...
Allow2010 Posted March 18, 2012 Author Posted March 18, 2012 I get totally engrossed when I look at the PHP website, not that I have much experience with it. Anyway, there is no associative array type in AutoIt. I think some people have attempted to create something like that, and it's possible you might find something useful in Example Scripts. You could create a similar function using a 2D array. I'm not sure if this helps you.thank you very much...yes the array type is a problem..i will play a bit with it...thanks for the code !
jchd Posted March 18, 2012 Posted March 18, 2012 Let me try again: use the forum search feature for quoted words. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now