User Tag List

Results 1 to 6 of 6

Thread: Evaluate min(x,y) string in running app

  1. #1
    Clicker 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
    Nov 2012
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Evaluate min(x,y) string in running app

    Hi!

    I know theres the object expeval, which can evaluate special string expressions. I wanted to define a return minimum of two values function: min(x,y), but the only functions I could use were the ones with the built-in operators. I could write "p1+p2" for addition, but how to do the same for min(x,y)?

    "min("+val(p1)+","+val(p2)+")" doesn't work either..

    Any suggestions?

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    646
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Min(val(p1), val(p2)), with no quotation marks or +'s. The Min/Max functions can't calculate strings, only numbers. There shouldn't be any "" outside of the Val() operators. If you want to return the Min() function as a string (this goes for all values), close it in Str$() like this:

    Str$(Min(val(p1), val(p2)))

  3. #3
    Clicker 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
    Nov 2012
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't write p1 and p2 as ctf thinks that's my global variables. I need to put them as strings somehow..

    Str$(Min(val(p1), val(p2))) won't work since p1 and p2 are not strings, but "p1+p2" (as string) will work fine..

    test.jpg

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm. What are you trying to evaluate - what are p1 and p2, if not your global variables?

  5. #5
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Ziplock's Avatar
    Join Date
    Oct 2013
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I'm misunderstanding too I think. If you're just trying to get the values of two strings and find the minimum, that would be Min(value( "String1" ), value( "String2" ) )

    but it's probably not that simple

  6. #6
    Clicker 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
    Nov 2012
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's all about the expeval object, which can evaluate user-defined expression within a running app.

    I want to be able to define own functions.
    In arguments of the "Define function" of expeval object you have to use p1..p2.. (as strigns as I think) variables as the passing arguments.

    Not sure if there's another way to pass and use them.

Similar Threads

  1. String splitting with string parser
    By Sejez in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 5th February 2013, 06:31 AM
  2. Unable to change a string with the list obect if string contains three periods in row
    By redpandagames in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 4th January 2013, 04:01 PM
  3. Using String Parser to check for any punctuation in a string
    By Apex in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 19th May 2012, 12:03 AM
  4. [BUG] String object does not retain its string
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th April 2011, 12:18 AM
  5. Could someone evaluate my noob level?
    By ShinigamiKiba in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 29th April 2009, 01:41 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
  •