Re: Getting a collection created from 4D function to work in Storage.

2019-03-20 Thread John DeSoi via 4D_Tech
The first line does nothing because you don't do anything with the function 
result of the call. The second line assigning $myTempVolumeCol to a copy 
returns a regular collection (see documentation). The error is because you 
can't assign a regular collection to a shared collection 
(Storage.serverVolumes:=$myTempVolumeCol).

To duplicate an object or collection as a shared object/collection you have to 
iterate over all of the values and then recursively convert to shared any 
object/collection.

John DeSoi, Ph.D.


> On Mar 20, 2019, at 12:16 PM, Eric Naujock via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> New shared collection($myTempVolumeCol)
> $myTempVolumeCol:=$volumeData.copy()  
>   Use (Storage)
>   Storage.serverVolumes:=New shared collection
>   Use (Storage.serverVolumes)
>   Storage.serverVolumes:=$myTempVolumeCol
>   End use 
>   End use 
> 
> This code gives me the following error. “Not supported value type in a shared 
> object or a shared collection” This seems to be preventing me from using the  
> Storage. I can just assign the variable as an interprocess variable but I was 
> trying to get away from using interprocess variables. Any suggestions?

**
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
**

Getting a collection created from 4D function to work in Storage.

2019-03-20 Thread Eric Naujock via 4D_Tech
I am having a curious time with this one. 

I am trying to get a collection retrieved from Get System Info to be saved into 
the Storage Collection.

Right now I am using the following to get the information.

$systemInfo:=Get system info
$volumeCollections:= $systemInfo.volumes

This is saved in a table in 4D  on the server and then retrieved at the Client 
machine. On the client a collection shows up as $volumeData another collection.

New shared collection($myTempVolumeCol)
$myTempVolumeCol:=$volumeData.copy()
Use (Storage)
Storage.serverVolumes:=New shared collection
Use (Storage.serverVolumes)
Storage.serverVolumes:=$myTempVolumeCol
End use 
End use 

This code gives me the following error. “Not supported value type in a shared 
object or a shared collection” This seems to be preventing me from using the  
Storage. I can just assign the variable as an interprocess variable but I was 
trying to get away from using interprocess variables. Any suggestions?

I have also tried the following to get the data into a shared collection prior 
to trying to copy to Storage. The attempt to copy will also fail.

COLLECTION TO ARRAY($volumeData;$volumeArray)   
myTempVolumeCol:=New shared collection
Use (myTempVolumeCol)
ARRAY TO COLLECTION(myTempVolumeCol;$volumeArray)
End use 
<>serverVolumeData:=$volumeData.copy()
Use (Storage)
Storage.serverVolumes:=New shared collection
Use (Storage.serverVolumes)
Storage.serverVolumes:=myTempVolumeCol
End use 
End use 

C_COLLECTION($mySavedVolumes)
$mySavedVolumes:=Storage.serverVolumes

The array to collection will give me a collection of null values. Is this a 
case of 4D just not having fixed this yet. I should be able to copy a return 
vale object to Storage or I would expect so.

**
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
**