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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 type function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

shyamigcar2

India
25 Posts

Posted - 06/07/2017 :  10:49:39 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
wks.ncols=100;
w = wks.maxrows;
int i;
wcolwidth 4, 11;
loop(i,1,$(w))
{
y=col(1)[i+1];
String ter$(i)$ = col(2)[i+1]$;

if(col(1)[i]==col(1)[i+1])
{
n=i;
type "the numbers are same and the number is $(y) and the word is %(ter$(i))";
m=i+4;
Col($(m))[n]$=ter$(i)$;
}
else
type "the numbers are different;

}

I have some numbers in column 1 and column 2 contains some strings. I have collected the strings (String ter$(i)$ = col(2)[i+1]$)
I wanted to use the type command and see the collected strings in the command window. The type command (type "the numbers are same and the number is $(y) and the word is %(ter$(i))";) does not output the strings collected. What is the mistake?

cpyang

USA
1406 Posts

Posted - 06/07/2017 :  6:16:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Why do you need the string to have enumeration? You are not storing it, just

loop(i,1,5)
{
	String ter$ = col(2)[i+1]$;
	type "the word is %(ter$)";
}



CP
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000