Difference between revisions of "SELECT()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) (→See Also) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
− | Function to return the current workarea number | + | Function to return the current or specified cursor/workarea number |
− | + | ||
==Syntax== | ==Syntax== | ||
− | SELECT([<alias>]) | + | SELECT([<alias> | <expN>]) |
− | + | ||
==See Also== | ==See Also== | ||
− | [[ | + | [[ALIAS()]], [[DBF()]], [[SELECT]], [[SQL SELECT|SELECT (SQL)]], [[USE]], [[WORKAREA()]] |
− | + | ||
==Description== | ==Description== | ||
The SELECT() function returns the number of the currently selected workarea. If the optional <alias> is specified, the SELECT() function returns the workarea number for that alias. If the <alias> specified does not exist, the SELECT() function will return a 0. | The SELECT() function returns the number of the currently selected workarea. If the optional <alias> is specified, the SELECT() function returns the workarea number for that alias. If the <alias> specified does not exist, the SELECT() function will return a 0. | ||
− | + | Specifying 0 as <expN> returns the current cursor/workarea number, specifying 1 as <expN> returns the highest available empty cursor/workarea number. | |
==Example== | ==Example== | ||
Line 23: | Line 20: | ||
? select ("prefixes") | ? select ("prefixes") | ||
3 | 3 | ||
+ | ? select(0) | ||
+ | 3 | ||
+ | ? select(1) | ||
+ | 100 | ||
// Another Example | // Another Example | ||
Line 35: | Line 36: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
+ | [[Category:Cursor Functions]] |
Latest revision as of 06:06, 28 December 2022
Contents
Purpose
Function to return the current or specified cursor/workarea number
Syntax
SELECT([<alias> | <expN>])
See Also
ALIAS(), DBF(), SELECT, SELECT (SQL), USE, WORKAREA()
Description
The SELECT() function returns the number of the currently selected workarea. If the optional <alias> is specified, the SELECT() function returns the workarea number for that alias. If the <alias> specified does not exist, the SELECT() function will return a 0. Specifying 0 as <expN> returns the current cursor/workarea number, specifying 1 as <expN> returns the highest available empty cursor/workarea number.
Example
close all ? select() 1 use prefixes in 3 ? select ("prefixes") 3 ? select(0) 3 ? select(1) 100 // Another Example // to access each open workarea m_count=0 select 1 do while not empty(alias()) m_count = m->m_count + reccount() select select() + 1 enddo dialog box "Total records in all tables is &m_count"