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
 Sum of multiple matrices
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1205 Posts

Posted - 07/20/2021 :  04:36:21 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2021b (64-bit) SR2 9.8.5.212
Windows 10 21H1 x64

Greetings!

I try preparing a formula for Set Values... with the following LT script:

string TargetFormula$ = "";

loop (i, 9, wks.nmats)
(
  TargetFormula$ = TargetFormula$ + "mat($(i))+";
)
	
TargetFormula$ = ;


However, in the result I have no output of the resulting string.
What is my mistake?

Thank you.

---
Andrey

Edited by - AKazak on 07/20/2021 04:49:51 AM

YimingChen

1666 Posts

Posted - 07/21/2021 :  11:57:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The loop block should be bounded by {}, not ().

James
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 07/21/2021 :  12:01:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

The loop block should be bounded by {}, not ().

James



Dear James,

https://www.originlab.com/doc/LabTalk/ref/Loop-cmd tells that I should use () with loop and {} with for.

Please fix the documentation.

---
Andrey
Go to Top of Page

YimingChen

1666 Posts

Posted - 07/21/2021 :  12:06:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Fixed. Thank you.

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