How to use Databuffers?

About Monkey 2 Forums Monkey 2 Programming Help How to use Databuffers?

This topic contains 3 replies, has 2 voices, and was last updated by  EdzUp 1 year, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9433

    EdzUp
    Participant

    I use:

    #Import”<std>”

    Using std..

     

    Global CompressBank:= New Databuffer ( 4 )

     

    and it dis on the Global line with a error in the stack throwing a MAV in debug mode. Is there a special way of using them as I need the buffers for conversion work for networking?

    #9435

    Mark Sibly
    Keymaster

    Not MAVing here with the runnable code below.

    Perhaps try initializing the Global in Main?

     

    #9437

    EdzUp
    Participant

    will try that and see what happens 🙂

    #9447

    EdzUp
    Participant

    Ok firstly thanks Mark for your help on this one, it turns out when importing external files with namespaces etc having Globals initialized outside of a class Method/Function causes the MAV. I moved the declaration inside the class that uses it and added the initializer (New) to the New method for that class and now it works perfectly :).

    Its one of the things that MX1 used to do which I will have to unlearn as I was always initializing variables as I created them which was bad practice in some cases 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.