Subscribe for automatic updates: RSS icon RSS

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

Pages: 1 ... 3 4 [5] 6 7 ... 10
 41 
 on: March 14, 2024, 03:58:23 am 
Started by Candy M. - Last post by shore p.
I figured it out.   I was able to figure out why TITLE and COMMENT where not changing.   We keep a database of all our forms in our application and I needed to reload the forms.

Candy

Can you explain it to me again? I'm having this problem but I don't know how to solve it?

 42 
 on: March 14, 2024, 03:31:57 am 
Started by Dave T. - Last post by Victor G.
Hi all,

Does anyone have any tricks to allow a folder to be opened (that contains spaces) with the os.Path.dirOpen method on a Windows client ?

Cheers

Dave

To open a folder with spaces using the os.Path.dirOpen function on a Windows client, wrap the folder path in double quotes. This ensures that the entire path is handled as a single item, with the spaces not construed as separators.
phrazle
For instance, if the folder location is "C:\Program Files", you can open it with the following code:

import os

folder_path = 'C:\\Program Files'
os.startfile('"{}"'.format(folder_path))

This will open the folder without any problems due to gaps in the path.
I will try, thanks.

 43 
 on: March 14, 2024, 03:27:58 am 
Started by Francois G. - Last post by Victor G.
I'll add some comments that skirt around the issue but might trigger something ...

1.
Quote
In the 4GL, I have used an ON IDLE action with a timeout of 3 seconds, but the Genero BDL manual says that I should not do this (the manual says that ON IDLE is intended for larger values such as 10 seconds).
Don't get too spooked about the warning, understand why the warning is there.  ON IDLE 3 can be thought of as the equivalent of a user pressing TAB or ENTER every 3 seconds.  That is every 3 seconds sending an action from the front-end to back-end, some processing (if any) occurring on the back end, and the update to the AUi Tree (if any) being returned.  If one process has an ON IDLE 3, chances are the impact on the system will barely be noticed, if all processes have an ON IDLE 3, these extra messages and processing will add up.  So that is what you have to watch out for. 
basketball stars
2. I did an Ask-Reuben on Genero being single threaded https://4js.com/ask-reuben/ig-127/ which may have some points relevant to this discussion.  If your program has some user input, how do you expect it to respond when the user is busy doing something.  So if you are looking for a callback function to be triggered, if your user is busy typing something, would you want that callback function triggered then?, hence the path of polling after an ON IDLE.  If your program is non-interactive then you are probably looking for a solution like on the server side with Web Services where your register the function to occur and then a method like com.WebServiceEngine.processServices blocks and then calls the appropriate function when something is received.

3. As I speculate in the article, for mobile we had a predefined action, ON ACTION notificationpushed that the Mobile host triggers when a notification is received for that which you have registered for Push Notifications.   http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_mobile_push_notifications.html  Conceivably gdc.exe or gbc.js or a web component could take on the role of the mobile O/S and register for and receive notifications and trigger the predefined action.

