LabelFindFirst() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Initializes an internal label pointer, so that you can query the first label in a map layer. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

LabelFindFirst( map_window_id, layer_number, b_mapper ) 

map_window_id is an integer window id, identifying a Map window.

layer_number is the number of a layer in the current Map window (for example, 1 for the top layer).

b_mapper is a logical value. Specify TRUE to query the labels that appear when the Map is active; specify FALSE to query the labels that appear when the map is inside a Layout.

Return Value

Logical value: TRUE means that labels exist for the specified layer (either labels are currently visible, or the user has edited labels, and those edited labels are not currently visible).

Description

Call LabelFindFirst() when you want to loop through a map layer's labels to query the labels. Querying labels is a two-step process:

  1. Set MapBasic's internal label pointer by calling the LabelFindFirst() function, the LabelFindNext() function, or the LabelFindByID() function.
  2. If the function you called in step 1 did not return FALSE, you can query the current label by calling the LabelInfo() function.

To continue querying additional labels, return to step 1.