$Screen attr: Difference between revisions
Jump to navigation
Jump to search
(2 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
This function returns the attributes of a screen item as a blank-delimited string. It can be useful for passing the attributes of a screen to another application, perhaps running on a different platform. | This function returns the attributes of a screen item as a blank-delimited string. It can be useful for passing the attributes of a screen to another application, perhaps running on a different platform. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax"> | <p class="syntax"><span class="term">%string</span> = $Screen_attr(<span class="term">scr_item</span>, [<span class="term">protected</span>], [<span class="term">invisible</span>], [<span class="term">tagged</span>]) | ||
</p> | </p> | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table | <table> | ||
<tr><th>%string</th> | <tr><th>%string</th> | ||
<td>This string value contains a blank-separated list of attributes for the requested screen item.</td></tr> | <td>This string value contains a blank-separated list of attributes for the requested screen item.</td></tr> | ||
<tr><th>scr_item</th> | <tr><th>scr_item</th> | ||
<td>The screen item for which attributes are to be returned. This can be a variable of the form < | <td>The screen item for which attributes are to be returned. | ||
<p>This can be a variable of the form <var class="term">%screen:item</var> or a [[Full-screen feature#Screen_item_name_variables|screen item name variable]] <br />of the form <tt>:</tt><var class="term">%string</var>.</p></td></tr> | |||
<tr><th>protected</th> | <tr><th>protected</th> | ||
<td>The word to be added to the result string if the screen item is protected. If < | <td>The word to be added to the result string if the screen item is protected. If <var class="term">protected</var> is not specified, no word is added to the result string for protected screen items.</td></tr> | ||
<tr><th>invisible</th> | <tr><th>invisible</th> | ||
<td>The word to be added to the result string if the screen item is invisible. If < | <td>The word to be added to the result string if the screen item is invisible. If <var class="term">invisible</var> is not specified, no word is added to the result string for invisible screen items.</td></tr> | ||
<tr><th>tagged</th> | <tr><th>tagged</th> | ||
<td>The word to be added to the result string if the screen item is tagged. If < | <td>The word to be added to the result string if the screen item is tagged. If <var class="term">tagged</var> is not specified, no word is added to the result string for tagged screen items.</td></tr> | ||
</table> | </table> | ||
==Example== | ==Example== | ||
This code fragment displays the attributes of screen item <code>bar</code> in screen <code>foo</code>: | This code fragment displays the attributes of screen item <code>bar</code> in screen <code>foo</code>: | ||
<p class="code">print $Screen_attr(%foo:bar, "protected", "invisible", "tagged") | <p class="code">print $Screen_attr(%foo:bar, "protected", "invisible", "tagged") | ||
</p> | </p> | ||
[[Category:$Functions|$Screen_attr]] | [[Category:$Functions|$Screen_attr]] |
Latest revision as of 19:07, 1 June 2017
Get screen attributes as blank-delimited string
This function returns the attributes of a screen item as a blank-delimited string. It can be useful for passing the attributes of a screen to another application, perhaps running on a different platform.
Syntax
%string = $Screen_attr(scr_item, [protected], [invisible], [tagged])
Syntax terms
%string | This string value contains a blank-separated list of attributes for the requested screen item. |
---|---|
scr_item | The screen item for which attributes are to be returned.
This can be a variable of the form %screen:item or a screen item name variable |
protected | The word to be added to the result string if the screen item is protected. If protected is not specified, no word is added to the result string for protected screen items. |
invisible | The word to be added to the result string if the screen item is invisible. If invisible is not specified, no word is added to the result string for invisible screen items. |
tagged | The word to be added to the result string if the screen item is tagged. If tagged is not specified, no word is added to the result string for tagged screen items. |
Example
This code fragment displays the attributes of screen item bar
in screen foo
:
print $Screen_attr(%foo:bar, "protected", "invisible", "tagged")