From bd3e4888b2b47d022871218f210b290b7d046288 Mon Sep 17 00:00:00 2001 From: Rafael Lima Date: Thu, 13 May 2021 01:00:26 +0200 Subject: Related tdf#128784 X-ref ChDir, ChDrive and CurDir with SF_FileSystem The Basic functions ChDir, ChDrive and CurDir are DOS-specific and have limited functionality. Hence, it's important to introduce the FileSystem service (from ScriptForge) for users that wish to write scripts that need to handle folders and files. Change-Id: I33e24669083887b540cf44711ec5114e6ae5c521 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/115513 Tested-by: Jenkins Reviewed-by: Alain Romedenne --- source/text/sbasic/shared/03020000.xhp | 25 +++++++++++++++---------- source/text/sbasic/shared/03020401.xhp | 32 ++++++++++++++++++++------------ source/text/sbasic/shared/03020402.xhp | 17 +++++++++++------ source/text/sbasic/shared/03020403.xhp | 27 ++++++++++++++++----------- 4 files changed, 62 insertions(+), 39 deletions(-) (limited to 'source') diff --git a/source/text/sbasic/shared/03020000.xhp b/source/text/sbasic/shared/03020000.xhp index 38336c7fae..e036d774fb 100644 --- a/source/text/sbasic/shared/03020000.xhp +++ b/source/text/sbasic/shared/03020000.xhp @@ -18,25 +18,30 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - + - -File I/O Functions -/text/sbasic/shared/03020000.xhp - - -Sun Microsystems, Inc. - + + File I/O Functions + /text/sbasic/shared/03020000.xhp + + + Sun Microsystems, Inc. +
-File I/O Functions -Use File I/O functions to create and manage user-defined (data) files. + File I/O Functions + Use File I/O functions to create and manage user-defined (data) files.
You can use these functions to support the creation of "relative" files, so that you can save and reload certain records by specifying their record number. File I/O functions can also help you manage your files by providing you with information such as file size, current path settings, or the creation date of a file or a directory. + +
+ + +
diff --git a/source/text/sbasic/shared/03020401.xhp b/source/text/sbasic/shared/03020401.xhp index 220fb4d8d7..42f721d4d5 100644 --- a/source/text/sbasic/shared/03020401.xhp +++ b/source/text/sbasic/shared/03020401.xhp @@ -37,7 +37,11 @@
-Some DOS-specific file and directory functions are no longer provided in %PRODUCTNAME, or their function is only limited. For example, support for the ChDir, ChDrive and CurDir functions is not provided. Some DOS-specific properties are no longer used in functions that expect file properties as parameters (for example, to differentiate from concealed files and system files). This ensures the greatest possible level of platform independence for %PRODUCTNAME. Therefore this feature is subject to removal in a future release. + Some DOS-specific file and directory functions are no longer provided in %PRODUCTNAME, or their function is only limited. For example, support for the ChDir, ChDrive and CurDir functions is not provided. Some DOS-specific properties are no longer used in functions that expect file properties as parameters (for example, to differentiate from concealed files and system files). This ensures the greatest possible level of platform independence for %PRODUCTNAME. Therefore this feature is subject to removal in a future release. +
+ +
+ The ScriptForge library in %PRODUCTNAME 7.1 introduces the FileSystem service with methods to handle files and folders in user scripts.
@@ -51,19 +55,23 @@ - + -Sub ExampleChDir -Dim sDir1 As String , sDir2 As String - sDir1 = "c:\Test" - sDir2 = "d:\Private" - ChDir( sDir1 ) - MsgBox CurDir - ChDir( sDir2 ) - MsgBox CurDir -End Sub + Sub ExampleChDir + Dim sDir1 As String, sDir2 As String + sDir1 = "C:\Test" + sDir2 = "D:\Private" + ChDir( sDir1 ) + MsgBox CurDir + ChDir( sDir2 ) + MsgBox CurDir + End Sub - +
+ + +
+ diff --git a/source/text/sbasic/shared/03020402.xhp b/source/text/sbasic/shared/03020402.xhp index 59f89e0557..780f9e204c 100644 --- a/source/text/sbasic/shared/03020402.xhp +++ b/source/text/sbasic/shared/03020402.xhp @@ -36,10 +36,11 @@ Changes the current drive. + -ChDrive Text As String + ChDrive Text As String @@ -52,10 +53,14 @@ -Sub ExampleChDrive - ChDrive "D" ' Only possible if a drive 'D' exists. -End Sub + Sub ExampleChDrive + ChDrive "D" ' Only possible if a drive 'D' exists. + End Sub - - \ No newline at end of file +
+ + +
+ + diff --git a/source/text/sbasic/shared/03020403.xhp b/source/text/sbasic/shared/03020403.xhp index af7c1b381f..0929218d7c 100644 --- a/source/text/sbasic/shared/03020403.xhp +++ b/source/text/sbasic/shared/03020403.xhp @@ -36,6 +36,7 @@ Returns a variant string that represents the current path or that of the specified Windows drive. + @@ -48,7 +49,7 @@ Text: Any string expression that specifies an existing drive, for example "C" for the first partition of the first hard drive. This parameter is used solely under Windows. If no drive is specified or if the drive is a zero-length string (""), CurDir returns the path for the current drive. %PRODUCTNAME Basic reports an error if the syntax of the drive description is incorrect or if the drive does not exist. - + This function is not case-sensitive. @@ -58,16 +59,20 @@ -Sub ExampleCurDir -Dim sDir1 As String , sDir2 As String - sDir1 = "c:\Test" - sDir2 = "d:\Private" - ChDir( sDir1 ) - MsgBox CurDir - ChDir( sDir2 ) - MsgBox CurDir -End Sub + Sub ExampleCurDir + Dim sDir1 As String, sDir2 As String + sDir1 = "C:\Test" + sDir2 = "D:\Private" + ChDir( sDir1 ) + MsgBox CurDir + ChDir( sDir2 ) + MsgBox CurDir + End Sub +
+ + +
- \ No newline at end of file + -- cgit