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
 I need help, please

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
Miria_A Posted - 06/27/2005 : 3:22:39 PM
Hallo all.

I'm new here in this forum and I'm a absolut beginner in writing scripts with labtalk, but I need help in writing a smal script with labtalk, because I have not time enough and I must finish my PH.D in some weeks.
My problem is :
1) I have a worksheet with 30 columns (from A1(Y) - A30(Y)).
I need following functions :
a) A1,A4,A7,A10,A13,A16,A19,A22,A25,A28 --> should be X
is it possible to open a window with 30 (number of columns)
small boxes for selecting all the columns which should be X
and also for Y and for Z ?
b)after this I would like to select / choose some different
columns and delete this columns (maybe there is a windows
which ask me, which columns I like to delete)
c)later, when I have two worksheets (data1 and data2), I have to
make three mathematics operations (+,-,/2) with different
columns from the two worksheets
is it possible to choose in a window which operation I like
to do and with which different columns ?

I would be very happy, if somebody can help me.

Thank you all.

many greetings
miria_A
?

3   L A T E S T    R E P L I E S    (Newest First)
Thomas M Posted - 06/30/2005 : 08:16:21 AM
quote:

(b) I think Thomas M misunderstood this part and gave you the wrong information. The MARK command can be used to delete ROWS,


Ooops, soory! I've been to fast. My mistake.
greg Posted - 06/28/2005 : 11:24:45 AM
These seemed to be interface questions rather than programming questions. Both are included in my responses.

(a) Note that you can use Ctrl+Select to select multiple, non-contiguous Columns and use the Column Toolbar ( see View : Toolbars ) OR the RightClick SetAs context menu to set Display Properties.
Programmatically, you can use the older worksheet command (as Thomas M suggests) or the newer WKS object which eliminates the hard-coded 30:
for( ii = 1 ; ii <= wks.ncols ; ii += 3 )
{
wks.col$(ii).type = 4; // Use 1 for Y and 6 for Z
}

(b) I think Thomas M misunderstood this part and gave you the wrong information. The MARK command can be used to delete ROWS, but would be dangerous when used as described.
Deleting columns in the interface requires the Edit : Delete menu option ( available as keyboard Alt+E, D ) or Delete on the RightClick context menu. The Delete key will erase data in columns without deleting columns.
Programmatically:
del col(13)
del col(A13)
del %H_A13
val=13;del wcol(val)
all accomplish the same thing : deleting column 13 (named A13).

(c)In the interface, this can be done from a graph menu using the Analysis : Simple Math dialog.
WARNING! This dialog overwrites the first operand, so use a copy if you need to preserve the original data.
Programmatically you can use formal dataset names in mathematical expressions such as:
Data1_B = Data1_B + Data2_B; // Add B of Data2 to B of Data1
or
Data1_B += Data2_B; // same as above
Data2_B /= 2; // Divide column B of Data2 by 2


Edited by - greg on 06/29/2005 10:55:49 AM
Thomas M Posted - 06/28/2005 : 04:05:49 AM
Hello Miria,

to a)

open a script window (Window -> Script-Window)and enter the following:

_______________________
for (i=1;i<=30;i+3)
{
work -t $(i) 4;
};
_______________________

this will set every 3rd column to x. For y replace the 4 with 1 and for z replace it with 6.

to b)

You can delete with a right-click on the head of a row and choose "delete cells" or by a scriptwindow:

__________

mark -d col(name of your choise);
__________


to c)

If you want so you can write me a pm and we can discuss it in german or english

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