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
 dlgchklist with string array
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

J.S.Schulte

Germany
11 Posts

Posted - 07/26/2016 :  03:56:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Pro Ver. 2015G SR2:
Operating System: Windows 7 64 bit

Hi,

I have a worksheet with 23 columns with different parameters to analyse and/or plot. Now I want to create user interaction to decide which columns to plot using the dlgchklist command.

I already created a string array with the column longnames:

StringArray aa;
loop (var, 1, wks.ncols)
{
aa.Add(%(wks.col$(var).lname$))
};

Is there an option to use this array with dlgchklist instead of writing down each longname by hand?

dlgchklist inames:=?

Thanks for any help or suggestions.
Jan


Hideo Fujii

USA
1582 Posts

Posted - 07/26/2016 :  11:03:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jan,

The document clearly describes that the data type of the inames option is a string, not a StringArray.
http://www.originlab.com/doc/X-Function/ref/dlgChkList

Maybe you can define a simple conversion function like:
//////////////////////////////
function string strarray2str(StringArray sa, string sep) {
  string strResult;
  sasize=sa.GetSize();
  loop(ii,1,sasize) {
    if(ii<sasize) strResult$=strResult$+sa.GetAt(ii)$+sep$;
    else   strResult$=strResult$+sa.GetAt(ii)$;
  }
  return strResult$;
}

//sample execution of strarray2str
string MyResults$ = strarray2str(aa,"|")$; 
dlgChkList inames:=MyResults$ osel:=vnStat;
//////////////////////////////

Is this okay in your application?

--Hideo Fujii
OriginLab
Go to Top of Page

J.S.Schulte

Germany
11 Posts

Posted - 07/27/2016 :  08:48:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo,

it worked perfect!
Thank you very much!!!

Best,
Jan
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