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
 Can I use temporary dataset values in getn?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Katti

Norway
13 Posts

Posted - 10/17/2018 :  05:55:19 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all,

I'd like to use a dataset in a getn subroutine, but getn doesn't seem to be able to take dataset values.

What I'm trying is something like this:

dataset values;
values.setsize(3);
getn (Value 1) values[1] (Value 2) values[2] (Value 3) values[3];

Creating individual variables for the getn dialogue is possible but confounded by my need to be able to handle a variable number of dataset values. The subroutine to handle the number of dataset values is ok - it's just the getn function that's causing a headache. I have a workaround with a variable number of variables but it's cumbersome. Any help would be greatly appreciated.

Hideo Fujii

USA
1582 Posts

Posted - 10/17/2018 :  1:14:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Katti,

Though this is not a direct answer to your question, you may want to try like following:
str$="(Value 1) rr1 (Value 2) rr2 (Value 3) rr3";
getn %(str$);
ii=2;
rr$(ii)=;
You can construct str$ by string manipulation depending on the desired number of variables.

Hope this helps.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 10/17/2018 1:16:00 PM
Go to Top of Page

Katti

Norway
13 Posts

Posted - 10/18/2018 :  08:48:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Hideo Fujii

str$="(Value 1) rr1 (Value 2) rr2 (Value 3) rr3";
getn %(str$);
ii=2;
rr$(ii)=;
You can construct str$



Hi Hideo, this is pretty much what I'm doing at the moment :-)
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