Graphics

 View Only
  • 1.  Visual Logic "“ evaluation numeric text fields

    Posted 09-11-2014 00:31
    Is there a way to do a VAL() on text in a field, so that, if the text represents a numeric value, that value can be extracted and applied to another property someplace? For example, say I have a field that displays a percentage, and I want to use that value to scale a bar (as in a graph). Can I do thins with Visual Logic? If not, can such a thing be added to the string functions?


  • 2.  RE: Visual Logic "“ evaluation numeric text fields

    Posted 09-11-2014 14:58
    Jim, you can connect a Text object directly to something like the Height of a quad and it automatically converts the text value to an numeric value.. You would need to strip the % sign though, as that will cause the conversion to fail.

    #XPression


  • 3.  RE: Visual Logic "“ evaluation numeric text fields

    Posted 09-11-2014 18:08
    Thanks, that's good to know. Is there some documentation on Visual Logic? There may well be other stuff that would be great to know going in...

    Also, playing around a bit, how do I remove that percent sign? I don't necessarily know the character count of the string going in, and a Left String (Length - 1) doesn't seem to work.

    #XPression


  • 4.  RE: Visual Logic "“ evaluation numeric text fields

    Posted 09-11-2014 20:25
    You could use the String Replace function to replace the % sign with (blank)..

    Like this: http://i.imgur.com/Ir9kIGz.png



    Replace is only in version 5.7 and above.. 5.7 is only available as Beta right now but should be releasing soon.

    #XPression


  • 5.  RE: Visual Logic "“ evaluation numeric text fields

    Posted 09-11-2014 21:32
    Brian, I have 5.7 build 3020, and I'm trying this out there. Let's see how it goes.

    #XPression


  • 6.  RE: Visual Logic "“ evaluation numeric text fields

    Posted 09-11-2014 21:43
    OK, so I used X-scale instead of Height, and I divided by 100 to get the percentage, and it works great. Thanks, Brian, this is some good stuff.

    What I'd like to see is perhaps some more string functions, or a bit more clarity in documentation. Maybe a string Length function would be helpful, so we could do some things like cutting off some part of a string without knowing its length or specifics of its contents going in, but, in this particular case, your solution works fine.

    #XPression


  • 7.  RE: Visual Logic "“ evaluation numeric text fields

    Posted 09-12-2014 03:31
    Jim, There already is a string length function.. I'll give it a try to see if it can be used for your situation..

    #XPression


  • 8.  RE: Visual Logic "“ evaluation numeric text fields

    Posted 09-12-2014 19:52
    Hmmm... I looked for it on my build, but didn't find it. I'm going to install the latest build, and see what's there. Latest we have here is 5.9_3110.

    #XPression


  • 9.  RE: Visual Logic "“ evaluation numeric text fields

    Posted 09-12-2014 22:55
    I have it in my 5.7 build. It's called "String Length" in the Strings folder.



    #XPression


  • 10.  RE: Visual Logic "“ evaluation numeric text fields

    Posted 09-12-2014 23:15
    Your 5.7 build may be more recent than mine.I see it in 5.9_3110, but not in 5.7_3020.

    Also, in my 5.7, "String Value" is simply "String." 5.9 looks like the screen shot you have here.

    #XPression