From b2063dfa20c5ce7f75fcee4e5b79b90eb53b28cd Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Mon, 18 Oct 1999 04:02:44 +0000 Subject: [PATCH] file from cbbrowne@hex.net git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1942 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/scm/test.scm | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/scm/test.scm diff --git a/src/scm/test.scm b/src/scm/test.scm new file mode 100644 index 0000000000..af070a7086 --- /dev/null +++ b/src/scm/test.scm @@ -0,0 +1,54 @@ +(define (gnc:create-account AccPtr name description notes type) + (display "start creation")(newline) + + (gnc:account-begin-edit AccPtr 0) + (display "edit")(newline) + + (display (string-append "Name:" name)) (newline) + (gnc:account-set-name AccPtr name) + + (display (string-append "Descr:" description)) (newline) + (gnc:account-set-description AccPtr description) + + (display (string-append "notes:" notes)) (newline) + (gnc:account-set-notes AccPtr notes) + + (display (string-append "Type:" (number->string type))) (newline) + + (gnc:account-set-type AccPtr type) + + (gnc:account-commit-edit AccPtr) + (display "committed")(newline) + ) + +(define (gnc:test-creation) + (let ((group (gnc:get-current-group)) + (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 "group:") (display group) (newline) + (gnc:group-insert-account group (car cash)) + (gnc:group-insert-account group (car inc1)) + (gnc:group-insert-account group (car exp1)) + (gnc:refresh-main-window)) + (display "Tried creation")(newline))