From 37d03e7d61caa560373268675ad87d91242bce05 Mon Sep 17 00:00:00 2001 From: Alain Romedenne Date: Tue, 1 Dec 2020 14:39:32 +0100 Subject: tdf#131416 Basic Syntax Diagrams - the end + Beep + MkDir + RmDir + Stop + With Note: Basic functions are not provided with a syntax 'diagram' as their syntax is conventional. Change-Id: I36e37947f8982dd0f27241e6a76edc84572bc636 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/106947 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- Package_html_media.mk | 5 ++ source/media/helpimg/sbasic/Beep_statement.svg | 32 +++++++++++ source/media/helpimg/sbasic/MkDir_statement.svg | 33 +++++++++++ source/media/helpimg/sbasic/RmDir_statement.svg | 33 +++++++++++ source/media/helpimg/sbasic/Stop_statement.svg | 32 +++++++++++ source/media/helpimg/sbasic/With_statement.svg | 35 ++++++++++++ source/text/sbasic/shared/03020411.xhp | 73 +++++++++++++------------ source/text/sbasic/shared/03020413.xhp | 20 ++++--- source/text/sbasic/shared/03090408.xhp | 21 ++++--- source/text/sbasic/shared/03090411.xhp | 28 ++++++---- source/text/sbasic/shared/03130100.xhp | 21 ++++--- 11 files changed, 264 insertions(+), 69 deletions(-) create mode 100644 source/media/helpimg/sbasic/Beep_statement.svg create mode 100644 source/media/helpimg/sbasic/MkDir_statement.svg create mode 100644 source/media/helpimg/sbasic/RmDir_statement.svg create mode 100644 source/media/helpimg/sbasic/Stop_statement.svg create mode 100644 source/media/helpimg/sbasic/With_statement.svg diff --git a/Package_html_media.mk b/Package_html_media.mk index 0d36c67731..2fb33193bc 100644 --- a/Package_html_media.mk +++ b/Package_html_media.mk @@ -114,6 +114,7 @@ $(eval $(call gb_Package_add_files_with_dir,helpcontent2_html_media,$(LIBO_SHARE helpimg/sbasic/char_fragment.svg \ helpimg/sbasic/comment_fragment.svg \ helpimg/sbasic/typename_fragment.svg \ + helpimg/sbasic/Beep_statement.svg \ helpimg/sbasic/Call_statement.svg \ helpimg/sbasic/Close_statement.svg \ helpimg/sbasic/Const_statement.svg \ @@ -134,6 +135,7 @@ $(eval $(call gb_Package_add_files_with_dir,helpcontent2_html_media,$(LIBO_SHARE helpimg/sbasic/Input_statement.svg \ helpimg/sbasic/LetSet_statement.svg \ helpimg/sbasic/Line-Input_statement.svg \ + helpimg/sbasic/MkDir_statement.svg \ helpimg/sbasic/On-Error_statement.svg \ helpimg/sbasic/On-GoSub-GoTo_statement.svg \ helpimg/sbasic/Option_statement.svg \ @@ -146,11 +148,14 @@ $(eval $(call gb_Package_add_files_with_dir,helpcontent2_html_media,$(LIBO_SHARE helpimg/sbasic/ReDim_statement.svg \ helpimg/sbasic/Resume_statement.svg \ helpimg/sbasic/Reset_statement.svg \ + helpimg/sbasic/RmDir_statement.svg \ helpimg/sbasic/Seek_statement.svg \ helpimg/sbasic/Select-Case_statement.svg \ + helpimg/sbasic/Stop_statement.svg \ helpimg/sbasic/Sub_statement.svg \ helpimg/sbasic/Type_statement.svg \ helpimg/sbasic/While_statement.svg \ + helpimg/sbasic/With_statement.svg \ helpimg/sbasic/Write_statement.svg \ helpimg/scalc/coordinates-to-polar-01.svg \ helpimg/sdraw/control_points.png \ diff --git a/source/media/helpimg/sbasic/Beep_statement.svg b/source/media/helpimg/sbasic/Beep_statement.svg new file mode 100644 index 0000000000..61606af11a --- /dev/null +++ b/source/media/helpimg/sbasic/Beep_statement.svg @@ -0,0 +1,32 @@ + + + + +Beep \ No newline at end of file diff --git a/source/media/helpimg/sbasic/MkDir_statement.svg b/source/media/helpimg/sbasic/MkDir_statement.svg new file mode 100644 index 0000000000..bfd00fb105 --- /dev/null +++ b/source/media/helpimg/sbasic/MkDir_statement.svg @@ -0,0 +1,33 @@ + + + + +MkDir +path \ No newline at end of file diff --git a/source/media/helpimg/sbasic/RmDir_statement.svg b/source/media/helpimg/sbasic/RmDir_statement.svg new file mode 100644 index 0000000000..b9dc9bb4bb --- /dev/null +++ b/source/media/helpimg/sbasic/RmDir_statement.svg @@ -0,0 +1,33 @@ + + + + +RmDir +path \ No newline at end of file diff --git a/source/media/helpimg/sbasic/Stop_statement.svg b/source/media/helpimg/sbasic/Stop_statement.svg new file mode 100644 index 0000000000..fdf28325dd --- /dev/null +++ b/source/media/helpimg/sbasic/Stop_statement.svg @@ -0,0 +1,32 @@ + + + + +Stop \ No newline at end of file diff --git a/source/media/helpimg/sbasic/With_statement.svg b/source/media/helpimg/sbasic/With_statement.svg new file mode 100644 index 0000000000..9c0fabc88c --- /dev/null +++ b/source/media/helpimg/sbasic/With_statement.svg @@ -0,0 +1,35 @@ + + + + +With +object +statements +End With \ No newline at end of file diff --git a/source/text/sbasic/shared/03020411.xhp b/source/text/sbasic/shared/03020411.xhp index a13781fa79..2051628f20 100644 --- a/source/text/sbasic/shared/03020411.xhp +++ b/source/text/sbasic/shared/03020411.xhp @@ -34,68 +34,71 @@ -MkDir Statement +

