PICTURE LIBRARY LIST

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0.2


PICTURE LIBRARY LIST (picRefs; picNames)

ParameterTypeDescription
picRefsNumeric ArrayReference numbers of the Picture Library graphics
picNamesString ArrayNames of the Picture Library graphics

Description

The PICTURE LIBRARY LIST command returns the reference numbers and names of the pictures currently stored in the Picture Library of the database.

After the call, you retrieve the reference numbers in the array picRefs and the names in the array picNames. The two arrays are synchronized: the nth element of picRefs is the reference number of the Picture Library graphic whose name is returned in the nth element of picNames.

The array picRefs can be a Real, Long Integer or Integer array. In interpreted mode, if the array is not declared prior to the call to PICTURE LIBRARY LIST, a Real array is created by default.

The array picNames can be a String or Text array. In interpreted mode, if the array is not declared prior to the call PICTURE LIBRARY LIST, a Text array is created by default.

The maximum length of a Picture Library graphic name is 31 characters. If you use a String array as picNames, declare it with a large enough fixed length to avoid having a truncated name returned.

If there are no pictures in the Picture Library, both arrays are returned empty.

To obtain the number of pictures currently stored in the Picture Library, use the Size of array command to get the size of one of the two arrays.

Examples

1. The following code returns the catalog of the Picture Library in the arrays alPicRef and asPicName:

   PICTURE LIBRARY LIST(alPicRef;asPicName)

2. The following example tests whether or not the Picture Library is empty:

   PICTURE LIBRARY LIST(alPicRef;asPicName)
   If (Size of array(alPicRef)=0)
      ALERT("The Picture Library is empty.")
   Else
      ALERT("The Picture Library contains "+String(Size of array(alPicRef))+" pictures.")
   End if

3. The following example exports the Picture Library to a document on disk:

   PICTURE LIBRARY LIST($alPicRef;$asPicName)
   $vlNbPictures:=Size of array($alPicRef)
   If ($vlNbPictures>0)
      SET CHANNEL(12;"")
      If (OK=1)
         $vsTag:="4DV6PICTURELIBRARYEXPORT"
         SEND VARIABLE($vsTag)
         SEND VARIABLE($vlNbPictures)
         gError:=0
         For($vlPicture;1;$vlNbPictures)
            $vlPicRef:=$alPicRef{$vlPicture}
            $vsPicName:=$asPicName{$vlPicture}
            GET PICTURE FROM LIBRARY($alPicRef{$vlPicture};$vgPicture)
            If (OK=1)
               SEND VARIABLE($vlPicRef)
               SEND VARIABLE($vsPicName)
               SEND VARIABLE($vgPicture)
            Else
               $vlPicture:=$vlNbPictures+1
               gError:=-108
            End if
         End for
         SET CHANNEL(11)
         If (gError#0)
            ALERT("The Picture Library could not be exported, retry with more memory.")
            DELETE DOCUMENT (Document)
         End if
      End if
   Else
      ALERT("The Picture Library is empty.")
   End if

See Also

GET PICTURE FROM LIBRARY, REMOVE PICTURE FROM LIBRARY, SET PICTURE TO LIBRARY.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next