SPLIT

Home Forums General discussions SPLIT

Viewing 4 reply threads
  • Author
    Posts
    • #4674
      David Seabury
      Participant

      I can not figure out how to split the following
      “#4 Rebar”. I can not split the pound sign form
      the number. Any insights would be helpful.

      Thanks

      David

    • #4675
      David Shorter
      Participant

      here you go
      !!!!!2D script
      !!=======================
      string=“#4 Rebar”
      number=strlen(string)
      text2 0,0,number
      reducedString=STRSUB(string, 2,number-2)
      text2 0,-.5, reducedString
      !!=======================
      number = 9
      reducedString = 4 Rebar

      this is one way but there per others
      Hope this helps
      David

      Attachments:
    • #4677
      David Seabury
      Participant

      David

      Thanks for the reply, I have no idea what you did there
      but I will look the GDL guide and see what I can learn.
      I was trying to use SPLIT and got no where.

      Thanks Again

      David

    • #4679
      Péter Baksa
      Keymaster

      SPLIT can only process numbers delimited with whitespace.

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

    • #18203
      Lingwisyer GC
      Participant

      David’s code basically figures out where the # is then prints out “number – 2″ characters after this location. Number being the length of the calculated string. In the example only the opening ” is required to indicate that it is not a parameter.

      Ling.

      AC18-23 AUS 4006
      Self-taught, bend it till it breaks.
      Win7 | E5620 x 2 | 24GB | K2200

Viewing 4 reply threads
  • The forum ‘General discussions’ is closed to new topics and replies.