Re: How do I get the type of a Collection element? (v16r6)

2018-04-26 Thread Julio Carneiro via 4D_Tech
The problem comes up when you’re working with Entity selections, where your time fields are converted to longints. Then Type or Value type of an Entity instance value does not match the field type. There’s a problem with Arrays in a Collection. Type returns 0, longint, because 4D Array variable

Re: How do I get the type of a Collection element? (v16r6)

2018-04-26 Thread Kirk Brooks via 4D_Tech
Julio, Yeah, date and time are a 4D thing really. I never store time values as 'time' anyway - always string. Frequently the same for dates. On Thu, Apr 26, 2018 at 11:47 AM Julio Carneiro via 4D_Tech < 4d_tech@lists.4d.com> wrote: > You do have Value type, but neither work 100%. Both fail Time

Re: How do I get the type of a Collection element? (v16r6)

2018-04-26 Thread Kirk Brooks via 4D_Tech
Thanks John On Thu, Apr 26, 2018 at 8:42 AM John DeSoi via 4D_Tech <4d_tech@lists.4d.com> wrote: > New command, Value type: > > $type:=Value type($col[0]) > > And note if you use the new For each loop in version 17, all collection > elements must have the same type. > > John DeSoi, Ph.D. > > > >

Re: How do I get the type of a Collection element? (v16r6)

2018-04-26 Thread John DeSoi via 4D_Tech
New command, Value type: $type:=Value type($col[0]) And note if you use the new For each loop in version 17, all collection elements must have the same type. John DeSoi, Ph.D. > On Apr 26, 2018, at 10:36 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > If I'm iterating

How do I get the type of a Collection element? (v16r6)

2018-04-26 Thread Kirk Brooks via 4D_Tech
If I'm iterating through a collection how can I get the type of an element? Here are some results from current attempts: $col:=New collection(New object;123;"XYZ";New collection) $type:=Type($col) // type = 42 $type:=Type($col[0]) // err: 4D was expecting a field or variable or parameter