User Tag List

Results 1 to 4 of 4

Thread: How do I make string-based calculations?

  1. #1
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)
    ratty's Avatar
    Join Date
    Apr 2012
    Posts
    1,165
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    How do I make string-based calculations?

    I have no idea what I'm missing. I know I've done calculations in the past based off strings but for whatever reason it wont work now. What I'm trying to accomplish is essentially taking a typed out string from an edit box an calculating the answer.

    Example:
    I type "(2+2)3" into a text box, then press a key and the box changes to "12".

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    tompa's Avatar
    Join Date
    Nov 2011
    Location
    Uppsala, Sweden
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe conversions?

    Str$()
    Val()

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    crayzorechos's Avatar
    Join Date
    Feb 2013
    Location
    Russia.
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi ratty! This is pretty easy! For your example:
    Code:
    global int_ResultStringCalculation=( Val(Mid$(Global String A, 1, 1 ) ) + Val(Mid$(Global String A, 3, 1 ) ) ) * Val(Mid$(Global String A, 6, 1 ) )
    If you need, that user can be change action by number, you can write hardness code for this!

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUnicode Add-onInstall Creator

    Join Date
    Jul 2006
    Posts
    1,018
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can find the extension Expression Evaluator (or ExpEval Object) in the Extension Manager.
    It has an expression to evaluate formulas: Evaluate$( "ExpEval Object", "(2+2)*3" )

Similar Threads

  1. Possibility of doing Math calculations based on numbers input like excel?
    By Worick in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th November 2013, 04:29 AM
  2. calculations via string
    By Skyhunter in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 26th November 2012, 07:31 PM
  3. [bug] String Paragraphs: 0 or 1 based index??
    By Bipolar_Games in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th August 2012, 04:03 PM
  4. Which is the better way to make precise calculations?
    By Ls2 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 14th December 2011, 12:20 AM
  5. Condition based on contents of a string?
    By fawfulfan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 15th January 2011, 10:53 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
  •