MkDir Statement

+ + MkDir Statement diagram + Creates a new directory on a data medium. -Syntax: + -MkDir Text As String +MkDir path -Parameters: - Text: Any string expression that specifies the name and path of the directory to be created. You can also use URL notation. + + path: Any string expression that specifies the name and path of the directory to be created. You can also use URL notation. If the path is not determined, the directory is created in the current directory. -Example: + -Sub ExampleFileIO +Sub ExampleFileIO ' Example for functions of the file organization -Const sFile1 As String = "file://c|/autoexec.bat" -Const sDir1 As String = "file://c|/Temp" +Const sFile1 As String = "file://c|/autoexec.bat" +Const sDir1 As String = "file://c|/Temp" Const sSubDir1 As String ="Test" Const sFile2 As String = "Copied.tmp" Const sFile3 As String = "Renamed.tmp" -Dim sFile As String - sFile = sDir1 + "/" + sSubDir1 - ChDir( sDir1 ) +Dim sFile As String + sFile = sDir1 + "/" + sSubDir1 + ChDir( sDir1 ) If Dir(sSubDir1,16)="" Then ' Does the directory exist? - MkDir sSubDir1 + MkDir sSubDir1 MsgBox sFile,0,"Create directory" - End If - sFile = sFile + "/" + sFile2 - FileCopy sFile1 , sFile + End If + sFile = sFile + "/" + sFile2 + FileCopy sFile1 , sFile MsgBox fSysURL(CurDir()),0,"Current directory" MsgBox sFile & Chr(13) & FileDateTime( sFile ),0,"Creation time" MsgBox sFile & Chr(13)& FileLen( sFile ),0,"File length" MsgBox sFile & Chr(13)& GetAttr( sFile ),0,"File attributes" - Name sFile As sDir1 + "/" + sSubDir1 + "/" + sFile3 + Name sFile As sDir1 + "/" + sSubDir1 + "/" + sFile3 ' Rename in the same directory - sFile = sDir1 + "/" + sSubDir1 + "/" + sFile3 + sFile = sDir1 + "/" + sSubDir1 + "/" + sFile3 SetAttr( sFile, 0 ) 'Delete all attributes MsgBox sFile & Chr(13) & GetAttr( sFile ),0,"New file attributes" - Kill sFile - RmDir sDir1 + "/" + sSubDir1 -End Sub - + Kill sFile + RmDir sDir1 + "/" + sSubDir1 +End Sub + ' Converts a system path in URL -Function fSysURL( fSysFp As String ) As String -Dim iPos As String - iPos = 1 - iPos = Instr(iPos,fSysFp, getPathSeparator()) - Do While iPos > 0 - Mid( fSysFp, iPos , 1,"/") - iPos = Instr(iPos+1,fSysFp, getPathSeparator()) - Loop +Function fSysURL( fSysFp As String ) As String +Dim iPos As String + iPos = 1 + iPos = Instr(iPos,fSysFp, getPathSeparator()) + Do While iPos > 0 + Mid( fSysFp, iPos , 1,"/") + iPos = Instr(iPos+1,fSysFp, getPathSeparator()) + Loop ' the colon with DOS - iPos = Instr(1,fSysFp,":") - If iPos > 0 Then Mid( fSysFp, iPos , 1,"|") - fSysURL = "file://" & fSysFp -End Function + iPos = Instr(1,fSysFp,":") + If iPos > 0 Then Mid( fSysFp, iPos , 1,"|") + fSysURL = "file://" & fSysFp +End Function - + diff --git a/source/text/sbasic/shared/03020413.xhp b/source/text/sbasic/shared/03020413.xhp index 6ad7aed81a..7d38f2cc3e 100644 --- a/source/text/sbasic/shared/03020413.xhp +++ b/source/text/sbasic/shared/03020413.xhp @@ -27,30 +27,31 @@ -
RmDir statement - -RmDir Statement +

