User Tag List

Results 1 to 6 of 6

Thread: For the love of good, how can I insert a value into the dynamic array?

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2011
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    For the love of good, how can I insert a value into the dynamic array?

    The normal array object is very easy to use. For example: Insert value 7 to x3, y5
    The problem is, for my pathfinding I need to copy / delete and search the array. So to reduce performance problems and fastloops, I want to use the dynamic array.

    But even after reading the help files and searching the forums I can't figure out how to insert the value 7 to x3, y5.
    Also how can I get the value of column 1 from the recordset with the lowest value in column 2?

    I hope someone can help me...

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I used dynamic array for sorting, also used by my pathfinding, but aswell had no idea how to add to x and y, its a confusing thing that array. I ended up using it combined with the standard array.

    Dont know if that helps you much.

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2011
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Skyhunter. But how could you use the dynamic array just for sorting without knowing how to add x and y?
    Also does someone know if the performance is really better with the dynamic array when you use the "search value" function instead of iterating through a normal array and comparing to the search value?
    For my pathfinding, I will have a lot of values / recordsets....

  4. #4
    No Products Registered

    Join Date
    Apr 2013
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well storing/restoring values is quite simple, all you need to take into consideration is that you can't add items exactly where you want them before you actually create values before it. I'm not sure how to explain it properly, but I would compare it to tables in lua. And unfortunately I can't comment on performance as I have never tested it.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Morbus Crohn - Not sure if it helps, but when I need something like a dynamic array, I tend to use the List object, since I can insert and remove lines easily. If you need x & y indices you can use the List line for y and String Parser on the string to get the xth entry (use comma delimit, using string concatenation to insert/delete entries as required. It's a bit more fiddly than I'd like, but useable.

  6. #6
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2011
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BigHatLogan: Thanks for the example. I will test it when I am at home.

    AyreGuitar: I also considered the list object. My problem is, I need at least 3 values (x, y, value of path). Best would be 7 values (to store the parent path). Then I heard that converting strings to values needs performance.
    Perhaps I could store all information in one string, like: x8,y12,23,4,7,px7,py12

    I really need the array object with a search, max() and delete function...

Similar Threads

  1. Array dynamic?
    By StingRay in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 12th December 2013, 05:22 PM
  2. Dynamic Array - Sort 2 dimension array by Column 1
    By Ryan in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 16th December 2012, 04:54 AM
  3. Is it best to use a dynamic array?
    By TheSynapse in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 2nd February 2012, 08:54 PM
  4. 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
  5. Questions about the 3EE Dynamic Array
    By RedHades in forum Extension Development
    Replies: 0
    Last Post: 28th April 2007, 07:54 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
  •