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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 dlgchklist with string array

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
J.S.Schulte Posted - 07/26/2016 : 03:56:55 AM
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


2   L A T E S T    R E P L I E S    (Newest First)
J.S.Schulte Posted - 07/27/2016 : 08:48:02 AM
Hi Hideo,

it worked perfect!
Thank you very much!!!

Best,
Jan
Hideo Fujii Posted - 07/26/2016 : 11:03:13 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000