openmolecules.org

 
Home » DataWarrior » Functionality » Creating text in a column via macro
Creating text in a column via macro [message #350] Sat, 12 May 2018 05:40 Go to next message
amorrison
Messages: 38
Registered: March 2016
Member
Hi,
I'm trying to create a macro that will tidy up data and create some new columns. One of the columns will change every time and would need input from the user. I tried the following in the process

1) define variable - gave it a name and left value blank
2) Add calculated value - in the formula I put the variable name in step 1

When I run the macro, I get asked the value of the variable, which I complete, but it then doesn't populate all the rows of the calculated column with the variable in step 2. Is this the correct approach, if so what am i doing wrong? Or should I be doing it another way?

Thanks,

Angus
Re: Creating text in a column via macro [message #351 is a reply to message #350] Sun, 13 May 2018 00:12 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
Hi Angus,

I admit that currently the handling of explicit variables is neither consistent not complete.
It is very new and was done as a (possibly to quick) solution for an internal problem.

You can refer to you variable in task 2 (formula for calculated values), if you put a '$' sign ahead of the name.
When solving the equation for every row, the expression calculator treats your variable input as a column name.
If such a column exists, the row's value of that column (and not your input value) is used when solving the equation.

I am not sure, whether this is already part of 4.7.2, it certainly is in 4.7.3, which is the current Windows download.

Thomas
Re: Creating text in a column via macro [message #352 is a reply to message #351] Sun, 13 May 2018 06:36 Go to previous message
amorrison
Messages: 38
Registered: March 2016
Member
Thanks Thomas, looks like it wont do what I was trying to achieve. We can do this step manually.

Thanks again,

Angus
Previous Topic: add empty rows
Next Topic: How to enter custom core?
Goto Forum:
  


Current Time: Mon Nov 25 13:12:14 CET 2024

Total time taken to generate the page: 0.03748 seconds