Re: Confused array type in an object

2019-08-09 Thread John DeSoi via 4D_Tech

> OB Get Array($ObjData;$attributeName;$aTextarray) //Where $aTextarray is an 
> Array of type text
> 
> This indeed gets the values from the object..which would be absolutely 
> fine(and a work around might be to get both, as neither error, and then look 
> at whether the values in the object array are null and if they are then its 
> an array of values).
> 
> So my question is this. What is a better way to find out what the type of 
> data in the attribute is? What am I missing in my understanding of the 
> structure of an/this object.

It is the only way to do it in version 16 because all elements for the array 
must have the same type (unlike v17 collections). Once you have the text you 
can use JSON Parse to work out individual elements.

> 
> OB Get type returns 42(matching the attribute type of course!). It feels like 
> the attribute is Shrodingers Cat- existing as a collection of cats and not a 
> collection of cats at the same time. 

Be careful that 4D 16 and 17 use different constants for the same object 
property. 17 will use 42 = Is collection, whereas 16 says 39 = Object array.

John DeSoi, Ph.D.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Confused array type in an object

2019-08-09 Thread Neil Dennis via 4D_Tech

I don’t think 4D can type {additional_information:[Check / Money order]}… It 
can’t be text because it isn’t quoted, it can’t be a text array. A text array 
would be formatted like this ["Check / Money order”] so I’m not surprised that 
4D is returning null.

4D object are not JSON objects, just similar.

Neil


> On Aug 9, 2019, at 1:11 PM, Nigel Greenlee via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi.
> 
> I am looking for a better solution than what i currently have..this has 
> probably been encountered by others.
> 
> I am creating some code on 4D V17 but I can not really use collections or 
> .notation as this is going to get deployed on V16 and will not be upgraded 
> for at least a few months(and i am not sure that would solve this problem 
> anyway).
> 
> I am retrieving an object from a connected source(Magento FYI)... from the 
> object  we get a sub entity object and that sub entity may itself contain a 
> subentity etc etc(we are mapping data to go into our system). I am trying to 
> write something agnostic and generic so i am not expecting to ‘hard wire’ any 
> behaviour for a specific entity into the code that extracts the data.
> 
> So at each ‘entity’ level I get the attribute names and types. where the 
> attribute type is 38 or 42 this is a ‘sub entity’ so we are going to get that 
> object and call back into the same code to go down a level.
> 
> Now on V16 of course i wont get a type 42 but actually a type 42 SHOULD(as i 
> understand it) mean the object (element) contains an object and that object 
> SHOULD be a ‘complex’ object and my understanding is that should be an array 
> of objects(else it would not be a collection)? Have i misunderstood that? 
> 
> So i should be able to write(for a type 42 attribute)..
> 
> OB Get Array($ObjData;$attributeName;$aObjSubObject) //Where $aObjSubObject 
> is an Array Object
> 
> (and mostly that works)….
> 
> 
> However
> 
> I am finding a case where
> Attribute Type =42 
> Attribute Name=“additional_information"
> 
> ...and the object looks like this:-
> 
> {account_status:null,additional_information:[Check / Money 
> order],amount_ordered...
> 
> in that object ‘additional_information’ looks like
> additional_information:[Check / Money order]
> 
> which as any JSON/4D object fool can see(LOL) is an array type object(of text 
> in this case) not a collection of objects. When i retreive it as an array of 
> objects I get the correct number of elements(1) but the value of the 
> element(1) is NULL because its not [{…
> 
> 
> indeed if I write:-
> 
> 
> OB Get Array($ObjData;$attributeName;$aTextarray) //Where $aTextarray is an 
> Array of type text
> 
> This indeed gets the values from the object..which would be absolutely 
> fine(and a work around might be to get both, as neither error, and then look 
> at whether the values in the object array are null and if they are then its 
> an array of values).
> 
> So my question is this. What is a better way to find out what the type of 
> data in the attribute is? What am I missing in my understanding of the 
> structure of an/this object.
> 
> OB Get type returns 42(matching the attribute type of course!). It feels like 
> the attribute is Shrodingers Cat- existing as a collection of cats and not a 
> collection of cats at the same time. 
> 
> 
> Nigel Greenlee
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Confused array type in an object

2019-08-09 Thread Nigel Greenlee via 4D_Tech
Hi.

I am looking for a better solution than what i currently have..this has 
probably been encountered by others.

I am creating some code on 4D V17 but I can not really use collections or 
.notation as this is going to get deployed on V16 and will not be upgraded for 
at least a few months(and i am not sure that would solve this problem anyway).

I am retrieving an object from a connected source(Magento FYI)... from the 
object  we get a sub entity object and that sub entity may itself contain a 
subentity etc etc(we are mapping data to go into our system). I am trying to 
write something agnostic and generic so i am not expecting to ‘hard wire’ any 
behaviour for a specific entity into the code that extracts the data.

So at each ‘entity’ level I get the attribute names and types. where the 
attribute type is 38 or 42 this is a ‘sub entity’ so we are going to get that 
object and call back into the same code to go down a level.

 Now on V16 of course i wont get a type 42 but actually a type 42 SHOULD(as i 
understand it) mean the object (element) contains an object and that object 
SHOULD be a ‘complex’ object and my understanding is that should be an array of 
objects(else it would not be a collection)? Have i misunderstood that? 

So i should be able to write(for a type 42 attribute)..

OB Get Array($ObjData;$attributeName;$aObjSubObject) //Where $aObjSubObject is 
an Array Object

(and mostly that works)….


However

I am finding a case where
Attribute Type =42 
Attribute Name=“additional_information"

...and the object looks like this:-

{account_status:null,additional_information:[Check / Money 
order],amount_ordered...

in that object ‘additional_information’ looks like
additional_information:[Check / Money order]

which as any JSON/4D object fool can see(LOL) is an array type object(of text 
in this case) not a collection of objects. When i retreive it as an array of 
objects I get the correct number of elements(1) but the value of the element(1) 
is NULL because its not [{…


indeed if I write:-


OB Get Array($ObjData;$attributeName;$aTextarray) //Where $aTextarray is an 
Array of type text

This indeed gets the values from the object..which would be absolutely fine(and 
a work around might be to get both, as neither error, and then look at whether 
the values in the object array are null and if they are then its an array of 
values).

So my question is this. What is a better way to find out what the type of data 
in the attribute is? What am I missing in my understanding of the structure of 
an/this object.

OB Get type returns 42(matching the attribute type of course!). It feels like 
the attribute is Shrodingers Cat- existing as a collection of cats and not a 
collection of cats at the same time. 


Nigel Greenlee



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

unicode, blobs, and the web

2019-08-09 Thread webmaster namethatplant.net via 4D_Tech
v12.6  OS 10.6.8

Hello!
I was recently made aware of the fact that, on some web pages, a multiplication 
sign was displaying as what looked like a square root symbol + a lowercase 
accented "o".

The database is running in unicode; the web site is using UTF-8. The pages in 
question are displaying a blob variable that contains about 4000 line items. 
The blob was created using the constant UTF8 text without length.

The only clue I found was a brief note under PROCESS HTML TAGS: "Beginning with 
version 12 of 4D, when you use BLOB type parameters, the command automatically 
considers that the character set used for BLOBs is MacRoman."

I didn't see that important detail mentioned anywhere but in reference to that 
one command, but, since text variables can now hold up to 2 GB, I tried 
substituting a text variable.

Doing that did clear up the multiplication sign issue, but now the data was 
truncated. Only about 3000 line items were displayed.

Would 4000 line items be enough to overflow 2 GB? (Each line item contains only 
around 300 characters.)

I can split the data into two text variables, and that appears to work, but it 
seems like it should be unnecessary.

What are some recommended ways to handle this?

Thank you all in advance -
Janie


Janie Marlow
webmas...@namethatplant.net
Travelers Rest, SC
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Screen arrangement

2019-08-09 Thread Jody Bevan via 4D_Tech
Chip:

The main screen will have a top left coordinate of 0;0. 

Then get the coordinates of each screen.
You can then determine where each screen is.

A horizontal negative value means the screen is to the left of the main screen.
A vertical negative value means the screen is above the main screen. 

Of course above and below are virtual directions based on how the user has set 
up the screens in the OS.

From the Count Screens, and Screen coordinates you can then determine the edges 
of each screen and their logical position.

Jody
ARGUS Productions Inc.

> On Aug 9, 2019, at 10:52 AM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> In a situation where there are 2 or more screens attached to a computer.
> is there any way to determine the screen arrangement? (horizontal, 
> vertical, grid)
> 
> In a 2 or more horizontal
> which screen is main (left, right, other)
> 
> In a 2 or more vertical
> which screen is main (Top, bottom other)
> 
> in a grid (4 or more) with at least 2 vertical and at least 2 
> horizontal)
> which screen in main?
> 
> Thanks
> Chip
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Screen arrangement

2019-08-09 Thread Narinder Chandi via 4D_Tech
Chip,

You may be able to determine this information by combining the output of the 
Count screens and SCREEN COORDINATES commands:
https://doc.4d.com/4Dv17/4D/17.2/Count-screens.301-4387339.en.html
https://doc.4d.com/4Dv17/4D/17.2/SCREEN-COORDINATES.301-4387338.en.html

Regards,
 
Narinder Chandi,
ToolBox Systems Ltd.
-- 

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> on behalf of 4D Tech Mailing List 
<4d_tech@lists.4d.com>
Reply-To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Date: Friday, 9 August 2019 at 17:52
To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Cc: Chip Scheide <4d_o...@pghrepository.org>
Subject: Screen arrangement

In a situation where there are 2 or more screens attached to a computer.
is there any way to determine the screen arrangement? (horizontal, 
vertical, grid)

In a 2 or more horizontal
which screen is main (left, right, other)

In a 2 or more vertical
which screen is main (Top, bottom other)

in a grid (4 or more) with at least 2 vertical and at least 2 
horizontal)
which screen in main?

Thanks
Chip
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Screen arrangement

2019-08-09 Thread Chip Scheide via 4D_Tech
In a situation where there are 2 or more screens attached to a computer.
is there any way to determine the screen arrangement? (horizontal, 
vertical, grid)

In a 2 or more horizontal
which screen is main (left, right, other)

In a 2 or more vertical
which screen is main (Top, bottom other)

in a grid (4 or more) with at least 2 vertical and at least 2 
horizontal)
which screen in main?

Thanks
Chip
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Overlapping Objects in Data Segment #65

2019-08-09 Thread Jeffrey Kain via 4D_Tech
Yes, as far as I know.  But default R5 reindexes your alpha/text fields only.

> On Aug 9, 2019, at 7:13 AM, Spencer Hinsdale  wrote:
> 
> can you drop indexes for the conversion?
> 
> Spencer

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - array listbox column Compiler definition

2019-08-09 Thread Chip Scheide via 4D_Tech
Hi Jeremy,
I do not want to manipulate the original array(s) as this is in a 
component. I am handling the data blindly, additionally, even if I 
use(d) the source array(s) directly - I still have the same problem.

How do I (compiler) declare the column variable? (in the example below 
Listbox_Column1).

Conceptually...
The incoming data can be any type of data displayable in a listbox. 

Practically...
Due to the context, the most likely data types are Text, or numeric 
(Long or real), and the 2 data types are still not compatible from a 
compiler view point.

What I have done as a workaround - until/if - I find a different way of 
handling this, is to declare the column variable as a Text array, and 
then convert - if necessary - from whatever data type the source is.
Not the most efficient, but it is functional.

Chip

On Fri, 9 Aug 2019 11:06:00 +0200, Jeremy Roussak via 4D_Tech wrote:
> Chip,
> 
> Why do you need to use a copy of the data in the component? Why not 
> just use $HostData-> in the call to LISTBOX INSERT COLUMN? 
> 
> Jeremy
> 
>> On 8 Aug 2019, at 20:59, Chip Scheide via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I have a component.
>> In the component, I have a published (shared) method which opens an 
>> array listbox in its own window.
>> 
>> The data to be shown is passed from the host.
>> I place the data from the host into the listbox using the following 
>> commands
>> LISTBOX INSERT 
>> 
COLUMN(lb_Listbox;1;"obj_Listbox_Column1";Listbox_Column1;"obj_Col_Header";Col_Header)
>> copy array($Host_Data->;listbox_Column1)
>> 
>> How do I declare the array listbox_column1 so that:
>> - the component will compile
>> - the component will not complain once built and used with a host
>> 
>> Thanks for any insight
>> Chip
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://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)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Overlapping Objects in Data Segment #65

2019-08-09 Thread Spencer Hinsdale via 4D_Tech
can you drop indexes for the conversion?

Spencer


> On Aug 8, 2019, at 8:15 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> It seemed to be a problem with the address table. I had to end task while 
> indexing during an R5 upgrade of one of our mirrors due to the cache memory 
> release issue in current versions, and address table errors during journal 
> file integrations appeared shortly after bringing the mirror back online in 
> R5.
> 
> I restored that data file back to the 17.1 version and verified it and it 
> came back with a completely clean bill of health.  I'll try the R5 reindex 
> once again after I figure out how to get it to complete without locking up 
> when the cache memory (~ 400GB) is full.  
> 
> I'm thinking I'll set the cache very high (higher than physical memory) and 
> let Windows handle the memory overflow, so 4D never has to release cache 
> memory. Or buy more RAM.
> 
> Jeff
> 
> P.S. - I think issues in the .4DIndy are always indicated by a reference to 
> the table "Resources".
> 
>> On Aug 8, 2019, at 8:19 PM, Spencer Hinsdale  wrote:
>> 
>> no but i feel like _you_ posted a while back that is the indy index of 
>> structure ;)
>> 
>> https://kb.4d.com/assetid=76692
>> 
>> Spencer
>> 
>> 
>>> On Aug 8, 2019, at 4:58 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
>>> wrote:
>>> 
>>> I ran a verify of our data file, and records were fine, indexes were fine, 
>>> but at the end of the log was an error:
>>> 
>>> Error: Overlapping Objects in data segment # 65 : Address overlaps(31;140)
>>> 
>>> 
>>> Does anyone know what this means?
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - array listbox column Compiler definition

2019-08-09 Thread Jeremy Roussak via 4D_Tech
Chip,

Why do you need to use a copy of the data in the component? Why not just use 
$HostData-> in the call to LISTBOX INSERT COLUMN? 

Jeremy

> On 8 Aug 2019, at 20:59, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have a component.
> In the component, I have a published (shared) method which opens an 
> array listbox in its own window.
> 
> The data to be shown is passed from the host.
> I place the data from the host into the listbox using the following 
> commands
> LISTBOX INSERT 
> COLUMN(lb_Listbox;1;"obj_Listbox_Column1";Listbox_Column1;"obj_Col_Header";Col_Header)
> copy array($Host_Data->;listbox_Column1)
> 
> How do I declare the array listbox_column1 so that:
> - the component will compile
> - the component will not complain once built and used with a host
> 
> Thanks for any insight
> Chip
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**