Today is "go nuts adding tests to QIF" day. Regression Tests out the
wazoo. Or at least some that check *some* useful cases... That will
make fiddling with data structures Rather Safer.
But...
It finally came time to say "Enough."
I want to add some accounts, by hook or by crook.
And so came the following:
(define (gnc:create-account AccPtr name description notes type)
(display "start creation")(newline)
(gnc:xaccAccountBeginEdit AccPtr 0)
(display "edit")(newline)
(display (string-append "Name:" name)) (newline)
(gnc:xaccAccountSetName AccPtr name)
(display (string-append "Descr:" description)) (newline)
(gnc:xaccAccountSetDescription AccPtr description)
(display (string-append "notes:" notes)) (newline)
(gnc:xaccAccountSetNotes AccPtr notes)
(display (string-append "Type:" (number->string type))) (newline)
(gnc:xaccAccountSetType AccPtr type)
(gnc:xaccAccountCommitEdit AccPtr)
(display "committed")(newline)
)
(let ((cash
(list (gnc:malloc-account)
"Sample Cash"
"Sample Cash Description"
"No notes - this is just a sample"
1))
(inc1
(list (gnc:malloc-account)
"Misc Income"
"Miscellaneous Income"
"Just a dumb income account"
8))
(exp1
(list (gnc:malloc-account)
"Misc Exp"
"Miscellaneous Expenses"
"Just a dumb expense account"
9)))
(display "Samples: ") (newline)
(display (list cash inc1 exp1)) (newline)
(apply gnc:create-account cash)
(apply gnc:create-account inc1)
(apply gnc:create-account exp1))
(display "Tried creation")(newline)
This doesn't appear to contain more than the single function I defined
up top.
And it doesn't work.
Do I need to somehow turn those strings into "read only" strings to go
along with the "const-string" type?
Or is something else wrong?
--
Windows '95 - A 32 bit patch for a 16 bit interface to an 8 bit OS
designed for a 4 bit chip.
[EMAIL PROTECTED] <http://www.ntlug.org/~cbbrowne/lsf.html>
----- %< -------------------------------------------- >% ------
The GnuCash / X-Accountant Mailing List
To unsubscribe, send mail to [EMAIL PROTECTED] and
put "unsubscribe gnucash-devel [EMAIL PROTECTED]" in the body