4D v14.3

PICTURE LIBRARY LIST

Home

 
4D v14.3
PICTURE LIBRARY LIST

PICTURE LIBRARY LIST 


 

PICTURE LIBRARY LIST ( picRefs ; picNames ) 
Parameter Type   Description
picRefs  Longint array in Reference numbers of the Picture Library graphics
picNames  String array in Names of the Picture Library graphics

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.

If necessary, the command automatically creates and sizes the picRefs and picNames arrays.

The maximum length of a Picture Library graphic name is 255 characters.

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.

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

 PICTURE LIBRARY LIST(alPicRef;asPicName)

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

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:=$vlPicture+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

 
PROPERTIES 

Product: 4D
Theme: Pictures
Number: 564

 
HISTORY 

Created: 4D v6.0.2

 
SEE ALSO 

GET PICTURE FROM LIBRARY
REMOVE PICTURE FROM LIBRARY
SET PICTURE TO LIBRARY

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)