Announcement

Collapse
No announcement yet.

if length of string is great than the number 40

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    if length of string is great than the number 40

    I am trying to use this conditional

    <mvt:if expr="len(g.ShipFirstName) GT 40">

    But it appears that len isn't valid. I get an error:
    expression compilation failed: unable to find function.

    I thought the mivascript string.so functions were available in the if statements.

    Is there a way to do this conditional in storemorph?
    In plain english I want to find out if ShipFirstName is longer than 40 characters.

    #2
    Re: if length of string is great than the number 40

    I think you need the toolbelt assign or eval functions. You can string functions within their parameters but not in store morph.

    Try:
    Code:
    <mvt:item name="ry_toolbelt" param="assign|g.shipfn|len(g.ShipFirstName)" />
    <mvt:if expr="g.shipfn GT 40">You have a very long first name!</mvt:if>
    http://www.alphabetsigns.com/

    Comment


      #3
      Re: if length of string is great than the number 40

      Originally posted by alphabet View Post
      I think you need the toolbelt assign or eval functions. You can string functions within their parameters but not in store morph.

      Try:
      Code:
      <mvt:item name="ry_toolbelt" param="assign|g.shipfn|len(g.ShipFirstName)" />
      <mvt:if expr="g.shipfn GT 40">You have a very long first name!</mvt:if>
      Toolkit equivalent:
      Code:
      <mvt:item name="toolkit" param="vlength|name_length|g.ShipFirstName" /> 
      <mvt:if expr="g.name_length GT 40">One person at a time please.</mvt:if>
      Regards,
      Bryan |
      http://1337coders.com

      Comment

      Working...
      X