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
 I need help, please
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Miria_A

Germany
Posts

Posted - 06/27/2005 :  3:22:39 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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
?

Thomas M

Germany
Posts

Posted - 06/28/2005 :  04:05:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

greg

USA
1380 Posts

Posted - 06/28/2005 :  11:24:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Thomas M

Germany
Posts

Posted - 06/30/2005 :  08:16:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
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