User Tag List

Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast
Results 21 to 30 of 45

Thread: How to see what an array contains?

  1. #21
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    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)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    i always use array for saving info, never ini.
    save ( use expression ) apppath$+"filename" <- you do this once, not on an event that will trigger like always etc.
    soon as you load the array from apppath$+"filename" - your whole array will be restored

  2. #22
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    523
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Yeah that's nice except I'm doing that and it isn't/doesn't. The data isn't storing into the internal array in the first place so the file is just filled with a bunch of 0's.

  3. #23
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    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)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    your array for example is a number array - 1 base,the first element will be at 1 and so on.
    say for example; you want to save a total of 10 numbers, (just a single dimension array) - so set the X dimension to 10, Y dimension to 0 or 1, and Z dimension to 0 or 1;
    save you values; write to X, your number : eg 50; to the element x; eg 4.
    that will save the number 50 into X element 4.
    your ( X ) array will look like,
    0,0,0,50,0,0,0,0,0,0

    then saving the array and loading as state before will get your numbers

    it sounds like you are not writing the number you want into the correct dimension

  4. #24
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,156
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Another question I have, do you have to set the X,Y and Z dimensions in the objects properties? For example my array have dimensons X=10, Y=10 and Z=1 in its object properties. Does that mean if I try to save something in say X10 and Y11 it wont work because my array only have Y10? Or will it create another dimenson on the fly? And if so, why even have these settings?

  5. #25
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Sep 2017
    Location
    Milano, Italy
    Posts
    130
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Outcast View Post
    Another question I have, do you have to set the X,Y and Z dimensions in the objects properties? For example my array have dimensons X=10, Y=10 and Z=1 in its object properties. Does that mean if I try to save something in say X10 and Y11 it wont work because my array only have Y10? Or will it create another dimenson on the fly? And if so, why even have these settings?
    Yes, Array have fixed dimensions, you need to set them exactly as what are needed for your app.
    The dimension are not changed dinamically.
    Your case of Y11 is a out of range error.

  6. #26
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    That's wrong. Arrays DO automatically expand if you write to a position outside the current bounds (with the exception that array indexes must always be >= 0). If you read from a position out of bounds, it will return either "0" (number array) or an empty string "" (text array).
    However, partially empty arrays do NOT contract to fit the data (eg. if you were to overwrite an entry with a "0" or an empty string), so I will very often set the initial array dimensions to 1x1x1.
    The reasons for setting the initial dimensions are performance (realistically, you don't need to worry about this) and convenience - for example, if you want to fill an array with data, it could be convenient to run a fastloop DimX * DimY * DimZ times.

  7. #27
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Sep 2017
    Location
    Milano, Italy
    Posts
    130
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Is it so?
    This is a new for me, I always thinked at Arrays as Non-Dynamic, and documentation in fusion say nothing about it.
    Was I tricked by the Dynamic Array extension?
    If normal Arrays are dynamic, why does exist Dynamic Array?

  8. #28
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    523
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    No, I am indeed writing values correctly, but they are not storing. I'm working in Base0, and the only dimension I am writing to so far is X1Y0. I've also tested in Base1 at dimension X1Y1; tried with just the X dimension; tried converting the array to a text array, saving the number as a string, and then converting back into a value. So far, nothing has worked. My array is currently setup with 10 X's and 10 Y's, so I have plenty of room to work (probably too much but that's fine).

    To my knowledge, the Dynamic Array extension is a way to create arrays with extra functionality. It can store files, insert lines directly from spreadsheets, sort alphabetically, etc. However, for my project, I'm keeping cross-platform compatibility in mind, so anything that is Windows-only, like the Dynamic Array object, is a no-no.

  9. #29
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    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)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    zero base starts at 0; look at the 0 position in X

  10. #30
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    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)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    re dynamic, originally the arrays never grew and the dynamic array has been around for a very long time (mmf1) so it could compensate for the static array. i was under the impression normal array didnt expand, but maybe they changed that at some point.

Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 12th March 2018, 12:33 AM
  2. Shuffle an Array (Dynamic Array)
    By bad_rick in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 6th November 2017, 02:07 PM
  3. Bug with array object : array indexes change
    By Perfeks in forum Fusion 2.5
    Replies: 5
    Last Post: 22nd February 2017, 10:17 AM
  4. 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
  5. 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

Posting Permissions

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