[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: USE Command only for Gambas Scripting?


Le 04/09/2024 à 14:49, Claus Dietrich a écrit :
In order to simplify the implementation of my pdf-help-viewer in other apps I added following lines at the top of the form class declarations:

' Gambas class file

Use "gb.poppler"
Class PdfDocument
Class PdfIndex

...

and unmarked the gb.poppler component in the project properties. So far this works fine, but the Gambas Wiki says, that the USE command is for Gambas scripting with gbs3 only: https://gambaswiki.org/wiki/lang/use

Is there a mistake in the Wiki?

Best regards

Claus



Yes.

`Use "gb.poppler"` at the top of your class is equivalent to have `Component.Load("gb.poppler")` in the class static initializer.

In other words, it loads the 'gb.poppler' component the first time your class is used.

Note that in the development version, you can now check a component so that it is not loaded at program startup, but you can use its classes without having to declare them with the 'Class' keyword.

Regards,

--
Benoît Minisini.


Follow-Ups:
Re: USE Command only for Gambas Scripting?BB <adamnt42@xxxxxxxxx>
Re: USE Command only for Gambas Scripting?Claus Dietrich <claus.dietrich@xxxxxxxxxx>
References:
USE Command only for Gambas Scripting?Claus Dietrich <claus.dietrich@xxxxxxxxxx>