User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Can't write to array from global string

  1. #1
    Clicker Multimedia Fusion 2
    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
    Aug 2013
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't write to array from global string

    I need to transfer content of ~50 global strings into an array in perfect order (each of them goes into a specific field); but when I try to write a string to a certain field using the content of a global string, I get a syntax error telling me to enter an alphanumerical combination. Why is this even happening and is there a way around this?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Alphanumerical combination means that

    1. You are trying to use a number in a string field
    2. You are trying to use a string in a number field
    3. You have both numbers and strings in the expression editor

    Screen Pic or type the code you are trying to use here

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Pineapple's Avatar
    Join Date
    Oct 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're not using it already, you need to use the Val function.

    Example: Val( Global String A )

    This converts the string (which is text) into an actual number.

  4. #4
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pineapple View Post
    If you're not using it already, you need to use the Val function.

    Example: Val( Global String A )

    This converts the string (which is text) into an actual number.
    This only apply if the Global String is literally a number such as '5654' or '131' and you are trying to save this number. If it is a non numerical string, only 0 will be saved.
    Another thing that may be messing this up is that you are using "Write Value" when you should be using "Write String" or vice versa

  5. #5
    Clicker Multimedia Fusion 2
    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
    Aug 2013
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, some strings contain text. I need one single array which can hold both text and numbers only. Is this possible?

  6. #6
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Text arrays can hold numbers (converted to text) and strings, but as it was previously said, the Val(<non numerical string>) = 0. So unless you have a method for detecting which strings are numerical and which aren't then you will encounter issues later.

  7. #7
    Clicker Multimedia Fusion 2
    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
    Aug 2013
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I go to write=>write string to X,Y and type Val(name of a strictly numerical string), I get "mixed strings with numbers".

  8. #8
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    http://xable.us/expression-editor-basics.php

    This may provide better insight for you.

    In short, "Write string" means what is in the expression editor has to be a string. "Write Value" means that it has to be a number. What Pineapple said only works if you are trying to "Write Value" with a string

  9. #9
    Clicker

    Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    J3sseM's Avatar
    Join Date
    Feb 2013
    Location
    Finland
    Posts
    868
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Whoa that's brilliant tutorial! Been looking something like that.

    Thanks again ProdigyX!

    - Jesse

  10. #10
    Clicker Multimedia Fusion 2
    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
    Aug 2013
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I understand how things are done now I will give it a shot when I'm back from work and see how it goes Thank you very much for helping me!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Array wont write value
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th March 2012, 11:59 PM
  2. Write to an array?
    By Keli in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 26th July 2009, 09:45 AM
  3. Write and read 2 values at a time from array.
    By Popcorn in forum File Archive
    Replies: 0
    Last Post: 1st April 2008, 01:09 AM
  4. Global extension and disk-write
    By kornelijepetak in forum Extension Development
    Replies: 3
    Last Post: 4th November 2007, 12:54 AM
  5. Is it possible to write string to config files?
    By tallguypete in forum Install Creator and Patch Maker
    Replies: 4
    Last Post: 26th January 2007, 04:30 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
  •