User Tag List

Results 1 to 5 of 5

Thread: Binary array problem

  1. #1
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Binary array problem

    Hello, there's no documentation to be found about it, so it's unclear how it works, although you would think it would be obvious. Anyone know why this doesn't work? The .txt file gives crazy results when opened externally.

    [img:center]http://www.mediafire.com/imgbnc.php/11ff38dc41121e3f769cc5e9fcfcb6ec4b798cb0d8cd4d1daf a4ee3951f9a3d35g.jpg[/img]

    http://www.mediafire.com/i/?3jwzp6q1v202mmt

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary array problem

    * You must switch to the workspace you created to use it (and did you remember to set a default workspace size in the object's properties?)

    * The string "HELLO" will use 5 bytes, so when you write an integer with a value of 2 to position 1, you overwrite the ELLO (an integer uses 4 bytes) with 02 00 00 00, which in ascii are the non-printable characters start of text,null,null,null.

    * When you write "YOU" to position 2, you overwrite null,null,null (which used to be LLO in HELLO) with YOU.

    So, assuming your default workspace size is 5 bytes or more, your workspace will now contain the bytes 48 02 48 45 59, or in ascii H[start of text]HEY. The rest of the bytes (if the default workspace size is larger than 5 bytes) will contain whatever was previously in the allocated memory since the bytes were never changed (this can be pretty much any junk from any program).

    Finally, when you save a workspace file, you're saving to an internal format that contains all workspaces. This of course requires some additional bytes (workspace names, sizes of workspaces, etc) which is the junk you're seeing. If you just want the binary content of the workspace you're editing, you should save the workspace itself as a file. Since you're dealing with binary data and not ascii (apart from when you set a string), it's best to use a hex editor to look at the file content.

    This is pretty complicated stuff though, you have to remember that positions represents byte indexes, you have to know how many bytes each different data type uses and make sure you don't overwrite anything, you must know the difference between signed and unsigned data types. The Binary Array is normally used to put together an efficient file format to store data within, and very rarely to make a format readable in a text editor.

  3. #3
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary array problem

    Ok everything works perfectly now, thank you for clarifying things Nifflas.

  4. #4
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary array problem

    So I take it I can't use write unsigned integers with it?

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary array problem

    You can. There's no difference between writing signed and unsigned data with the Binary Array extension. If you're e.g. writing a byte, you can use the range -128 to 127 for a signed byte, or 0 to 255 for an unsigned. This works because the range 0 to 127 are stored identically with a signed and unsigned byte.

Similar Threads

  1. Binary array help
    By willy in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd August 2011, 08:24 PM
  2. Dynamic Array to Binary Array problems
    By BREK in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd March 2010, 10:48 PM
  3. Binary Array
    By dragonguy in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 3rd November 2008, 03:41 PM
  4. Binary Array
    By astrospoon in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 9th September 2008, 03:34 AM
  5. Binary array
    By James in forum Released Extensions
    Replies: 5
    Last Post: 7th December 2007, 03:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •