Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/13/2012 in all areas

  1. I started this JSON library back in late 2007, because I needed a way to pass structured data between Javascript HTAs and AutoIt3 scripts. I've recently worked to get it in good enough shape to share with the AutoIt community, and while it still needs a bit more polish, the core functionality should be solid. Three files are included in the attached archive: JSON.au3 – the UDF Library itself. It includes a (very large) comment section at the top, which should provide sufficient documentation on how the various data types are encoded and decoded, as well as the various Javascript-based decoding extensions allowed (single-quoted strings, comments, etc.).JSON_Translate.au3 provides example functions for the powerful "translator" functionality. Translator functions can be used for both encoding and decoding. When encoding, it allows you to recursively convert your data from its normal format into the required data structures used by the JSON UDF library. When decoding, it allows you to convert the data in the opposite direction – from the JSON UDF library's data structures to the data structures your program normally uses. To use this functionality, you'll need to write your own translator functions, but this allows you to meet the custom needs of your own programs without having to hack JSON.au3. The examples provided in this file can probably be improved, but show one way of translating AutoIt-specific data types (such as binary and hwnd) back and forth.testJSON.au3 provides some quick examples of regular and translator-enhanced usage, which also help verify that encoding and decoding are working properly. These tests may not be comprehensive.The area needing the most work is error-handling. JSON data structures can be deeply nested, and it's tricky to make sure errors "bubble up" properly in AutoIt. (Plus, I need a flowchart to keep track of all my setError() numbers!) Thanks to Douglas Crockford of JSON.org, whose 2005 Javascript code for JSON encoding and decoding provided an excellent starting point for this library. Edit: updated to 0.9.1 on 2009-10-19 substantially updated opening commentsencoding: implemented logic to return "warning" @error flags for unsupported variable types & JSON objects with non-unique key stringsother minor fixes & tweaksJSON.7z
    1 point
  2. Melba23

    if mousedown("left")

    Scripty, You can - look at _IsPressed. M23
    1 point
  3. Arrays are copy on write only so if you don't modify them, it doesn't copy them. At least, that is what Valik said in the past.
    1 point
  4. _ArraySearch searches an array, not an element of the array. This might work for you, untested so it might need tweaking While 1 $element = _ArraySearch($aSP_WorkflowMain01, "_FDL", 0, 0, 0, 1, 0, 1) If $element >= 0 Then ; _FDL was found if >= 0 _ArrayDelete($aSP_WorkflowMain01, $element) ; delete the element If Not IsArray($aSP_WorkflowMain01) Then ExitLoop ; if the array is empty after the delete, exit the loop Else ; _FDL wasn't found ExitLoop ; exit the While loop EndIf WEnd
    1 point
  5. It looks mad but interesting Well done for something new and different
    1 point
×
×
  • Create New...