summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2017-05-13 12:43:49 -0300
committerOlivier Hallot <olivier.hallot@edx.srv.br>2017-05-16 15:20:20 +0200
commitfd99f1798a440ccdfb34e910285a7c5c9a9ff08d (patch)
tree4fc26498af6434eb8db8cd99dc3b6ca36dc8b8c9
parent9a16735c5ebee4513d02b8f28b2147ec9407c18a (diff)
tdf#84675 (part2) document hidden BASIC func/const
GetAttr() SetAttr Valid ATTR for SetAttr statement are ATTR_NORMAL ATTR_READONLY ATTR_HIDDEN Others ATTR_* were not implemented, see http://opengrok.libreoffice.org/xref/core/basic/source/runtime/methods.cxx#4689 Change-Id: I51b50c13709b668c935b9a68981c20545648691d Reviewed-on: https://gerrit.libreoffice.org/37576 Reviewed-by: Olivier Hallot <olivier.hallot@edx.srv.br> Tested-by: Olivier Hallot <olivier.hallot@edx.srv.br>
-rw-r--r--source/text/sbasic/shared/03020409.xhp115
-rw-r--r--source/text/sbasic/shared/03020414.xhp71
2 files changed, 159 insertions, 27 deletions
diff --git a/source/text/sbasic/shared/03020409.xhp b/source/text/sbasic/shared/03020409.xhp
index a26b96530e..8c1196fd90 100644
--- a/source/text/sbasic/shared/03020409.xhp
+++ b/source/text/sbasic/shared/03020409.xhp
@@ -54,27 +54,114 @@
<embed href="text/sbasic/shared/00000003.xhp#err53"/>
<paragraph id="hd_id3145364" role="heading" level="2" xml-lang="en-US">Value</paragraph>
-<paragraph id="par_id3147349" role="paragraph" xml-lang="en-US">0 : Normal files.</paragraph>
-<paragraph id="par_id3147434" role="paragraph" xml-lang="en-US">1 : Read-only files.</paragraph>
-<paragraph id="par_id3159154" role="paragraph" xml-lang="en-US">8 : Returns the name of the volume</paragraph>
-<paragraph id="par_id3145271" role="paragraph" xml-lang="en-US">16 : Returns the name of the directory only.</paragraph>
-<paragraph id="par_id3153953" role="paragraph" xml-lang="en-US">32 : File was changed since last backup (Archive bit).</paragraph>
+
+<table id="Table1">
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id051220170522586822" role="tablehead" xml-lang="en-US">Named constant</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522583099" role="tablehead" xml-lang="en-US">Value</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522583818" role="tablehead" xml-lang="en-US">Definition</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id051220170522588740" role="tablecontent" xml-lang="en-US">ATTR_NORMAL</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522583733" role="tablecontent" xml-lang="en-US">0</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id3147349" role="paragraph" xml-lang="en-US"> Normal files.</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id051220170522587742" role="tablecontent" xml-lang="en-US">ATTR_READONLY</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522584092" role="tablecontent" xml-lang="en-US">1</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id3147434" role="paragraph" xml-lang="en-US"> Read-only files.</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id05122017054654588" role="tablecontent" xml-lang="en-US">ATTR_HIDDEN</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170546549512" role="tablecontent" xml-lang="en-US">2</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170546544550" role="paragraph" xml-lang="en-US"> Hidden file</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id051220170546546528" role="tablecontent" xml-lang="en-US">ATTR_SYSTEM</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170546548373" role="tablecontent" xml-lang="en-US">4</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170546546496" role="paragraph" xml-lang="en-US"> System file</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id051220170522588594" role="tablecontent" xml-lang="en-US">ATTR_VOLUME</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522581431" role="tablecontent" xml-lang="en-US">8</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id3159154" role="paragraph" xml-lang="en-US"> Returns the name of the volume</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id05122017052258465" role="tablecontent" xml-lang="en-US">ATTR_DIRECTORY</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522585148" role="tablecontent" xml-lang="en-US">16</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id3145271" role="paragraph" xml-lang="en-US"> Returns the name of the directory only.</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id051220170522585987" role="tablecontent" xml-lang="en-US">ATTR_ARCHIVE</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522583804" role="tablecontent" xml-lang="en-US">32</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id3153953" role="paragraph" xml-lang="en-US"> File was changed since last backup (Archive bit).</paragraph>
+ </tablecell>
+ </tablerow>
+</table>
+
<paragraph id="par_id3156444" role="paragraph" xml-lang="en-US">If you want to know if a bit of the attribute byte is set, use the following query method:</paragraph>
<paragraph id="hd_id3153094" role="heading" level="2" xml-lang="en-US">Example:</paragraph>
<bascode>
<paragraph id="par_idm1341566848" role="bascode" localize="false" xml-lang="en-US">Sub ExampleSetGetAttr</paragraph>
<paragraph id="par_id3155415" role="bascode" xml-lang="en-US">On Error GoTo ErrorHandler ' Define target for error handler</paragraph>
-<paragraph id="par_idm1341563936" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test",16)="" Then MkDir "C:\test"</paragraph>
-<paragraph id="par_idm1341562672" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph>
-<paragraph id="par_idm1341561360" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" ,0</paragraph>
-<paragraph id="par_idm1341560096" role="bascode" localize="false" xml-lang="en-US"> FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph>
-<paragraph id="par_idm1341558816" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" ,1</paragraph>
-<paragraph id="par_idm1341557552" role="bascode" localize="false" xml-lang="en-US"> Print GetAttr( "c:\test\autoexec.sav" )</paragraph>
-<paragraph id="par_idm1341556288" role="bascode" localize="false" xml-lang="en-US"> End</paragraph>
+<paragraph id="par_idm1341563936" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test",16)="" Then MkDir "C:\test"</paragraph>
+<paragraph id="par_idm1341562672" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph>
+<paragraph id="par_idm1341561360" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" ,0</paragraph>
+<paragraph id="par_idm1341560096" role="bascode" localize="false" xml-lang="en-US"> FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph>
+<paragraph id="par_idm1341558816" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" ,1</paragraph>
+<paragraph id="par_idm1341557552" role="bascode" localize="false" xml-lang="en-US"> Print GetAttr( "c:\test\autoexec.sav" )</paragraph>
+<paragraph id="par_idm1341556288" role="bascode" localize="false" xml-lang="en-US"> End</paragraph>
<paragraph id="par_idm1341555056" role="bascode" localize="false" xml-lang="en-US">ErrorHandler:</paragraph>
-<paragraph id="par_idm1341553824" role="bascode" localize="false" xml-lang="en-US"> Print Error</paragraph>
-<paragraph id="par_idm1341552592" role="bascode" localize="false" xml-lang="en-US"> End</paragraph>
+<paragraph id="par_idm1341553824" role="bascode" localize="false" xml-lang="en-US"> Print Error</paragraph>
+<paragraph id="par_idm1341552592" role="bascode" localize="false" xml-lang="en-US"> End</paragraph>
<paragraph id="par_idm1341551360" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph>
</bascode>
</body>
diff --git a/source/text/sbasic/shared/03020414.xhp b/source/text/sbasic/shared/03020414.xhp
index f7296ea162..fbd727499c 100644
--- a/source/text/sbasic/shared/03020414.xhp
+++ b/source/text/sbasic/shared/03020414.xhp
@@ -47,9 +47,54 @@
<paragraph id="par_id3154909" role="paragraph" xml-lang="en-US">FileName: Name of the file, including the path, that you want to test attributes of. If you do not enter a path, <emph>SetAttr</emph> searches for the file in the current directory. You can also use <link href="text/sbasic/shared/00000002.xhp" name="URL notation">URL notation</link>.</paragraph>
<paragraph id="par_id3153192" role="paragraph" xml-lang="en-US"> <emph>Attribute:</emph> Bit pattern defining the attributes that you want to set or to clear:</paragraph>
<paragraph id="par_id3145786" role="paragraph" xml-lang="en-US"> <emph>Value</emph> </paragraph>
-<paragraph id="par_id3152596" role="paragraph" xml-lang="en-US">0 : Normal files.</paragraph>
-<paragraph id="par_id3149262" role="paragraph" xml-lang="en-US">1 : Read-only files.</paragraph>
-<paragraph id="par_id3152576" role="paragraph" xml-lang="en-US">32 : File was changed since last backup (Archive bit).</paragraph>
+
+<table id="Table1">
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id051220170522586822" role="tablehead" xml-lang="en-US">Named constant</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522583099" role="tablehead" xml-lang="en-US">Value</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522583818" role="tablehead" xml-lang="en-US">Definition</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id051220170522588740" role="tablecontent" xml-lang="en-US">ATTR_NORMAL</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522583733" role="tablecontent" xml-lang="en-US">0</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id3147349" role="paragraph" xml-lang="en-US"> Normal files.</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id051220170522587742" role="tablecontent" xml-lang="en-US">ATTR_READONLY</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170522584092" role="tablecontent" xml-lang="en-US">1</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id3147434" role="paragraph" xml-lang="en-US"> Read-only files.</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id05122017054654588" role="tablecontent" xml-lang="en-US">ATTR_HIDDEN</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170546549512" role="tablecontent" xml-lang="en-US">2</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id051220170546544550" role="paragraph" xml-lang="en-US"> Hidden file</paragraph>
+ </tablecell>
+ </tablerow>
+</table>
+
<paragraph id="par_id3153093" role="paragraph" xml-lang="en-US">You can set multiple attributes by combining the respective values with a logic OR statement.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#errorcode"/>
<embed href="text/sbasic/shared/00000003.xhp#err5"/>
@@ -59,17 +104,17 @@
<paragraph id="hd_id3147434" role="heading" level="2" xml-lang="en-US">Example:</paragraph>
<bascode>
<paragraph id="par_idm1340803584" role="bascode" localize="false" xml-lang="en-US">Sub ExampleSetGetAttr</paragraph>
-<paragraph id="par_id3148645" role="bascode" xml-lang="en-US"> On Error GoTo ErrorHandler ' Define target for error handler</paragraph>
-<paragraph id="par_idm1340800592" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test",16)="" Then MkDir "C:\test"</paragraph>
-<paragraph id="par_idm1340799328" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph>
-<paragraph id="par_idm1340798016" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" ,0</paragraph>
-<paragraph id="par_idm1340796752" role="bascode" localize="false" xml-lang="en-US"> FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph>
-<paragraph id="par_idm1341620608" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" ,1</paragraph>
-<paragraph id="par_idm1341619344" role="bascode" localize="false" xml-lang="en-US"> Print GetAttr( "c:\test\autoexec.sav" )</paragraph>
-<paragraph id="par_idm1341618080" role="bascode" localize="false" xml-lang="en-US"> End</paragraph>
+<paragraph id="par_id3148645" role="bascode" xml-lang="en-US"> On Error GoTo ErrorHandler ' Define target for error handler</paragraph>
+<paragraph id="par_idm1340800592" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test",16)="" Then MkDir "C:\test"</paragraph>
+<paragraph id="par_idm1340799328" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph>
+<paragraph id="par_idm1340798016" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" ,0</paragraph>
+<paragraph id="par_idm1340796752" role="bascode" localize="false" xml-lang="en-US"> FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph>
+<paragraph id="par_idm1341620608" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" , ATTR_READONLY</paragraph>
+<paragraph id="par_idm1341619344" role="bascode" localize="false" xml-lang="en-US"> Print GetAttr( "c:\test\autoexec.sav" )</paragraph>
+<paragraph id="par_idm1341618080" role="bascode" localize="false" xml-lang="en-US"> End</paragraph>
<paragraph id="par_idm1341616848" role="bascode" localize="false" xml-lang="en-US">ErrorHandler:</paragraph>
-<paragraph id="par_idm1341615616" role="bascode" localize="false" xml-lang="en-US"> Print Error</paragraph>
-<paragraph id="par_idm1341614384" role="bascode" localize="false" xml-lang="en-US"> End</paragraph>
+<paragraph id="par_idm1341615616" role="bascode" localize="false" xml-lang="en-US"> Print Error</paragraph>
+<paragraph id="par_idm1341614384" role="bascode" localize="false" xml-lang="en-US"> End</paragraph>
<paragraph id="par_idm1341613152" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph>
</bascode>
</body>