Re: [Orgmode] Making a list to string
On Jul 12, 2007, at 7:23, Cecil Westerhof wrote: And when I put ';S' after the formula, I get the same as with nothing after the formula. Why this error by ';N'? Also what is the meaning of the strange expansion by concat? Maybe not neccesary, but I like to understand what is happening. When you put "N", each field is converted into a number before it is interpolated into the formula. So "2007-02-02" becomes 2007, and it is inserted *as a number* into the Lisp form. concat is a function that concatenates string - it cannot handle numbers, so it throws an error. - Carsten ___ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Making a list to string
Op do, 12-07-2007 te 01:04 -0500, schreef Eddward DeVilla: > On 7/12/07, Cecil Westerhof <[EMAIL PROTECTED]> wrote: > > Yes, it looks like it works completly. (What I am missing is a knowledge > > of Lisp. Thus that will come.) > > > > One thing bugs me. I am used to end a formula ending with ';N'. > > By default the field values are passed to the lisp expression as a > string. If you want it to be passed as a number you need the ;N. So > if @3$4 = 123: > > '(foo @3$4) => '(foo "123") > '(foo @3$4);N => '(foo 123) I remember Carsten mentioning something about this. I would expect the ';N' have influence on the output, not on the input. -- Cecil Westerhof <[EMAIL PROTECTED]> ___ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Making a list to string
On 7/12/07, Cecil Westerhof <[EMAIL PROTECTED]> wrote: Yes, it looks like it works completly. (What I am missing is a knowledge of Lisp. Thus that will come.) One thing bugs me. I am used to end a formula ending with ';N'. By default the field values are passed to the lisp expression as a string. If you want it to be passed as a number you need the ;N. So if @3$4 = 123: '(foo @3$4) => '(foo "123") '(foo @3$4);N => '(foo 123) Edd ___ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Making a list to string
Op wo, 11-07-2007 te 16:59 -0500, schreef Eddward DeVilla: > I take that back. I think it is right. I thought hard coded and > frodatum were supposed to match. Unfortunately, it looks like the > mailed mangles the formula line. > > On 7/11/07, Eddward DeVilla <[EMAIL PROTECTED]> wrote: > > Is this any better. I don't think it's entirely right yet. > > > >|---++++| > >| | datum | from datum | hard coded || > >|---++++| > >| # | 2007-01-01 | 1 | 1 | 2007-01-01 | > >| # | 2007-07-09 |190 |190 | 2007-07-09 | > >| # | 2007-07-11 |192 |192 | 2007-07-11 | > >| # | 2007-09-11 |254 | 1 | 2007-09-11 | > >| # | 20071012 |192 | 1 | 20071012 | > >|---++++| > > #+TBLFM: $3='(time-to-day-in-year (org-read-date t t (concat > > $2)))::$5='(concat $2)::@2$4='(time-to-day-in-year (org-read-date t t > > "2007-01-01"));N::@3$4='(time-to-day-in-year (org-read-date t t > > "2007-07-09"));N::@4$4='(time-to-day-in-year (org-read-date t t > > "2007-07-11"));N::@5$4='(time-to-day-in-year (org-read-date t t > > "2007-01-01"));N Yes, it looks like it works completly. (What I am missing is a knowledge of Lisp. Thus that will come.) One thing bugs me. I am used to end a formula ending with ';N'. Sometimes if you do not do this, this geves an error. But in this case this gives an error: Substitution history of formula Orig: '(time-to-day-in-year (org-read-date t t (concat $2))) $xyz-> '(time-to-day-in-year (org-read-date t t (concat $2))) @r$c-> '(time-to-day-in-year (org-read-date t t (concat $2))) $1->'(time-to-day-in-year (org-read-date t t (concat 2007))) Result: #ERROR Format: NONE Final: #ERROR When using nothing after the formula, I get: Substitution history of formula Orig: '(time-to-day-in-year (org-read-date t t (concat $2))) $xyz-> '(time-to-day-in-year (org-read-date t t (concat $2))) @r$c-> '(time-to-day-in-year (org-read-date t t (concat $2))) $1->'(time-to-day-in-year (org-read-date t t (concat #("2007-01-01" 0 1 (hilit-chg hilit-chg lazy-lock t) 1 2 (hilit-chg hilit-chg lazy-lock t) 2 3 (hilit-chg hilit-chg lazy-lock t) 3 4 (hilit-chg hilit-chg lazy-lock t) 4 5 (hilit-chg hilit-chg lazy-lock t) 5 6 (hilit-chg hilit-chg lazy-lock t) 6 8 (hilit-chg hilit-chg lazy-lock t) 8 9 (hilit-chg hilit-chg lazy-lock t) 9 10 (hilit-chg hilit-chg lazy-lock t) Result: 1 Format: NONE Final: 1 And when I put ';S' after the formula, I get the same as with nothing after the formula. Why this error by ';N'? Also what is the meaning of the strange expansion by concat? Maybe not neccesary, but I like to understand what is happening. -- Cecil Westerhof <[EMAIL PROTECTED]> ___ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Making a list to string
I take that back. I think it is right. I thought hard coded and frodatum were supposed to match. Unfortunately, it looks like the mailed mangles the formula line. On 7/11/07, Eddward DeVilla <[EMAIL PROTECTED]> wrote: Is this any better. I don't think it's entirely right yet. |---++++| | | datum | from datum | hard coded || |---++++| | # | 2007-01-01 | 1 | 1 | 2007-01-01 | | # | 2007-07-09 |190 |190 | 2007-07-09 | | # | 2007-07-11 |192 |192 | 2007-07-11 | | # | 2007-09-11 |254 | 1 | 2007-09-11 | | # | 20071012 |192 | 1 | 20071012 | |---++++| #+TBLFM: $3='(time-to-day-in-year (org-read-date t t (concat $2)))::$5='(concat $2)::@2$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N::@3$4='(time-to-day-in-year (org-read-date t t "2007-07-09"));N::@4$4='(time-to-day-in-year (org-read-date t t "2007-07-11"));N::@5$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N On 7/11/07, Cecil Westerhof <[EMAIL PROTECTED]> wrote: > I have the following table: > |---++---++--| > | | datum |from datum | hard coded | | > |---++---++--| > | # | 2007-01-01 | 192 | 1 | [50, 48, 48, 55, 45, 48, 49, 45, 48, 49] | > | # | 2007-07-09 | 192 |190 | [50, 48, 48, 55, 45, 48, 55, 45, 48, 57] | > | # | 2007-07-11 | 192 |192 | [50, 48, 48, 55, 45, 48, 55, 45, 49, 49] | > | # | 2007-09-11 | 192 | 1 | [50, 48, 48, 55, 45, 48, 57, 45, 49, 49] | > | # | 20071012 | 192 | 1 | [50, 48, 48, 55, 49, 48, 49, 50] | > |---++---++--| > #+TBLFM: $3='(time-to-day-in-year (org-read-date t t "$2"));N::$5="$2"::@2$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N::@3$4='(time-to-day-in-year (org-read-date t t "2007-07-09"));N::@4$4='(time-to-day-in-year (org-read-date t t "2007-07-11"));N::@5$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N:: > > The column 'from datum' does not get the right values. The last column > shows why. "$2" gives a list of ASCII values of the string instead of > the string. This makes that org-read-data gets 50 as a parameter instead > of the string representing a date. How do I convert this list back to > the string it is representing? > > -- > Cecil Westerhof <[EMAIL PROTECTED]> > > > > ___ > Emacs-orgmode mailing list > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > ___ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Making a list to string
Is this any better. I don't think it's entirely right yet. |---++++| | | datum | from datum | hard coded || |---++++| | # | 2007-01-01 | 1 | 1 | 2007-01-01 | | # | 2007-07-09 |190 |190 | 2007-07-09 | | # | 2007-07-11 |192 |192 | 2007-07-11 | | # | 2007-09-11 |254 | 1 | 2007-09-11 | | # | 20071012 |192 | 1 | 20071012 | |---++++| #+TBLFM: $3='(time-to-day-in-year (org-read-date t t (concat $2)))::$5='(concat $2)::@2$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N::@3$4='(time-to-day-in-year (org-read-date t t "2007-07-09"));N::@4$4='(time-to-day-in-year (org-read-date t t "2007-07-11"));N::@5$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N On 7/11/07, Cecil Westerhof <[EMAIL PROTECTED]> wrote: I have the following table: |---++---++--| | | datum |from datum | hard coded | | |---++---++--| | # | 2007-01-01 | 192 | 1 | [50, 48, 48, 55, 45, 48, 49, 45, 48, 49] | | # | 2007-07-09 | 192 |190 | [50, 48, 48, 55, 45, 48, 55, 45, 48, 57] | | # | 2007-07-11 | 192 |192 | [50, 48, 48, 55, 45, 48, 55, 45, 49, 49] | | # | 2007-09-11 | 192 | 1 | [50, 48, 48, 55, 45, 48, 57, 45, 49, 49] | | # | 20071012 | 192 | 1 | [50, 48, 48, 55, 49, 48, 49, 50] | |---++---++--| #+TBLFM: $3='(time-to-day-in-year (org-read-date t t "$2"));N::$5="$2"::@2$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N::@3$4='(time-to-day-in-year (org-read-date t t "2007-07-09"));N::@4$4='(time-to-day-in-year (org-read-date t t "2007-07-11"));N::@5$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N:: The column 'from datum' does not get the right values. The last column shows why. "$2" gives a list of ASCII values of the string instead of the string. This makes that org-read-data gets 50 as a parameter instead of the string representing a date. How do I convert this list back to the string it is representing? -- Cecil Westerhof <[EMAIL PROTECTED]> ___ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Making a list to string
I have the following table: |---++---++--| | | datum |from datum | hard coded | | |---++---++--| | # | 2007-01-01 | 192 | 1 | [50, 48, 48, 55, 45, 48, 49, 45, 48, 49] | | # | 2007-07-09 | 192 |190 | [50, 48, 48, 55, 45, 48, 55, 45, 48, 57] | | # | 2007-07-11 | 192 |192 | [50, 48, 48, 55, 45, 48, 55, 45, 49, 49] | | # | 2007-09-11 | 192 | 1 | [50, 48, 48, 55, 45, 48, 57, 45, 49, 49] | | # | 20071012 | 192 | 1 | [50, 48, 48, 55, 49, 48, 49, 50] | |---++---++--| #+TBLFM: $3='(time-to-day-in-year (org-read-date t t "$2"));N::$5="$2"::@2$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N::@3$4='(time-to-day-in-year (org-read-date t t "2007-07-09"));N::@4$4='(time-to-day-in-year (org-read-date t t "2007-07-11"));N::@5$4='(time-to-day-in-year (org-read-date t t "2007-01-01"));N:: The column 'from datum' does not get the right values. The last column shows why. "$2" gives a list of ASCII values of the string instead of the string. This makes that org-read-data gets 50 as a parameter instead of the string representing a date. How do I convert this list back to the string it is representing? -- Cecil Westerhof <[EMAIL PROTECTED]> ___ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode