Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
premiumxy
Posted - 09/15/2010 : 04:12:40 AM Dear all,
I have a - to my opinion - simple problem: I have two columns, containing numbers. I want to combine these numbers with a string operation in a third column (and later use this column as a label-column).
Example:
ColA ColB ColC 1 5 15
How can I (1) convert numbers to string, and (2) join these strings?
5 L A T E S T R E P L I E S (Newest First)
Penn
Posted - 09/17/2010 : 12:10:38 AM Hi Stefan,
Actually, you don't need to use $() notation for ii from Origin 8. So you can just use the script like:
For 1st question: The $() notation is used for numeric to string conversion. This notation evaluates the given expression at run-time, converts the result to a numeric string, and then substitutes the string for itself. Please refer to substitution notation.
For 2nd question: This is about how to access column object. Please refer to this page.
Penn
premiumxy
Posted - 09/15/2010 : 06:52:19 AM Thank you very much, Penn. Problem solved to 100%! :-)
May I still ask two little things (giving me a link for further reading is also ok), since I am new to LabTalk:
(1) Why do you use $(ii) instead of just ii to reference to the variable ii? (2) I tried to change the type of the column to "label" via wks.col3.type = 5; It only worked for "col3" but not for col(c). In your example, col(c) did also work. Why?
Thanks a lot, Stefan
Penn
Posted - 09/15/2010 : 05:34:13 AM Hi,
About how to convert numeric to string, please refer to this page. For your case, you need a loop structure to go through all the rows. You can put the following script in the Before Formula Scripts panel of the Set Values dialog and have a try.