The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Multi-lined text labels

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Mike Buess Posted - 07/05/2002 : 10:54:50 AM
The normal method for accessing the nnth line of a string variable is

%A=%[%Z,@nn];

But that expression only works for nn<=100, evven though you can fill %Z with many more than 100 lines.

Example...

%Z=line 1;
loop (ii,2,200) {
%Z=%Z
line $(ii);
};
%Z=;
line 1
line 2
.
.
.
line 200

%A=%[%Z,@100];
%A=;
line 100
%A=%[%Z,@101];
%A=;
(no return value)

Is there another LabTalk or OriginC method for access the lines > 100?

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/05/2002 10:56:04

Edited by - Mike Buess on 07/05/2002 11:07:19
2   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 07/05/2002 : 2:00:04 PM
Good idea. Actually, I can probably just create %Z as one line with '|' separators in the first place.

Thanks,

Mike Buess
Origin WebRing Member
cpyang Posted - 07/05/2002 : 1:07:58 PM
Best would be if we add a new method to string class to handle lines. For now, the following code will show how you can do this.


void tt()
{
GraphLayer gl = Project.ActiveLayer();
if(NULL==gl)
return;

GraphObject gr;
gr = gl.GraphObjects("Text");
if(NULL==gr)
return;

string str = gr.Text;
// assume text does not have '|' so
// can be used as separator
str.Replace("\r\n","|");
StringArray sa;
int nCount;
if((nCount = str.GetTokens(sa, '|')) > 0)
{
for(int ii = 0; ii < nCount; ii++)
out_str(sa[ii]);
}
return;
}




Edited by - cpyang on 07/05/2002 13:08:37

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000