RmDir Statement

Deletes an existing directory from a data medium.
-Syntax: + + + RmDir Statement diagram + RmDir Text As String -Parameters: + Text: Any string expression that specifies the name and path of the directory that you want to delete. You can also use URL notation. If the path is not determined, the RmDir Statement searches for the directory that you want to delete in the current path. If it is not found there, an error message appears. -Example: + Sub ExampleRmDir MkDir "C:\Test2" @@ -60,6 +61,11 @@ RmDir "C:\test2" End Sub - + +
+ + +
+ \ No newline at end of file diff --git a/source/text/sbasic/shared/03090408.xhp b/source/text/sbasic/shared/03090408.xhp index d78fa9df04..8aefe030f5 100644 --- a/source/text/sbasic/shared/03090408.xhp +++ b/source/text/sbasic/shared/03090408.xhp @@ -32,23 +32,26 @@ Stop statement -Stop Statement +

Stop Statement

Stops the execution of the Basic program. -Syntax: + + + Stop Statement diagram + Stop -Example: + -Sub ExampleStop -Dim iVar As Single - iVar = 36 - Stop - MsgBox Sqr(iVar) -End Sub +Sub ExampleStop +Dim iVar As Single + iVar = 36 + Stop + MsgBox Sqr(iVar) +End Sub diff --git a/source/text/sbasic/shared/03090411.xhp b/source/text/sbasic/shared/03090411.xhp index 5d4c415965..cc789d4ced 100644 --- a/source/text/sbasic/shared/03090411.xhp +++ b/source/text/sbasic/shared/03090411.xhp @@ -29,20 +29,28 @@ +
With statement -With Statement -Sets an object as the default object. Unless another object name is declared, all properties and methods refer to the default object until the End With statement is reached. +

With Statement

+ Sets an object as the default object. Unless another object name is declared, all properties and methods refer to the default object until the End With statement is reached.
-Syntax: + + +With statement diagram - With Object - Statement block - End With + With object + [statements] + End With -Parameters: -Use With and End With if you have several properties or methods for a single object. - - + +Use With and End With if you have several properties or methods for a single object or an extended data type definition. +Nesting With statements helps writing and reading Basic routines. +
+ Type Statement +
+ + + \ No newline at end of file diff --git a/source/text/sbasic/shared/03130100.xhp b/source/text/sbasic/shared/03130100.xhp index 5db50f3a18..f8e90b2dd1 100644 --- a/source/text/sbasic/shared/03130100.xhp +++ b/source/text/sbasic/shared/03130100.xhp @@ -32,22 +32,27 @@
Beep statement -Beep Statement +

Beep Statement

Plays a tone through the computer's speaker. The tone is system-dependent and you cannot modify its volume or pitch.
-Syntax: + + + + Beep Statement diagram + Beep -Example: + + -Sub ExampleBeep - Beep - Beep - Beep -End Sub +Sub ExampleBeep + Beep + Beep + Beep +End Sub -- cgit