show / hide menu

GridGetFileName

The GridGetFileName function is used to retrieve the file name from a specified cell in a dynamic grid control. It can optionally include the file extension in the result.

Syntax

GridGetFileName(DynamicGridControlName, Row Index, Column Index, HasExtension(optional))

Parameters

  • DynamicGridControlName (Control): The name of the dynamic grid control from which you want to retrieve the file name. This is a required parameter.
  • Row Index (Integer): The row index of the grid cell from which the file name is to be retrieved. This is a required parameter.
  • Column Index (Integer): The column index of the grid cell from which the file name is to be retrieved. This is a required parameter.
  • HasExtension (Bool, Optional): Specifies whether the file extension should be included in the result. If set to true, the extension is included; if false, it is excluded. The default value is true.

Example with Optional Argument

TextBox1.Value=GridGetFileName(DynamicGrid1,8,2,false)

Figure 1: Rule

Figure 2: Preview


In this example, the function retrieves the file name from the cell at row index 8 and column index 2 in the grid control named DynamicGrid1, excluding the file extension from the result.

Example without Optional Argument

TextBox1.Value=GridGetFileName(DynamicGrid1,8,2)

Figure 1: Rule

Figure 2: Preview

In this example, the function retrieves the file name from the cell at row index 8 and column index 2 in the grid control named DynamicGrid1, including the file extension in the result by default.

Explanation

  • DynamicGridControlName: This parameter specifies the name of the dynamic grid control from which you want to retrieve the file name. It must be a valid grid control name within your application.
  • Row Index: This parameter specifies the row index of the cell containing the file name. The index should be an integer and typically starts from 0 or 1 depending on the system’s indexing convention.
  • Column Index: This parameter specifies the column index of the cell containing the file name. The index should be an integer.
  • HasExtension (Optional): This parameter determines whether the file name returned will include the file extension. If true, the extension is included; if false, it is excluded. The default behavior is to include the extension.

Practical Use

With HasExtension: Use this when you need to specify whether the file extension should be part of the returned file name. This can be important for applications where you need to differentiate between file names and their types.

Without HasExtension: Use this when the file extension’s inclusion is either not necessary or when you want to rely on the default behavior (which includes the extension).