RE: OBJECT get variable type
Hi >@Piotr: can you report this in the 4D forum as feature request? So I can vote Object filters don't do the same thing because placeholders cause the problems Koen already outlined. Here is the link to the feature request for alpha variable length limit (I also asked for similar alpha/text array listbox column entry property):- http://forums.4d.com/Post/EN/19424825/1/20684007#20684007 Best regards Keith White Synergist Express Ltd, UK. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: OBJECT get variable type
maybe - ON BEFORE KEYSTROKE test the current entered length vs expected/desired maximum (255, 4000 etc) On Mon, 11 Sep 2017 20:30:21 +1000, David Adams via 4D_Tech wrote: >> Tested with v16R4. Unfortunately this does not work nicely. > > No idea who thought this one up, but it wasn't me. I've seen and heard > plenty of 4D developers who keep a table with fields of various lengths. In > your case, an alpha 255 and a text field. Then, you use that field on your > form and 4D automatically controls the maximum length for you with zero > coding. For that matter, you could test what the object is, find it's a > field, get it's type and length. I think. > > The idea is not that you save the field data - the table ends up with zero > records. It's just using a field as a temporary container instead of using > a variable as a temporary container. > > Maybe that's enough for you if all you're needing to distinguish is 255 and > text? It obviously does not automatically trim your text fields at 4,000 > characters. > > What would be very nice indeed is if 4D could add a custom dictionary to > every object (Cannon Smith put in an excellent feature request about > this...it was popular) and for every structure object, like a field (Jeff > Kain applied Cannon's idea to structure objects and started another popular > feature request.) > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** --- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: OBJECT get variable type
> Tested with v16R4. Unfortunately this does not work nicely. No idea who thought this one up, but it wasn't me. I've seen and heard plenty of 4D developers who keep a table with fields of various lengths. In your case, an alpha 255 and a text field. Then, you use that field on your form and 4D automatically controls the maximum length for you with zero coding. For that matter, you could test what the object is, find it's a field, get it's type and length. I think. The idea is not that you save the field data - the table ends up with zero records. It's just using a field as a temporary container instead of using a variable as a temporary container. Maybe that's enough for you if all you're needing to distinguish is 255 and text? It obviously does not automatically trim your text fields at 4,000 characters. What would be very nice indeed is if 4D could add a custom dictionary to every object (Cannon Smith put in an excellent feature request about this...it was popular) and for every structure object, like a field (Jeff Kain applied Cannon's idea to structure objects and started another popular feature request.) ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: OBJECT get variable type
thank you for sharing. to be honest, I have never used the "filter" feature since it is not compatible with Japanese by design (we don't use a keyboard with 10,000 keys, so before/after keystroke doesn't make sense). I was hopeful it might work with filtering ASCII by length, well, apparently not. > 2017/09/11 18:54、Koen Van Hooreweghe via 4D_Tech <4d_tech@lists.4d.com> のメール: > Tested with v16R4. Unfortunately this does not work nicely. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: OBJECT get variable type
Hi Keisuke, Tested with v16R4. Unfortunately this does not work nicely. The entry is indeed limited to the number of chars given. But… 1. when continuously typing, the cursor wraps around from the last char to the first and the already entered text is overwritten 2. you cannot select more than 1 character A new property for a string or text object limiting the number of entered characters (like on an alpha field) would indeed be nice to have. Just like numeric variable objects where you can enter a minimum and maximum value. @Piotr: can you report this in the 4D forum as feature request? So I can vote. Kind regards, Koen > Op 11 sep. 2017, om 11:25 heeft Keisuke Miyako via 4D_Tech > <4d_tech@lists.4d.com> het volgende geschreven: > > OBJECT SET FILTER(*;"__object_name_here";"! &@"+("#"*$maxlen)) Compass bvba Koen Van Hooreweghe Kloosterstraat 65 9910 Knesselare Belgium tel +32 495 511.653 ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: OBJECT get variable type
you can set a (rather simplistic) length limit to a variable by code. OBJECT SET FILTER(*;"__object_name_here";"! &@"+("#"*$maxlen)) http://doc.4d.com/4Dv15/4D/15.4/OBJECT-SET-FILTER.301-3273846.en.html http://doc.4d.com/4Dv15/4D/15.4/Filter-and-format-codes.300-3285353.en.html but I still don't understand how knowing the variable type would help. you would have gotten "text" whether the definition on the Oracle side was 255, 4000. > 2017/09/11 16:13、Piotr Chabot Stadhoudersのメール: > When I know the "subtype", I can then handle typing in the "On before > keystroke" > Off course setting a max length field as property for an object would be the > ideal world. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: OBJECT get variable type
Hi Miyako, Thank you for clarifying this. My reason for asking is this : We are using 4D for OCI to interact with an Oracle database In our tables we have text columns (VARCHAR2) with length 255, text columns with length 4000 and CLOBs I was hoping that I could use the variable type property to determine if I am dealing with a 255 or 4000 variable for example so I can prevent the user from typing more characters than possible for the corresponding column I know I can solve this with object naming for example "my_text_field", "my_string_field" but I was thinking of another way When I know the "subtype", I can then handle typing in the "On before keystroke" Off course setting a max length field as property for an object would be the ideal world. Gr, Piotr > -Oorspronkelijk bericht- > Van: Keisuke Miyako [mailto:keisuke.miy...@4d.com] > Verzonden: zaterdag 9 september 2017 2:18 > Aan: 4D iNug Technical <4d_tech@lists.4d.com> > Onderwerp: Re: OBJECT get variable type > > Hello, > > the variable type property serves two purposes: > > to filter the display in the property list, and to declare the data source > variable type in case no variable name is defined. > > otherwise, you only need to know OBJECT Get type which is constant for the > object, and OBJECT Get pointer which tells you the type of the current bound > variable. > > notice the term "current". > > the bound variable can change at runtime (see OBJECT SET DATA SOURCE), > so the initial "variable type" has no real value in code. > > > 2017/09/09 3:18、Piotr Chabot Stadhouders via 4D_Tech > > <4d_tech@lists.4d.com> のメール: > > > > How can I get the value of this property? > > I can retrieve the type of the attached variable, but how can I get the > "Variable Type" property? > > > ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: OBJECT get variable type
Hello, the variable type property serves two purposes: to filter the display in the property list, and to declare the data source variable type in case no variable name is defined. otherwise, you only need to know OBJECT Get type which is constant for the object, and OBJECT Get pointer which tells you the type of the current bound variable. notice the term "current". the bound variable can change at runtime (see OBJECT SET DATA SOURCE), so the initial "variable type" has no real value in code. > 2017/09/09 3:18、Piotr Chabot Stadhouders via 4D_Tech <4d_tech@lists.4d.com> > のメール: > > How can I get the value of this property? > I can retrieve the type of the attached variable, but how can I get the > "Variable Type" property? ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
OBJECT get variable type
Hi, V16 Maybe this is a stupid question but I just don't see it : When putting a variable on a form and set a variable name to t I attach a variable to the object, for example a C_TEXT variable However, there is also a property "Variable Type", that doesn't necessarily has to be of type text, but can be string from example How can I get the value of this property? I can retrieve the type of the attached variable, but how can I get the "Variable Type" property? Thanks in advance, Piotr ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **