Author Topic: Question about the parameters of database's constructor.  (Read 240 times)

0 Members and 1 Guest are viewing this topic.

guohq

  • Newt
  • Posts: 82
Question about the parameters of database's constructor.
« on: August 10, 2021, 01:57:43 AM »
We have to input  two parameters to construct a database.
The first  parameter(buildDefaultDrawing) means  whether or not to build an empty object ,It's easy to understand.
The second parameter(noDocument) means  specifying whether or not to associate this database to the current document.

What is the differnece between true and false of the second parameter?

MickD

  • Gator
  • Posts: 3494
  • (x-in)->[process]->(y-out)
Re: Question about the parameters of database's constructor.
« Reply #1 on: August 10, 2021, 05:33:50 PM »
The 'Document' is the object shown in the editor screen(tab) and the database is edited and visualised through a Document by the end user on screen. So what the true/false parameter means is that if you want the user to edit the database you attach it to a document, if you just want to create/edit a database (drawing) in memory (with code) then you don't need a document.

hth
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

"First, solve the problem. Then, write the code." John Johnson