<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Split Command - Number or Text in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Split-Command-Number-or-Text/m-p/215827#M12776</link>
    <description>&lt;PRE&gt;width=8 ! paragraph length in m
oneline="The quick black architect jumped over the lazy programmer. Lore ipsum!"

! settings
DIM absatz[]
i=1
absatz&lt;I&gt;=""
factorT=GLOB_SCALE/1000
last=0
space=1

DO
	space = STRSTR(STRSUB(oneline,last+1,255)," ")
	IF space THEN GOSUB "addpart"
	last=last+space
	WHILE space

space=STRLEN(oneline)-last
GOSUB "addpart"

LINE2 0,0,width,0

FOR i=1 TO VARDIM1(absatz)
	TEXT2 0,-0.75*i, "'"+absatz&lt;I&gt;+"'"
	NEXT i
END

"addpart":
IF STW(absatz&lt;I&gt;+STRSUB(oneline,last+1,space))*factorT&amp;lt;width THEN
	absatz&lt;I&gt;=absatz&lt;I&gt;+STRSUB(oneline,last+1,space)
	ELSE
	i=i+1
	absatz&lt;I&gt;=""+STRSUB(oneline,last+1,space)
	ENDIF
RETURN&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 03 Dec 2013 21:42:22 GMT</pubDate>
    <dc:creator>Frank Beister</dc:creator>
    <dc:date>2013-12-03T21:42:22Z</dc:date>
    <item>
      <title>Split Command - Number or Text</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Split-Command-Number-or-Text/m-p/215825#M12774</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;OK, &lt;BR /&gt;
have been spending all day setting up a zone stamp that when the zone name gets too long, it separates over multiple text2 commands.&lt;BR /&gt;
The reason I am doing this is because a paragraph doesn't translate well into AutoCAD (translates as one line)&lt;BR /&gt;
&lt;BR /&gt;
All was going rosy until I put a number in the zone name, and it went bang.&lt;BR /&gt;
&lt;BR /&gt;
Looking at the split command again, I realised it is differentiated between numbers and text. Is there a way it can find a variable as a number or a text.&lt;BR /&gt;
&lt;BR /&gt;
This is my current split command, which only contains words.&lt;BR /&gt;
&lt;BR /&gt;
znx = split(room_name, "%s %s %s %s %s %s %s", zn1a,zn2a,zn3a,zn4a,zn5a,zn6a,zn7a)&lt;BR /&gt;
&lt;BR /&gt;
I hope my day of work hasn't been wasted  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_evil.gif" style="display : inline;" /&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Dec 2013 05:52:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Split-Command-Number-or-Text/m-p/215825#M12774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-03T05:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Split Command - Number or Text</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Split-Command-Number-or-Text/m-p/215826#M12775</link>
      <description>You could check the variables by a VARTYPE command and can afterwards return the numbers into chars by STR command.&lt;BR /&gt;
&lt;BR /&gt;
I would better try it in something like a loop to search by STRSUB for the spaces, check the cumulated width and add it to two new strings - segent by segment.</description>
      <pubDate>Tue, 03 Dec 2013 20:56:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Split-Command-Number-or-Text/m-p/215826#M12775</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2013-12-03T20:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Split Command - Number or Text</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Split-Command-Number-or-Text/m-p/215827#M12776</link>
      <description>&lt;PRE&gt;width=8 ! paragraph length in m
oneline="The quick black architect jumped over the lazy programmer. Lore ipsum!"

! settings
DIM absatz[]
i=1
absatz&lt;I&gt;=""
factorT=GLOB_SCALE/1000
last=0
space=1

DO
	space = STRSTR(STRSUB(oneline,last+1,255)," ")
	IF space THEN GOSUB "addpart"
	last=last+space
	WHILE space

space=STRLEN(oneline)-last
GOSUB "addpart"

LINE2 0,0,width,0

FOR i=1 TO VARDIM1(absatz)
	TEXT2 0,-0.75*i, "'"+absatz&lt;I&gt;+"'"
	NEXT i
END

"addpart":
IF STW(absatz&lt;I&gt;+STRSUB(oneline,last+1,space))*factorT&amp;lt;width THEN
	absatz&lt;I&gt;=absatz&lt;I&gt;+STRSUB(oneline,last+1,space)
	ELSE
	i=i+1
	absatz&lt;I&gt;=""+STRSUB(oneline,last+1,space)
	ENDIF
RETURN&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2013 21:42:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Split-Command-Number-or-Text/m-p/215827#M12776</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2013-12-03T21:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Split Command - Number or Text</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Split-Command-Number-or-Text/m-p/215828#M12777</link>
      <description>wow, didn't expect the whole code.&lt;BR /&gt;
checking A17 translator, it seems to translate better. But still with problems.&lt;BR /&gt;
Looking forward to trying this today.&lt;BR /&gt;
Many Thanks!</description>
      <pubDate>Tue, 03 Dec 2013 21:49:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Split-Command-Number-or-Text/m-p/215828#M12777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-03T21:49:04Z</dc:date>
    </item>
  </channel>
</rss>

