User Tag List

Results 1 to 10 of 10

Thread: Binary Array

  1. #1
    Clicker Multimedia Fusion 2
    dragonguy's Avatar
    Join Date
    Apr 2008
    Location
    RULE BRITANNIA!
    Posts
    3,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Binary Array

    All this time iv'e been using the Byte Array, whereas there has been the Binary Array all along which is far superior, it can save other things apart from bytes and has compression methods, Iv'e now switched from Byte Array to Binary Array but I have a few questions about it.

    1) Are it's Bytes Signed or Unsigned? -127 to 128 or 0 to 255?

    2) How big are Floats, Integers & Strings byte-wise? I need to know so I don't accidently overwrite Bytes needed for other stuff.
    Don't know what the other datas are, lol.

    3) Whats a Work-Space?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Array

    1) There are seperate expressions for signed and unsigned data types

    2) Float - 4 bytes, integer - 4 bytes, strings - each letter is one byte

    3) Each workspace is a seperate array. You can store data and load and save files all from within one workspace, and then change to another one and have a completely clean slate to work from while your original workspace is still held to switch back to. You can also save all of the workspaces to a single file, and load that file back in.

  3. #3
    Clicker Multimedia Fusion 2
    dragonguy's Avatar
    Join Date
    Apr 2008
    Location
    RULE BRITANNIA!
    Posts
    3,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Array

    Quote Originally Posted by Jamie
    1) There are seperate expressions for signed and unsigned data types
    Explain.

    Edit: I understand how to get a Signed/Unsigned byte from the Array using it's expressions but how do I write them?

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Binary Array

    Wikipedia.

  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

    Edit: I understand how to get a Signed/Unsigned byte from the Array using it's expressions but how do I write them?
    This may this may sound weird, but no matter if you need the byte to be signed or unsigned, you just use the "set byte" action and input the desired value.

    This is possible simply because the binary data of the range 0-128 is identical in both signed and unsigned bytes, only the -127 to -1 range and 129-255 range differs. Input a value between 0 and 255 for unsigned, and input a value between -127 to 128 for signed.

  6. #6
    Clicker Multimedia Fusion 2
    dragonguy's Avatar
    Join Date
    Apr 2008
    Location
    RULE BRITANNIA!
    Posts
    3,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Array

    Ok that makes sense.

  7. #7
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Array

    When you load a byte to a larger number (demonstrating with 10-bit, MMF's numbers are actually 32-bit which is huge to write in binary):
    Code:
           byte         =       (decimal)       =      MMF-size number
    00000000 - 01111111 =    0 - 127 (both)     = 00 00000000 - 00 01111111
    10000000 - 11111111 = -128 - -1  (signed)   = 11 10000000 - 11 11111111
    10000000 - 11111111 =  128 - 255 (unsigned) = 00 10000000 - 00 11111111
    So as you can see it makes a difference on loading the number whether it's signed or unsigned. For a signed number the highest value bit needs to be extended through the extra bits for the value to stay negative. For an unsigned number the extra bits HAVE to be 0.
    For saving you're coming from a larger number, like this (demonstrating with 10-bit):
    Code:
         MMF-size number      = (decimal)  =       byte
    00 00000000 - 00 01111111 =    0 - 127 = 00000000 - 01111111
    11 10000000 - 11 11111111 = -128 - -1  = 10000000 - 11111111
    00 10000000 - 00 11111111 =  128 - 255 = 10000000 - 11111111
    As you can see the last 8 bits of your larger number are identical for numbers that would go into a signed (-128 - -1) or unsigned (128 - 255) byte, so you don't need to say which it is, because it doesn't matter.
    You only need to worry about whether it's a signed or unsigned number when converting to a larger number, like byte->int.

  8. #8
    Clicker Multimedia Fusion 2
    dragonguy's Avatar
    Join Date
    Apr 2008
    Location
    RULE BRITANNIA!
    Posts
    3,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Array

    Ok that doesn't make sense, especially seeing as bytes are 8-bit.

  9. #9
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Array

    I've tried to clarify the confusing bit.
    The byte is only 8 bits, but all numbers in MMF are 32-bit, so it has to translate from one to the other when loading and saving bytes. I used a 10-bit number in my example because writing out a full 32-bit number in binary is huge.

  10. #10
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Array

    Quote Originally Posted by Dynasoft
    I've tried to clarify the confusing bit.
    Pun intended?

Similar Threads

  1. Binary array bug.
    By wwmb in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 18th December 2012, 08:51 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 help
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 4th November 2008, 11:11 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 xerus in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 7th March 2008, 05:55 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
  •