GetSymbolLocationEx (symbol_name, output_buffer, fMatchCase, LocateFiles, fLocateSymbols)

Finds all the declarations for the symbol specified in symbol_name. Each declaration location is appended as a line to the given buffer output_buffer as a Symbol record. If fMatchCase, then the symbol name case must match exactly. If fLocateFiles, then file names in the project or on the project symbol path are located. File extensions don't have to be specified. If fLocateSymbols, then symbol definitions are located. Both fLocateFiles and fLocateSymbols may be set to True.

See also “Symbol Record”.

Since record variables can be expressed as a string, a Symbol record can be written as a line of text in a buffer. To read a Symbol record from the output buffer, use the GetBufLine function to return the entire line text; in this case a Symbol record. See GetSymbolLocation for a description of the Symbol record.

GetSymbolLocationEx returns the number of matching declarations, or zero if none were found.

Unlike the GetSymbolLocation function, this function will find multiple declarations that match on symbol_name. You can use this function to enumerate through each location by scanning each line of the output buffer.

This example looks up a symbol and enumerates through each declaration found:

symbol = Ask("What symbol do you want to locate?")
hbuf = NewBuf("output")
count = GetSymbolLocationEx(symbol, hbuf, 1, 1, 1)
ln = 0
while (ln < count)
    loc = GetBufLine(hbuf, ln)
    msg (loc.file # " at line " # loc.lnFirst)
    ln = ln + 1

In this section: