Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: fglrun not loading modules with unused functions  (Read 4334 times)
Jos? V.
Posts: 55

« on: May 15, 2020, 04:58:25 pm »

Hello to all,

While running fglrun some modules that have only functions that are not called on 4GL modules are not being loaded.
This would be fine because there shouldn't be a reason to load a module if none of the functions in it are being used.

Except in this case all the functions are being used by fgl_call from a C extension.
This means that when I call the function from C using fgl_call the program gives the following error:

The function 'mytestfunc' has not been defined in any module in the program.

For now I inserted a dummy function on the module that I call from the main module just to force fglrun to load that module and make all functions available to fgl_call.

Is there any workaround or flag that I can use to force this? Cause my solution is not very elegant...

I tested the example for fgl_call on the manual and added a new 4gl module with only one function being called from the C ext.
The example program is attached to this thread.

Thank you in advance,
Josť Virtuoso

* (4.03 KB - downloaded 446 times.)
Rene S.
Four Js
Posts: 109

« Reply #1 on: May 18, 2020, 08:23:07 am »

Hello Josť,
yes, this solution is not very elegant...
There is no better solution, unfortunately (except using the linker).

The macro fgl_call calls a 4GL function by name. The name is resolved at runtime. The function name can not be qualified by a module-name.

The way of calling  4GL function from C can be compared with way of calling a combobox initialiser. See fglform: the INITIALIZER attribute of COMBOBOX.
Until 3.20.10: the name of the initializer function could not be qualified by a module-name.
Since 3.20.10: FGL-2331: fglform: ComboBox.initializer: Supports function names that are qualified by a module name.

An similar enhancement would fix your issue...
Feature request: the macro  fgl_call should support function names qualified by a module name.

Pages: [1]
  Reply  |  Print  
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines