Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter FourteenProject Functions (continued)

ProjectGetEntryAsString Function

Overview

The ProjectGetEntryAsString function will retrieve a specific data element from a project entry as a string.

Syntax/Parameters

Syntax

string = ProjectGetEntryAsString ( int index, int item );

Parameters

index

An int that specifies the zero-based position of the entry within the project.

item

An int specifying the item to retrieve.

Return Value

Returns a string containing the specified item or an empty string on failure. Use the GetLastError function to retrieve error information.

Remarks

Entry properties are mixed as strings and numeric data. The GetLastError function should be used to differentiate between an empty return string caused by an empty item or by an error.

The items are as follows:

  Term   Ordinal   Description
  File:        
    PROJECT_ENTRY_NAME   0   Source Name (relative to project base)
    PROJECT_ENTRY_MOD_TIME   1   Time the file was last modified (returned as ISO-8601)
    PROJECT_ENTRY_SIZE   2   Size of the file
    PROJECT_ENTRY_F_TYPE   3   File Type (FT_)
    PROJECT_ENTRY_FLAGS   4   Flags
    PROJECT_ENTRY_STATUS_DESCRIPTION   5   File Status (open status, not saved)
  Application Properties:        
    PROJECT_ENTRY_D_TYPE   6   Descriptive Type (EDGAR Document Type)
    PROJECT_ENTRY_DESCRIPTION   7   File Description (EDGAR Description)
    PROJECT_ENTRY_COMMENT   8   Comment
    PROJECT_ENTRY_EDIT_STATUS   9   Edit Status
  Publishing:        
    PROJECT_ENTRY_MEMBER_FLAGS   10   Membership Flags
    PROJECT_ENTRY_SWITCHES   11   Publishing Switches
  FTP Server/Transfer Information:      
    PROJECT_ENTRY_LU_SIZE   12   Last Upload Size
    PROJECT_ENTRY_LU_MOD_TIME   13   Last Upload Modified Time (returned as ISO-8601)
    PROJECT_ENTRY_LU_SERVER_TIME   14   File Time on File Server (returned as ISO-8601)

 

Example

The following example is a subroutine that will load all document filenames, types, and descriptions into a table:

                                                // ** Global Items
    string              list[200][3];           // Document List (200 max EDGAR)
   
int get_document_list() {                       // Load the document list

    string              name;
    int                 ix, size;

    ArrayClear(list);                           // For Repeat Calls
    size = ProjectGetEntryCount();
    while (ix < size) {
      name = ProjectGetEntry(ix);
      list[name][0] = name;
      list[name][1] = ProjectGetEntryAsString(ix, PROJECT_ENTRY_D_TYPE);
      list[name][2] = ProjectGetEntryAsString(ix, PROJECT_ENTRY_DESCRIPTION);
      ix++;
      }
    return ERROR_NONE;
    }

Notice the name of the document is also used as a key name allowing for reference by the filename. In addition, the list is cleared on call to remove any problems with repeated calls.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL