User Tag List

Results 1 to 2 of 2

Thread: Stack Cursor

  1. #1
    Forum Moderator Multimedia Fusion 2 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    DizzyDoo's Avatar
    Join Date
    Oct 2006
    Location
    South England
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stack Cursor

    Hi, having some trouble getting my stack reading loop to work.

    So I send a stack made up of three null-terminated strings and a byte. Here are my events:

    + On Stack Message to server
    - Start loop readStack 4 times (4 times, that's how many elements in stack)
    - Set stackCursor back to 0 (finish iterating, set up for next message)

    + On loop readStack
    + loopIndex("readStack") < 3 (loop deals with string?)
    - Add string as a line to a List
    - Add Len(CursorString) to stackCursor (stackCursor is a global value)
    - Move received stack cursor to stackCursor

    + On loop readStack
    + loopIndex("readStack") = 3 (loop deals with byte)
    - Add str$(byte unsigned) to List

    Since I'm adding the length of the each iteration stack cursor to a value, I should be able to reposition the stack cursor correctly, right?

    But with the strings, in order, of "First String", "0123456789" and "Last one" (and a byte of 0), I get this after the execution of the loop in the list:

    First String
    ing
    6789
    116

    It seems I'm iterating through a stack of strings stupidly. There must be a better way to do this.

    Matt
    Cranktrain - Currently finishing a new game called The Cat Machine!
    @MattLuard on Twitter.

  2. #2
    Forum Moderator Multimedia Fusion 2 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    DizzyDoo's Avatar
    Join Date
    Oct 2006
    Location
    South England
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Stack Cursor

    Jamie sorted it out over msn. Thing is, when you read the something, the cursor moves automagically. So, it should just be:

    + On Stack message received
    - Read string
    - Read string
    - Read string
    - Read byte

    No need for loops, no need for global values. Why did I think it would be so complex?
    Cranktrain - Currently finishing a new game called The Cat Machine!
    @MattLuard on Twitter.

Similar Threads

  1. Epic Stack
    By SoftWarewolf in forum Android Released Games & Apps
    Replies: 3
    Last Post: 19th June 2013, 12:23 PM
  2. Epic Stack
    By Jeff in forum iOS Released Games & Apps
    Replies: 2
    Last Post: 16th February 2013, 07:47 PM
  3. Epic Stack
    By SoftWarewolf in forum Released Games & Apps in Flash
    Replies: 0
    Last Post: 16th February 2013, 07:19 PM
  4. Stack Feature
    By Sumo in forum Lacewing
    Replies: 19
    Last Post: 27th January 2010, 11:54 AM
  5. cursor object? or own cursor?
    By Gibbon in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 31st December 2007, 07:52 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
  •