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
 Return Command
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

LabTalk user

USA
35 Posts

Posted - 09/13/2010 :  5:59:06 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.1 SR3
Operating System: Windows XP

I am writing a function and wondering if the return command can return string registers or do I need to write the registers to a variable to return them.


Thanks!

Penn

China
644 Posts

Posted - 09/13/2010 :  11:40:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Both can be used to return the string registers. However, if the registers are not assigned to a variable first, the double quotes are needed.

function string testStr()
{
	string str$ = %H;
	return str$;

	// return "%H";  // return string register directly, need double quotes
}
string str$ = testStr()$;
str$=;


Penn
Go to Top of Page

LabTalk user

USA
35 Posts

Posted - 09/14/2010 :  11:00:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much. This helps a lot.
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