Subscribe for automatic updates: RSS icon RSS

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

Pages: 1 ... 6 7 [8] 9 10
 71 
 on: October 06, 2024, 10:40:35 pm 
Started by Benjamin G. - Last post by Reuben B.
Hi,

the second example should be included in the documentation

Regards

... I did write an article on that about six/seven months ago after we had a couple of support calls all falling into the same trap https://4js.com/ask-reuben/ig-217/

 72 
 on: October 06, 2024, 10:54:22 am 
Started by Snorri B. - Last post by Sebastien F.
Hi Evandro,

First, you should be using 3.21 not 3.20 because last one is no longer supported.
You should even consider moving to version 5.00.

You need to properly understand the concept to function references in Genero.

The solution we provide is not based on function names as strings, and is not designed to handle a variable set of parameters or return values.

We use a different approach with static function signatures, to have a better control at compile time and at runtime.

Using C extensions with full-dynamic names, variable parameters and return values looks flexible but is subject of mistakes.

I would be interested to know how many functions you need to call dynamically, and the overall context for this need.

We can offer you help through our Professional Services team, please contact us directly.

Seb

 73 
 on: October 05, 2024, 08:39:00 pm 
Started by Snorri B. - Last post by Evandro S.
Hi Seb

I am using 3.20 version.

In the references you have sent, i cant see how can i call a function using a string for its name.

I am needing something like this:

Let str = "myfunc('aaa',999)" #func name and parameters dynamic
Call str

And if the func has return values, i need to get it in any way (maybe in an array os returned values)

 74 
 on: October 05, 2024, 05:04:15 am 
Started by Snorri B. - Last post by Sebastien F.
Hello Evandro,

It's a while since this topic has been discussed here.

What version of Genero BDL are you using?

Instead of C Extensions, you should consider new features added in recent versions of Genero BDL such as:

- https://4js.com/online_documentation/fjs-fgl-manual-html/index.html#fgl-topics/c_fgl_Functions_references.html

- https://4js.com/online_documentation/fjs-fgl-manual-html/index.html#fgl-topics/c_fgl_Interface_intro.html

Seb

 75 
 on: October 04, 2024, 09:44:24 pm 
Started by Snorri B. - Last post by Evandro S.
Hey Andrew,

Thanks for sharing your dynamic function call, it help me a lot!

I have just one doubt for now:
     if i want to pass dynamic parameters, how could i do it?

 76 
 on: October 04, 2024, 09:48:00 am 
Started by Benjamin G. - Last post by Benjamin G.
Hi,

the second example should be included in the documentation

Regards

 77 
 on: October 04, 2024, 09:34:06 am 
Started by Benjamin G. - Last post by Sebastien F.
Hello,

1/

After a discussion with the team we will document ATTRIBUTE and ATTRIBUTES as synonyms.

2/

Sometimes the ATTRIBUTE/ATTRIBUTES clause can be used at the array element level:

See this:
Code
  1. sf@toro:/tmp$ cat x.4gl
  2. IMPORT util
  3.  
  4. TYPE t_rec RECORD
  5.         field INTEGER
  6.     END RECORD
  7.  
  8. DEFINE root_rec RECORD ATTRIBUTES(json_name="database")
  9.        arr1 DYNAMIC ARRAY ATTRIBUTES(json_name="_arr1_") OF t_rec ATTRIBUTES(json_null="null")
  10.       ,arr2 DYNAMIC ARRAY ATTRIBUTES(json_name="_arr2_") OF t_rec
  11.    END RECORD
  12.  
  13. MAIN
  14.  
  15.    LET root_rec.arr1[1].field = 101
  16.    --LET root_rec.arr1[2].field = 102
  17.    LET root_rec.arr1[3].field = 103
  18.  
  19.    LET root_rec.arr2[1].field = 201
  20.    --LET root_rec.arr2[2].field = 202
  21.    LET root_rec.arr2[3].field = 203
  22.  
  23.    DISPLAY util.JSON.format( util.JSON.stringify(root_rec) )
  24.  
  25. END MAIN
  26. sf@toro:/tmp$ fglcomp -M x.4gl && fglrun x.42m
  27. {
  28.     "_arr1_": [
  29.         {
  30.             "field": 101
  31.         },
  32.        null,
  33.        {
  34.             "field": 103
  35.         }
  36.    ],
  37.    "_arr2_": [
  38.        {
  39.             "field": 201
  40.         },
  41.        {},
  42.        {
  43.             "field": 203
  44.         }
  45.    ]
  46. }
  47.  

 78 
 on: October 03, 2024, 03:11:29 pm 
Started by Benjamin G. - Last post by Benjamin G.
Hi,

for the point "2" i think that compiler must be at least "warn" the user because the syntax will not produce the good result ...

Regards

 79 
 on: October 03, 2024, 02:58:59 pm 
Started by Benjamin G. - Last post by Sebastien F.
Hello Benjamin,

1/

The fglcomp compiler considers ATTRIBUTE and ATTRIBUTES as synonyms (I would say for backward compatibility)

We have only documented the second keyword, because you can specify multiple attributeS in this clause.

If some consider that we should document both keywords, the syntax diagram would look like this:

Code:
ATTRIBUTE[S] ( attribute [ = "value" ] [,...] )

or

Code:
{ATTRIBUTE|ATTRIBUTES} ( attribute [ = "value" ] [,...] )

instead of current simple diagram:

Code:
ATTRIBUTES ( attribute [ = "value" ] [,...] )

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_variables_attributes.html

If we document both, programmers will tend to use sometimes ATTRIBUTE and sometime ATTRIBUTES, with the risk to miss one or the other when searching in your code ( vim ctrl-* )

Return to simplicity.

2/

In JSON, array elements have no name.

Try to put the ATTRIBUTES() clause just after DYNAMIC ARRAY:

Code
  1. DEFINE jdb RECORD ATTRIBUTES(json_name="database")
  2.    rec_tlsbonret DYNAMIC ARRAY ATTRIBUTES(json_name="tlsbonret_2") OF t_tlsbonret
  3.   ,rec_tlsclidis DYNAMIC ARRAY ATTRIBUTES(json_name="tlsclidis_2") OF t_tlsclidis
  4.    END RECORD
  5.  

output (with my own t_tlsbonret and t_tlsclidis types):

Code:
{
    "tlsbonret_2": [
        {
            "field11": 9991
        }
    ],
    "tlsclidis_2": [
        {
            "field21": 9992
        }
    ]
}

Seb

 80 
 on: October 03, 2024, 11:43:21 am 
Started by Christine R. - Last post by Christine R.

 Genero Enterprise 5.00 Maintenance Release :
Genero Desktop Client 5.00.04


Four Js is pleased to announce a Maintenance Release of Genero Desktop Client 5.00.04.

What's new ...
This release introduced a specific package to support natively Apple Silicon (ARM) on macOS.
The Operating System code for this package is m64a1200.

Keep also in mind that Four Js now maintains the latest release of GDC only; it will be compatible with all supported versions of the Genero DVM.
Please refer to https://4js.com/online_documentation/fjs-gdc-manual-html/#genero-install-topics/c_gdc_install.html#c_gdc_compat_500 for more information.

This version also includes the following fixes https://4js.com/support/issue/GDC/5.00.04.

It is now downloadable from the website: https://4js.com/download/products/.

All Four Js Genero customers under maintenance have free access to the new release.

Best regards,

Four Js Development Tools

Pages: 1 ... 6 7 [8] 9 10
Powered by SMF 1.1.21 | SMF © 2015, Simple Machines