User Tag List

Results 1 to 8 of 8

Thread: Binary Object: Byte returning negative number

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jul 2006
    Location
    USA
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Binary Object: Byte returning negative number

    I'm using the Binary Object to pass data to the DLL object. I'm doing some tests within MMF to learn how the Binary Object works.

    When I Replace a byte with anything higher than 127, it returns a negative number. i.e. 128 returns -128... 129 returns -127... and so on.

    How can I store values up to 255 without it jumping to negative numbers?

    Or is my understanding of how this works whacked?

  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 Object: Byte returning negative number

    Use Binary Array instead, it supports unsigned bytes.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jul 2006
    Location
    USA
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Object: Byte returning negative number

    I just looked at the Binary Array. Everything was good, until I tried to use it with the DLL object. I couldn't find the equivalent of:

    addr("Binary object")

    ...this is to retrieve the data by way of memory address, I'm thinking.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jul 2006
    Location
    USA
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Object: Byte returning negative number

    Also...

    Just because it returns a negative number in MMF, that doesn't mean that the value will be negative when passed to the DLL, right?

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

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

    Re: Binary Object: Byte returning negative number

    That's a point, I will add an address function in today or tomorrow

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Jan 2007
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Object: Byte returning negative number

    Replace Byte and Add Byte from the Binary Object work fine. The problem is when you read the byte (e.g. set counter to byte something), that's probably what you're seeing.

    If you want to continue using the Binary Object, a solution to view the bytes correctly would be: set counter to byte( "Binary object", <address>)+Min(0, byte( "Binary object", <address>))/byte( "Binary object", <address>)*256

    Something like that :P

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jul 2006
    Location
    USA
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Object: Byte returning negative number

    you geeks are great! (and I mean that as a complement!)

    thanks.

  8. #8
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Object: Byte returning negative number

    I use:
    (byte( "Binary object", <address>) + 256) mod 256
    But both should work fine.

Similar Threads

  1. Getting a random number between a negative and positive number
    By D_Light in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th January 2013, 11:51 PM
  2. Returning number of objects under a specific condition
    By Ibis in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th November 2012, 02:23 AM
  3. Number to Byte / Char -> MooSock
    By SuperDisk in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 21st July 2012, 10:40 PM
  4. Problem returning a Negative Numbers
    By EZubby in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 30th July 2011, 06:56 AM
  5. Converting part of a string to negative number
    By Simion32 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 7th April 2007, 01:44 AM

Posting Permissions

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