Graphics

 View Only
  • 1.  string compare not (always) working

    Posted 02-13-2020 02:23

    as title,   text1 > text   ,the Quad1 need to move left , when  i compare 12 and 14 the script is working 

    But when i compare 10and 5 , the script is not working,what wrong with my Script  THX



  • 2.  RE: string compare not (always) working

    Posted 02-13-2020 04:02

    string.compare is doing an alphabetic sort.  

    10 is less than 5 when sorted alphabetically (not numerically).

    It seems like you actually want to compare the values as numbers, not just as a string.

     

      

     

     


    #XPression


  • 3.  RE: string compare not (always) working

    Posted 02-13-2020 04:12

    Brian,thx for respond
    So,if i want to use number compare, how can i do with script


    #XPression


  • 4.  RE: string compare not (always) working

    Posted 02-13-2020 04:14

    Something like:
    CInt(text1.text) < CInt(text.text)


    #XPression


  • 5.  RE: string compare not (always) working

    Posted 02-13-2020 04:18

    Or you could use CDbl(text.text) instead if expecting floating point values.


    #XPression


  • 6.  RE: string compare not (always) working

    Posted 02-14-2020 00:36

    Brain,apperciate i got it


    #XPression