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
 Selected column in script

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
shedo Posted - 06/30/2021 : 02:24:25 AM
Hi there.
I wanted to copy the comments of the selected column, and paste it as the name of a new sheet in a different workbook.

However, I could not figure out how to do this on a Labtalk script.

Sorry for the noob question, but I am new to this.
Thank you :)


2   L A T E S T    R E P L I E S    (Newest First)
shedo Posted - 07/01/2021 : 01:21:15 AM
Hi there Chris D.

Thank you for the solution!
I understood now. It seems that there is no code to directly manipulate where the column is selected.
So we have to check which code is currently active one by one and take the index out yeah?
This is a nice workaround.

Thanks!!



quote:
Originally posted by Chris D

You may adapt this. It is one way to do it.

// Book1 1 is active
string comm$;
for (int ii = 1; ii <= wks.ncols; ii++)
{
    if (wks.isColSel(ii))
    {
        comm$ = wcol(ii)[C]$;
        break;
    }
}
if (comm.GetLength() > 0)
{
    // Activate Book2
    win -a Book2;
    wks.name$ = comm$;
}



Thanks,
Chris Drozdowski
Originlab Technical Support


Chris D Posted - 06/30/2021 : 12:12:06 PM
You may adapt this. It is one way to do it.

// Book1 1 is active
string comm$;
for (int ii = 1; ii <= wks.ncols; ii++)
{
    if (wks.isColSel(ii))
    {
        comm$ = wcol(ii)[C]$;
        break;
    }
}
if (comm.GetLength() > 0)
{
    // Activate Book2
    win -a Book2;
    wks.name$ = comm$;
}



Thanks,
Chris Drozdowski
Originlab Technical Support

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