4. One final point, RabbitMQ (https://www.rabbitmq.com/devtools.html) , the AMPQ protocol (https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol) , etc these terms don't appear a lot in our support portal.  If there are developers out there that want to interact this way, are looking for a client library to use let your support contact know so that we can gauge the correct amount of interest.

Reuben

 
Thank for your sharing.

 44 
 on: March 14, 2024, 03:23:50 am 
Started by . - Last post by Victor G.
Jeff,

I presume you expect the style to be applyed "live", i.e. when the user enters data in the field, the color changes, right ?

This may raise an performance issue: currently, styles are applyed:
  • on creation
  • on focus in / focus out
  • when changing state (active, dialogType...)

With this, we would need to recompute and reapply styles on the current field on each keystroke, which may slow the program.

To be tested !.

Is there any other pseudo selector you would like to see in further versions ?

We've already registred some requests about table (last row, header), we're also thinking about platform pseudo selector (osx, win, lnx...)...
coreball
Pierre-Nicolas
Hi Pierre-Nicolas.

I wouldn't expect this to react during the edit of the field, 'after field' would be good enough for most people I would imagine. As we set a general ':focus' colour anyway I would expect the field to have taken on that colour whilst the user is editing the field.

As for other selectors, I think my needs are fairly well met at the moment although last row sounds like a good idea.

Thanks

Jeff
'After field' is an adequate description of this concept, thus it's worth thinking about. Because I also changed the default ':focus' color, I thought the field would inherit that hue.

 45 
 on: March 14, 2024, 03:13:17 am 
Started by Dmitry K. - Last post by Victor G.
Hi,
we want to store and edit data as TEXT-type with fglrichtext web component. There are texts and images to store.
It's working fine. But when adding other images or texts to the existing the first images are getting deleted and
there are only the last added images stored. Is this to be expected?
How can we solve the problem?

Genero Studio Version: 3.10.11

Thanks
Dmitry
I reported it to the support center but it still hasn't been resolved.

 46 
 on: March 13, 2024, 11:42:39 am 
Started by Francois G. - Last post by Francois G.
Thanks all.

My current challenge is how to parse / handle compound emojis such as "Woman Facepalming: Dark Skin Tone" (part of a family of UTF-8 characters called "Emoji ZWJ Sequence"):
🤦🏿‍♀️

One emoji, displayed over a visual length of  2 (takes 2 "spaces") is actually a sequence of :
person facepalming, 4 bytes
colour black, 4 bytes
zero width joiner, 3 bytes
female, 3 bytes
zero width joiner, 3 bytes (that last one I am not sure: I can see this in my debugger, but not in the emoji docs)

so this emoji  requires 17 bytes (unless I got my calculation wrong).

If I "split" at any intermediate element of this sequence, I will corrupt the emoji.




 47 
 on: March 13, 2024, 11:33:00 am 
Started by Francois G. - Last post by Leo S.
With the help of Rene a program which is displayed correctly here: util.JSON.parse helps to import non ascii symbols printable in this forum
Code
  1. IMPORT util
  2. MAIN
  3.  DEFINE s, s2,smil1,smil2,pound STRING
  4.  IF fgl_getenv("FGL_LENGTH_SEMANTICS") == "CHAR" THEN
  5.    DISPLAY "must not have CHAR length semantics to count bytes"
  6.    RETURN
  7.  END IF
  8.  --smileys need 2 unicode code points (beyond Unicode basic plane)                    
  9.  CALL util.JSON.parse('"\\uD83D\\uDE01"',smil1)
  10.  DISPLAY "smil1:",smil1
  11.  CALL util.JSON.parse('"\\uD83D\\uDE02"',smil2)
  12.  DISPLAY "smil2:",smil2
  13.  CALL util.JSON.parse('"\\u00a3"',pound)
  14.  DISPLAY "pound:",pound
  15.  LET s = smil1,smil2,"ab",pound,"c",smil1
  16.  LET s2 = cutAtByteLength(s, 14) --last smil1 is cut because the byte boundary is inbetween
  17.  DISPLAY SFMT("s:%1 slen:%2 s2:%3 s2len:%4", s, length(s), s2, length(s2))
  18.  LET s = smil1,smil2,"x"
  19.  LET s2 = cutAtByteLength(s, 8)
  20.  DISPLAY SFMT("s:%1 slen:%2 s2:%3 s2len:%4", s, length(s), s2, length(s2))
  21. END MAIN
  22.  
  23. FUNCTION cutAtByteLength(s STRING, maxByteLength INT) RETURNS STRING
  24.  VAR l = s.getLength() --byte length whole string
  25.  DISPLAY sfmt("source:'%1' has length:%2",s,l)
  26.  VAR i = 1
  27.  WHILE i <= l
  28.    VAR c = s.getCharAt(i)
  29.    VAR clen = c.getLength() --byte length one char
  30.    LET i += clen
  31.    DISPLAY SFMT("i:%1,c:%2,len:%3", i, c, c.getLength())
  32.    IF i - 1 > maxByteLength THEN
  33.      RETURN s.subString(1, i - 1 - clen)
  34.    END IF
  35.  END WHILE
  36.  RETURN s
  37. END FUNCTION
  38.  

 48 
 on: March 13, 2024, 10:34:02 am 
Started by Francois G. - Last post by Leo S.
Hi Francoise, to cut at a byte boundary of x you even *must* use FGL_LENGTH_SEMANTICS=BYTE because getLength of the String returns the number of bytes.
So Rene did demonstrate how easy it is to iterate thru because as long as you increase the index passed to getCharAt properly with the next character byte length you always get the correct character.
If the index goes beyond your byte boundary , just go one position back and do a subString.

HTH , Leo
Code
  1. MAIN
  2.  DEFINE s, s2 STRING
  3.  IF fgl_getenv("FGL_LENGTH_SEMANTICS") == "CHAR" THEN
  4.    DISPLAY "must not have CHAR length semantics to count bytes"
  5.    RETURN
  6.  END IF
  7.  LET s = "&#128577;&#128578;ab£c&#128577;"
  8.  LET s2 = cutAtByteLength(s, 14)
  9.  DISPLAY SFMT("s:%1 slen:%2 s2:%3 s2len:%4", s, length(s), s2, length(s2))
  10.  LET s = "&#128577;&#128578;x"
  11.  LET s2 = cutAtByteLength(s, 8)
  12.  DISPLAY SFMT("s:%1 slen:%2 s2:%3 s2len:%4", s, length(s), s2, length(s2))
  13. END MAIN
  14.  
  15. FUNCTION cutAtByteLength(s STRING, maxByteLength INT) RETURNS STRING
  16.  VAR l = s.getLength() --byte length whole string
  17.  DISPLAY "source has length:", l
  18.  VAR i = 1
  19.  WHILE i <= l
  20.    VAR c = s.getCharAt(i)
  21.    VAR clen = c.getLength() --byte length one char
  22.    LET i += clen
  23.    DISPLAY SFMT("i:%1,c:%2,len:%3", i, c, c.getLength())
  24.    IF i - 1 > maxByteLength THEN
  25.      RETURN s.subString(1, i - 1 - clen)
  26.    END IF
  27.  END WHILE
  28.  RETURN s
  29. END FUNCTION
  30.  

 49 
 on: March 13, 2024, 09:06:16 am 
Started by Francois G. - Last post by Rene S.
The program above produces:
Code
  1. $ FGL_LENGTH_SEMANTICS=BYTE fgl ll1
  2. s:ab€c d l:8 w:6 number_of_logical_chars:6
  3. s:123456 l:6 w:6 number_of_logical_chars:6
  4. $ FGL_LENGTH_SEMANTICS=CHAR fgl ll1
  5. s:ab€c d l:6 w:6 number_of_logical_chars:6
  6. s:123456 l:6 w:6 number_of_logical_chars:6
  7.  

The number of logical chars does not depend on FGL_LENGTH_SEMANTICS

 50 
 on: March 13, 2024, 09:03:03 am 
Started by Francois G. - Last post by Rene S.
Try this:

Code
  1. MAIN
  2.    DEFINE s STRING
  3.    LET s = 'ab€c d'
  4.    DISPLAY SFMT("s:%1 l:%2 w:%3 number_of_logical_chars:%3",
  5.        s, length(s), fgl_width(s), number_of_logical_chars(s))
  6.    LET s = '123456'
  7.    DISPLAY SFMT("s:%1 l:%2 w:%3 number_of_logical_chars:%3",
  8.        s, length(s), fgl_width(s), number_of_logical_chars(s))
  9. END MAIN
  10.  
  11. FUNCTION number_of_logical_chars(s STRING) RETURNS INT
  12.    DEFINE i, l, n INT
  13.  
  14.    LET l = s.getLength()
  15.    LET i = 1
  16.    LET n = 0
  17.    WHILE i <= l
  18.        VAR c = s.getCharAt(i)
  19.        LET i += c.getLength()
  20.        LET n += 1
  21.    END WHILE
  22.    RETURN n
  23. END FUNCTION
  24.  

BTW: if the string not contains double-width East Asian characters, fgl_width will do the job.

Pages: 1 ... 3 4 [5] 6 7 ... 10
Powered by SMF 1.1.21 | SMF © 2015, Simple Machines