Jade 7

Instructions

  1. In the Class Browser, select the AddBookForm.
  2. In the properties window, select buttonOK.
  3. In the methods window, select click. A method skeleton for the buttonOK_click method is displayed.
  4. Select the code on the right by clicking and dragging.
  5. Copy it to the clipboard.
  6. Paste the code into the skeleton method.
  7. Select the Methods | Compile Method menu command. The status line displays a message
    «Compilation complete - no errors»
  8. Run your application and add a new book.
  9. Return to the Class Browser to check that the book is in the database.
  10. Select the Book class.
  11. Select the Classes | Inspect Instances menu command.
    A database inspector window is displayed.
  12. Click the last Book object to view its details.
  13. Close the inspector windows by selecting the File | Close All menu command.
buttonOK_click(btn: Button input) updating;

vars
    bk : Book;            // bk is a variable of type Book

begin
    beginTransaction;     // required for database changes
    // create a Book object and set its properties
    create bk;
    bk.title := textBoxTitle.text;
    bk.isbn := textBoxIsbn.text;
    bk.author := textBoxAuthor.text;
    commitTransaction;     // update and release locks

    // clear text boxes and display message on status line
    textBoxTitle.text := null;
    textBoxIsbn.text := null;
    textBoxAuthor.text := null;
    statusLine.caption := 'Book "' & bk.title & '" added';
end;

Troubleshooting

If your code did not compile and the following error message is displayed on the status line, click the error message to find out what to do.

Error 6027 - Unknown identifier


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Contents
 

For maximum reliability, security and performance of your JADE solution, JADE Care24 is our fully comprehensive systems management offering.