Question: Can UDTs be used for operations i.e. calculation (and if so, what language, syntax etc)? (and question about UDT syntax generally)

78 views
Skip to first unread message

Jon R

unread,
Jul 15, 2018, 3:11:40 PM7/15/18
to abstractspoon-t...@googlegroups.com
Hi, well the question in the title really but some background: Say I wanted to add two number fields and store the result in a third (custom) field? Is that possible, and how would I do it?

As a workaround I could operate on the automatic csv export in Excel and then immediately reimport the entire tdl, but that is bit sledgehammery... I was hoping a native method was available (ie field type 'calculated') - or UDT as a middle option.

Aside - I also noticed that a UDT that I wrote a few weeks ago isn't working now and wonder if something broke in relation to custom fields, specifically copying a start date? I wrote the UDT : -copy sd $(seltcustom, cust_originaldate)

So I had set up the custom field "originaldate" as a date field bc the support material had stated that only a 'like' field type would work and i think that tested OK... But now nothing happens. I have other date related UDTS that work fine - for instance:

-xid $(todaysdate)

That actually does not require a date field type (since externalID is a 'general' field ie text) but in fact I love the fact it a. works and b. pastes in ISO format which was exactly what i needed.

In fact I'd like to copy the creation date but can't find a variable name for that in the literature?

Thanks!

Jon

PS I first wrote this over at codeproject but i guess that's no longer monitored now?

.dan.g.

unread,
Jul 15, 2018, 9:50:46 PM7/15/18
to ToDoList (AbstractSpoon) Support
Hi Jon

>> Is that possible, and how would I do it?

Unfortunately the software currently provides no way to perform calculations with the partial exception of dates which allow positive or negative offsets from the current value.

>> -copy sd $(seltcustom, cust_originaldate)

To copy to a custom field you need to specify just the custom attribute ID otherwise you are actually trying to copy to the 'value' of the attribute, not the attribute itself.. 

ie. you probably want '-copy sd cust_originaldate'

ps. For this you will need 7.2.RC2 because '-copy' is new to 7.2.

>> I'd like to copy the creation date 

For this you will need 7.2.RC2 and the switch you want is 'md' (Help > Command Line Options).

>> I first wrote this over at codeproject but i guess that's no longer monitored now?

I do still monitor it but much less often... Sorry about that.

Jon R

unread,
Jul 17, 2018, 4:02:08 PM7/17/18
to ToDoList (AbstractSpoon) Support
Thanks again! The problem is probably my memory confusing different tests I did. So I will install 7.2 as soon as I can and try that out -- and actually the date offset method is very useful too now you reminded me. Currently I'm struggling to keep Win10 functional with some kind of registry corruption so bizarrely I can't install sw at all atm.

Now I'm reacquainted with Google Groups I might as well stay here, no problem!

Jon


Reply all
Reply to author
Forward
0 new messages