diff options
author | Andras Timar <atimar@suse.com> | 2012-11-15 11:10:24 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-11-15 20:46:51 +0100 |
commit | ff39701b0e841035089929ab7811c7431ab9b39b (patch) | |
tree | 03f3607f3ad5c5b788f8932a80c6c847bd90b1ae /source/text/sbasic/shared/03020412.xhp | |
parent | 6291844ea9c4c1d6863c62cbd33e841ff21d3e7a (diff) |
format Basic code examples
Diffstat (limited to 'source/text/sbasic/shared/03020412.xhp')
-rw-r--r-- | source/text/sbasic/shared/03020412.xhp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/source/text/sbasic/shared/03020412.xhp b/source/text/sbasic/shared/03020412.xhp index de02a33586..22042f9e11 100644 --- a/source/text/sbasic/shared/03020412.xhp +++ b/source/text/sbasic/shared/03020412.xhp @@ -49,21 +49,25 @@ <paragraph role="paragraph" id="par_id3154346" xml-lang="en-US" l10n="U" oldref="2">Renames an existing file or directory.</paragraph> </section> <paragraph role="heading" id="hd_id3156344" xml-lang="en-US" level="2" l10n="U" oldref="3">Syntax:</paragraph> -<paragraph role="code" id="par_id3153381" xml-lang="en-US" l10n="U" oldref="4">Name OldName As String As NewName As String</paragraph> +<bascode> +<paragraph role="bascode" id="par_id3153381" xml-lang="en-US" l10n="U" oldref="4">Name OldName As String As NewName As String</paragraph> +</bascode> <paragraph role="heading" id="hd_id3153362" xml-lang="en-US" level="2" l10n="U" oldref="5">Parameters:</paragraph> <paragraph role="paragraph" id="par_id3151210" xml-lang="en-US" l10n="U" oldref="6"> <emph>OldName, NewName:</emph> Any string expression that specifies the file name, including the path. You can also use <link href="text/sbasic/shared/00000002.xhp" name="URL notation">URL notation</link>.</paragraph><comment>see #i61074</comment> <paragraph role="heading" id="hd_id3125863" xml-lang="en-US" level="2" l10n="U" oldref="8">Example:</paragraph> -<paragraph role="code" id="par_id3145786" xml-lang="en-US" l10n="U" oldref="9">Sub ExampleReName</paragraph> -<paragraph role="code" id="par_id3161832" xml-lang="en-US" l10n="U" oldref="10">On Error Goto Error</paragraph> -<paragraph role="code" id="par_id3147435" xml-lang="en-US" l10n="U" oldref="11">Filecopy "c:\autoexec.bat", "c:\temp\autoexec.sav"</paragraph> -<paragraph role="code" id="par_id3156444" xml-lang="en-US" l10n="CHG" oldref="12">Name "c:\temp\autoexec.sav" as "c:\temp\autoexec.bat"</paragraph> -<paragraph role="code" id="par_id3155308" xml-lang="en-US" l10n="U" oldref="13">end</paragraph> -<paragraph role="code" id="par_id3153727" xml-lang="en-US" l10n="U" oldref="14">Error:</paragraph> -<paragraph role="code" id="par_id3153951" xml-lang="en-US" l10n="CHG" oldref="15">if err = 58 then</paragraph> -<paragraph role="code" id="par_id3152462" xml-lang="en-US" l10n="U" oldref="16">msgbox "File already exists"</paragraph> -<paragraph role="code" id="par_id3149263" xml-lang="en-US" l10n="U" oldref="17">end if</paragraph> -<paragraph role="code" id="par_id3154011" xml-lang="en-US" l10n="U" oldref="18">end</paragraph> -<paragraph role="code" id="par_id3146985" xml-lang="en-US" l10n="U" oldref="19">end sub</paragraph> +<bascode> +<paragraph role="bascode" localize="false" xml-lang="en-US">Sub ExampleReName</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">On Error GoTo Error</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">FileCopy "c:\autoexec.bat", "c:\temp\autoexec.sav"</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">Name "c:\temp\autoexec.sav" As "c:\temp\autoexec.bat"</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">End</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">Error:</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">If err = 58 Then</paragraph> +<paragraph role="bascode" id="par_id3152462" xml-lang="en-US" l10n="U" oldref="16"> MsgBox "File already exists"</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">End If</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">End</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +</bascode> </body> </helpdocument> |