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/03020301.xhp | |
parent | 6291844ea9c4c1d6863c62cbd33e841ff21d3e7a (diff) |
format Basic code examples
Diffstat (limited to 'source/text/sbasic/shared/03020301.xhp')
-rw-r--r-- | source/text/sbasic/shared/03020301.xhp | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/source/text/sbasic/shared/03020301.xhp b/source/text/sbasic/shared/03020301.xhp index 7d688e8709..ea122bc8f5 100644 --- a/source/text/sbasic/shared/03020301.xhp +++ b/source/text/sbasic/shared/03020301.xhp @@ -47,7 +47,9 @@ <paragraph role="paragraph" id="par_id3147182" xml-lang="en-US" l10n="U" oldref="2">Determines if the file pointer has reached the end of a file.</paragraph> </section> <paragraph role="heading" id="hd_id3149119" xml-lang="en-US" level="2" l10n="U" oldref="3">Syntax:</paragraph> -<paragraph role="code" id="par_id3147399" xml-lang="en-US" l10n="U" oldref="4">Eof (intexpression As Integer)</paragraph> +<bascode> +<paragraph role="bascode" id="par_id3147399" xml-lang="en-US" l10n="U" oldref="4">Eof (intexpression As Integer)</paragraph> +</bascode> <paragraph role="heading" id="hd_id3153539" xml-lang="en-US" level="2" l10n="U" oldref="5">Return value:</paragraph> <paragraph role="paragraph" id="par_id3156027" xml-lang="en-US" l10n="U" oldref="6">Bool</paragraph> <paragraph role="heading" id="hd_id3152924" xml-lang="en-US" level="2" l10n="U" oldref="7">Parameters:</paragraph> @@ -58,27 +60,29 @@ <embed href="text/sbasic/shared/00000003.xhp#err5"/> <embed href="text/sbasic/shared/00000003.xhp#err52"/> <paragraph role="heading" id="hd_id3154046" xml-lang="en-US" level="2" l10n="U" oldref="10">Example:</paragraph> -<paragraph role="code" id="par_id3143270" xml-lang="en-US" l10n="U" oldref="11">Sub ExampleWorkWithAFile</paragraph> -<paragraph role="code" id="par_id3150670" xml-lang="en-US" l10n="U" oldref="12">Dim iNumber As Integer</paragraph> -<paragraph role="code" id="par_id3154143" xml-lang="en-US" l10n="U" oldref="13">Dim sLine As String</paragraph> -<paragraph role="code" id="par_id3148943" xml-lang="en-US" l10n="U" oldref="14">Dim aFile As String</paragraph> -<paragraph role="code" id="par_id3153897" xml-lang="en-US" l10n="U" oldref="37">Dim sMsg as String</paragraph> -<paragraph role="code" id="par_id3156344" xml-lang="en-US" l10n="U" oldref="15">aFile = "c:\data.txt"</paragraph> -<paragraph role="code" id="par_id3148663" xml-lang="en-US" l10n="U" oldref="17">iNumber = Freefile</paragraph> -<paragraph role="code" id="par_id3153379" xml-lang="en-US" l10n="U" oldref="18">Open aFile For Output As #iNumber</paragraph> -<paragraph role="code" id="par_id3153360" xml-lang="en-US" l10n="U" oldref="19">Print #iNumber, "First line of text"</paragraph> -<paragraph role="code" id="par_id3148797" xml-lang="en-US" l10n="U" oldref="20">Print #iNumber, "Another line of text"</paragraph> -<paragraph role="code" id="par_id3154684" xml-lang="en-US" l10n="U" oldref="21">Close #iNumber</paragraph> -<paragraph role="code" id="par_id3153104" xml-lang="en-US" l10n="U" oldref="25">iNumber = Freefile</paragraph> -<paragraph role="code" id="par_id3144761" xml-lang="en-US" l10n="U" oldref="26">Open aFile For Input As iNumber</paragraph> -<paragraph role="code" id="par_id3153193" xml-lang="en-US" l10n="U" oldref="27">While not eof(iNumber)</paragraph> -<paragraph role="code" id="par_id3158408" xml-lang="en-US" l10n="U" oldref="28">Line Input #iNumber, sLine</paragraph> -<paragraph role="code" id="par_id3149203" xml-lang="en-US" l10n="U" oldref="29">If sLine <>"" then</paragraph> -<paragraph role="code" id="par_id3153770" xml-lang="en-US" l10n="U" oldref="30">sMsg = sMsg & sLine & chr(13)</paragraph> -<paragraph role="code" id="par_id3153367" xml-lang="en-US" l10n="U" oldref="32">end if</paragraph> -<paragraph role="code" id="par_id3147318" xml-lang="en-US" l10n="U" oldref="33">wend</paragraph> -<paragraph role="code" id="par_id3152939" xml-lang="en-US" l10n="U" oldref="34">Close #iNumber</paragraph> -<paragraph role="code" id="par_id3153726" xml-lang="en-US" l10n="U" oldref="38">Msgbox sMsg</paragraph> -<paragraph role="code" id="par_id3153092" xml-lang="en-US" l10n="U" oldref="35">End Sub</paragraph> +<bascode> +<paragraph role="bascode" localize="false" xml-lang="en-US">Sub ExampleWorkWithAFile</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">Dim iNumber As Integer</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">Dim sLine As String</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">Dim aFile As String</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">Dim sMsg As String</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> aFile = "c:\data.txt"</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> iNumber = Freefile</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> Open aFile For Output As #iNumber</paragraph> +<paragraph role="bascode" id="par_id3153360" xml-lang="en-US" l10n="U" oldref="19"> Print #iNumber, "First line of text"</paragraph> +<paragraph role="bascode" id="par_id3148797" xml-lang="en-US" l10n="U" oldref="20"> Print #iNumber, "Another line of text"</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> Close #iNumber</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> iNumber = Freefile</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> Open aFile For Input As iNumber</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> While Not eof(iNumber)</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> Line Input #iNumber, sLine</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> If sLine <>"" Then</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> sMsg = sMsg & sLine & chr(13)</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> End If</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> Wend</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> Close #iNumber</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US"> MsgBox sMsg</paragraph> +<paragraph role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +</bascode> </body> </helpdocument> |