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: PICTURE format not supporting alpha-numeric  (Read 11171 times)
Jos? V.
Posts: 55


« on: July 19, 2019, 10:07:00 am »

Hello,
I'm trying to define a form field with PICTURE attribute set to alphanumeric chars such as:
Code:
edit  e7 = profor.prfmat , upshift, picture = "AA-AA-AAAA";

But when I try to edit the field I can only insert alpha chars, so digits are not allowed.

Is this a version bug or am I reading the manual wrong?

My version or fglrun is 3.00.04 rev-3be6b8d and GDC is 3.00.04 build-5372.

I also tested with fgl 3.10.14 rev-912632b and GDC 3.10.11 build-158046 and got the same result.


Bernard M.
Four Js
Posts: 45


« Reply #1 on: July 19, 2019, 10:36:57 am »

Hello,

It seems "A" and "X" have been swapped in the documentation.
Try this instead:
Code:
edit  e7 = profor.prfmat , upshift, picture = "XX-XX-XXXX";

We will update the documentation accordingly.

Regards,
Bernard
Jos? V.
Posts: 55


« Reply #2 on: July 19, 2019, 10:55:01 am »

I changed from "X" to "A" trying to solve a problem.
So when I read the manual my understanding was:
* X -> Any character(?,/, = etc)
* A -> Only alphanumeric characters.

My problem is X accepts things like linebreaks.
And users are copying cells from excel instead of copying the content of the cell, which then breaks the database because copying the cell carries a linebreak into the field.

The only fields that have this behaviour are field with the PICTURE attribute and TEXTBOX fields.

I was trying and easy fix on the form by using the "A" char on the PICTURE.
Bernard M.
Four Js
Posts: 45


« Reply #3 on: July 19, 2019, 02:41:08 pm »

OK. This is not as simple as it looks.

I don't see any other solution than treat it with 4gl code.
Maybe with ON ACTION dialogtouched to check characters as soon as there is a change in the INPUT field or with AFTER FIELD to test the whole inserted string.

Anyway if you need to treat line breaks this might be even more complicated.

Maybe someone in the forum as already done something like this before.

Regards,
Bernard

Bernard M.
Four Js
Posts: 45


« Reply #4 on: July 19, 2019, 02:50:40 pm »

As an example here a simple test case that might help.

Regards,
Bernard

* test.4gl (0.76 KB - downloaded 807 times.)
* test.per (0.4 KB - downloaded 787 times.)
Jos? V.
Posts: 55


« Reply #5 on: July 19, 2019, 03:29:39 pm »

Luckily we don't use that much of textbox or the PICTURE attribute.
We will patch our code to work around this problem as you suggested.
Thank you for your help!
Sebastien F.
Four Js
Posts: 509


« Reply #6 on: July 19, 2019, 04:17:38 pm »

One should not use ON ACTION dialogtouched to control field values:

This special action is provided to detect immediately user input in DIALOG/END DIALOG, to switch the form state from a visualization/navigation mode ("save" action is disabled) to modification mode ("save" action is enabled).

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

Ideally we could have a new PICTURE placeholder, to allow ONLY letters and digits...

Seb
Leo S.
Four Js
Posts: 126


« Reply #7 on: July 19, 2019, 05:41:57 pm »

Hi Jose, 'A' means any letter. The '(alpha-numeric)' in the doc is simply not correct.
We should update the doc.

Regards, Leo
Jos? V.
Posts: 55


« Reply #8 on: July 22, 2019, 10:44:37 am »


Ideally we could have a new PICTURE placeholder, to allow ONLY letters and digits...


This would be perfect for us.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines