#!%&*#@ scheme! ... help!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

#!%&*#@ scheme! ... help!

Brian-5
I'm trying to fix some things in the fancy invoice and I need help
before I give up again :(

I've already extended the properties dialog and business-utils.scm to
export those new items along with a few others.

I'm trying to change this:

     "Make all cheques payable to: Company Name Inc.\nDirect all inquiries to: Mr. Accounting Contact"))


with these:

     ((N_ "Make all cheques payable to: ") (list gnc:*business-label* gnc:*company-name*)
       ("\nDirect all inquiries to: ")  (list gnc:*business-label* gnc:*company-contact*)))))

How do you stick them all together?  I can't find anything similar to
copy in the fancy invoice and all the tutorials I've tried don't seem to
come close to this.  I've tried just about every permutation of list,
string-expand, string-append I can think of :(

Thanks.
--
Brian <[hidden email]>

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: #!%&*#@ scheme! ... help!

Derek Atkins
guile> (string-append "foo" "bar" "baz")
"foobarbaz"

You don't want the (list ...) stuff in there.

-derek

Quoting Brian <[hidden email]>:

> I'm trying to fix some things in the fancy invoice and I need help
> before I give up again :(
>
> I've already extended the properties dialog and business-utils.scm to
> export those new items along with a few others.
>
> I'm trying to change this:
>
>     "Make all cheques payable to: Company Name Inc.\nDirect all
> inquiries to: Mr. Accounting Contact"))
>
>
> with these:
>
>     ((N_ "Make all cheques payable to: ") (list gnc:*business-label*
> gnc:*company-name*)
>       ("\nDirect all inquiries to: ")  (list gnc:*business-label*
> gnc:*company-contact*)))))
>
> How do you stick them all together?  I can't find anything similar to
> copy in the fancy invoice and all the tutorials I've tried don't seem to
> come close to this.  I've tried just about every permutation of list,
> string-expand, string-append I can think of :(
>
> Thanks.
> --
> Brian <[hidden email]>
>
> _______________________________________________
> gnucash-devel mailing list
> [hidden email]
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>



--
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [hidden email]                        PGP key available

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: #!%&*#@ scheme! ... help!

Brian-5
On Sun, 2005-27-11 at 11:36 -0500, Derek Atkins wrote:
> guile> (string-append "foo" "bar" "baz")
> "foobarbaz"
>
> You don't want the (list ...) stuff in there.
>
> -derek
>
thanks, but :(

     (string-append (N_ "Make all cheques payable to: ") (gnc:*business-label* gnc:*company-name*)
      (N_ "\nDirect all inquiries to: ") (gnc:*business-label* gnc:*company-contact*))))


Backtrace:
In unknown file:
   ?:  0* [#<procedure #f (window)> #<gw:wcp <gnc:MainWindow*> 0x8409990>]
In /opt/gnucash2/share/guile-modules/gnucash/report/report-gnome.scm:
  78:  1* (let ((report #)) (gnc:main-window-open-report report window))
  78:  2* [gnc:make-report "Fancy Invoice"]
In /opt/gnucash2/share/scm/report.scm:
 237:  3  (let (# # #) (gnc:report-set-id! r id) ...)
 250:  4* (let ((options (if # # ...))) (gnc:report-set-options! r options) ...)
 251:  5* (if (not (null? rest)) (car rest) ...)
 253:  6  [gnc:report-template-new-options #]
    ...
 169:  7  (let ((options (generator))) (gnc:register-option options stylesheet) ...)
 169:  8* [options-generator]
In unknown file:
   ?:  9  (letrec (# #) (gnc:register-inv-option #) (gnc:register-inv-option #) ...)
In /opt/gnucash2/share/guile-modules/gnucash/report/fancy-invoice.scm:
 333: 10* [gnc:register-inv-option ...
 334: 11*  [gnc:make-text-option "Display" "Extra Notes" ... ...
 339: 12*   [string-append "Make all cheques payable to: " ...
 339: 13*    ["Business" "Company Name"]

/opt/gnucash2/share/guile-modules/gnucash/report/fancy-invoice.scm:339:58: In expression (gnc:*business-label* gnc:*company-name*):
/opt/gnucash2/share/guile-modules/gnucash/report/fancy-invoice.scm:339:58: Wrong type to apply: "Business"
brian@big_squirt ~/gnucash-svn/trunk $


--
Brian <[hidden email]>

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: #!%&*#@ scheme! ... help!

Derek Atkins
Well, gnc:*business-label* isn't a procedure, so of course that's not
going to work.  I'd tell you "just remove the parens" but that wont do
what you expect, either.  It wont crash, but it wont give you the output
you want.  You need (gnc:<whatever-function-gets-the-value> <label> <item>)
to grab the option info.

-derek

Quoting Brian <[hidden email]>:

> On Sun, 2005-27-11 at 11:36 -0500, Derek Atkins wrote:
>> guile> (string-append "foo" "bar" "baz")
>> "foobarbaz"
>>
>> You don't want the (list ...) stuff in there.
>>
>> -derek
>>
> thanks, but :(
>
>     (string-append (N_ "Make all cheques payable to: ")
> (gnc:*business-label* gnc:*company-name*)
>      (N_ "\nDirect all inquiries to: ") (gnc:*business-label*
> gnc:*company-contact*))))
>
>
> Backtrace:
> In unknown file:
>   ?:  0* [#<procedure #f (window)> #<gw:wcp <gnc:MainWindow*> 0x8409990>]
> In /opt/gnucash2/share/guile-modules/gnucash/report/report-gnome.scm:
>  78:  1* (let ((report #)) (gnc:main-window-open-report report window))
>  78:  2* [gnc:make-report "Fancy Invoice"]
> In /opt/gnucash2/share/scm/report.scm:
> 237:  3  (let (# # #) (gnc:report-set-id! r id) ...)
> 250:  4* (let ((options (if # # ...))) (gnc:report-set-options! r
> options) ...)
> 251:  5* (if (not (null? rest)) (car rest) ...)
> 253:  6  [gnc:report-template-new-options #]
>    ...
> 169:  7  (let ((options (generator))) (gnc:register-option options
> stylesheet) ...)
> 169:  8* [options-generator]
> In unknown file:
>   ?:  9  (letrec (# #) (gnc:register-inv-option #)
> (gnc:register-inv-option #) ...)
> In /opt/gnucash2/share/guile-modules/gnucash/report/fancy-invoice.scm:
> 333: 10* [gnc:register-inv-option ...
> 334: 11*  [gnc:make-text-option "Display" "Extra Notes" ... ...
> 339: 12*   [string-append "Make all cheques payable to: " ...
> 339: 13*    ["Business" "Company Name"]
>
> /opt/gnucash2/share/guile-modules/gnucash/report/fancy-invoice.scm:339:58:
> In expression (gnc:*business-label* gnc:*company-name*):
> /opt/gnucash2/share/guile-modules/gnucash/report/fancy-invoice.scm:339:58:
> Wrong type to apply: "Business"
> brian@big_squirt ~/gnucash-svn/trunk $
>
>
> --
> Brian <[hidden email]>
>
>



--
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [hidden email]                        PGP key available

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel