Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

MsSeek

MsSeek(cChave,[lSoft]) -> lFound

Positions records using the active index key.

MsSeekAdvPL
01 · OVERVIEW

Overview

Requires an open area and suitable index. MsSeek reuses positioning information within the thread for repeated searches; this is not a global cache across jobs. The key must match index types, widths and components, including branch when applicable. The official reference mixes approximate-search wording in lSoft and examples; if exact matching is required, compare key fields after the call instead of relying solely on the logical result. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

MsSeek(cChave,[lSoft]) -> lFound

Parameters

cChave
CharacterRequired

Search key matching the active index.

lSoft
LogicalOptional

Approximation/positioning behavior; verify against the release and tests.

Return value

Logical result used by official examples; inspect fields to validate full equality.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed551()
    // Requires a prepared work area/index; block not invoked.
    Local bFind := {|cKey| MsSeek(cKey)}
    ConOut(ValType(bFind))
Return Nil
Expected result

Prints B. The uninvoked block moves no cursor. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Preserve work area/order, check result and EOF, and compare components when exact equality is required. Avoid fixed index numbers without checking the environment’s SIX.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. MsSeek. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha