Simplicty and flexibility!


DataEase 8.5.0.2275 - Big DEOS Update Added DEOS function @zip, @unzip, @CopyDirectory, @CopyFile, @CreateDirectory, @DeleteDirectory, @DeleteFile, @DirectoryEmpty, @DirectoryExists, @FileExists, @BrowseForFile and @BrowseForFolder

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

DataEase 8.5.0.2275 - Big DEOS Update Added DEOS function @zip, @unzip, @CopyDirectory, @CopyFile, @CreateDirectory, @DeleteDirectory, @DeleteFile, @DirectoryEmpty, @DirectoryExists, @FileExists, @BrowseForFile and @BrowseForFolder

There has been a number of CDFs etc for dealing with finding files etc in DFW.

CDF's are well and good but important functions like this should be dealt  with by DataEase directly.

In 2275 we have included the following DEOS functions.

@BrowseForAppStringOpen a new item style dialog (Windows Vista and newer) and let you select a folder. If the folder contains DataEase applications the name of the application is shown. The default is to return the folder selected.
Parameters [Optional]
- [Start path] where to start to select file. The dialog remembers the last selection, so this parameter usually are left blank.
- [Return type] default is to return folder selected but you can use the following to override this:
@BrowseForAppFileStringOpen a new item style dialog (Windows Vista and newer) and let you select a repository file. If the folder contains DataEase applications the name of the application is shown. The default is to return the folder selected.
Parameters [Optional]
- [Type] now or old style rdrr file. Default is old style.
- [Start path] where to start to select file. The dialog remembers the last selection, so this parameter usually are left blank.
- [Return type] default is to return folder selected but you can use the following to override this:
@BrowseForFileStringOpen a new item style dialog and let you select a file. The file path is then returned.
Parameters [Optional]
- [Start path] where to start to select file. The dialog remembers the last selection, so this parameter usually are left blank.
- [Filter] what files to display in dialog. Default is All files (*.*)|*.* that will list all files. To set you own, use the format My description|*.ext;My other description|*.other Ex: DEOS("@BrowseForFile","Images (*.png)|*.png;All files|(*.*)")
- [Settings] no implemented yet. For future use
@BrowseForFolderStringOpen a new item style dialog and let you select a folder. The file path is then returned.
Parameters [Optional]
- [Start path] where to start to select folder. The dialog remembers the last selection, so this parameter usually are left blank.
- [Settings] no implemented yet. For future use
@CopyDirectoryNothingCopy a directory and all subdirectories to a new folder
Parameters
- from path
- to path
@CopyFileNothingCopy a file to a directory or over another file
Parameters
- file to cpoy
- path to copy to or file name to copy to
@CreateDirectoryNothingCreated a directory at given path.
Parameters
- path

Only creates the path if parent directory exists.
@DeleteDirectoryNothingDelete an empty directory or by adding second the files as well. Use with caution.
Parameters
- path to directory
- [allfiles=yes]

Ex. DEOS("@DeleteDirectory","C:\Users\Per\Documets\DataEaseApp","allfiles=yes") will remove all files and the directory without any warning.

As a precaution, the path has to be at least 10 chars long.
@DeleteFileNothingDelete a file
Parameters
- file path name
@DirectoryEmptyyes/noCheck if a directory with the given path is empty. Return yes if exists and empty and no for exists and not empty. Return blank if not exists.
Parameters
- path
@DirectoryExistsyes/noCheck if a directory with the given path exists. Return yes for exists and no for not exists.
Parameters
- path
@FileExistsyes/noChecks for a file. If the file exists, yes is returned and else no is returned. A directory named the same as the file given will return no. Use @DirectoryExists to check for directories.
Paramers
- File pah
@GetBrowsedAppNameStringReturns the application name returned by the previous call to @BrowseForApp.
@GetBrowsedAppPathStringReturns the folder returned by the previous call to @BrowseForApp.
@GetBrowsedAppVersionStringReturn a version identifier. The currently supported version is DfW 8.5, DfW 7, DfW 7, DfW6, DfD 5, DfD 4.5
@NewAppNothingLet you create an app by supplying Folder, Name, UserName, Password and App template as parameters. The application is opened after creating in a new DataEase instance. The Default template will be used if none given. To not use a template, use the template name "<none>".
@OpenAppNothingLet you open an app by supplying Folder, Name, [UserName], [Password] and [DefaultDoc] as parameters. The application is opened in a new DataEase instance.
@RenameAppStringLet you rename an application of any version (4.53DOS-8.5Win) by parameters:
- Path
- Old name
- New name

Return nothing if rename is done and the reason for not renaming if there was an error.
@SetBrowsedAppPathNothingSet the path used for reading application information. This can be used to get the @GetBrowsedAppName and @GetBrowsedAppVersion from a path without having to browse for the files using GUI.
@SetFileTimeNothingSet the file last changed time and date
Parameters
- file path
- string with date and time in the format used by DataEase at your location Ex. 17/03/2016 09:32:02 for UK

The date format uses the format set on your computer, but you can override this by using prefix if you want to use a hard coded time stamp. The supported prefix are:
ISO:YYYY/MM/DDThh:mm:ss Ex. ISO:2016/03/22T03:14:15
I:DD/MM/YYYY hh:mm:ss Ex. I:22/3/2016 3:14:15
M:YYYY/MM/DDThh:mm:ss Ex. M:2016/3/22 3:14:15
N:MM/DD/YYYY hh:mm:ss Ex. 3/22/2016 3:14:15
@UnzipNothing/
Error
Unzip a compressed file to a directory. If the catalog is not exists, it will be created.
Parameters
- Zip file
- Path to unzip to

Zip formats supported are zip. 7z, gzip, bzip2, rar, arj, tar, iso, cab, lzma, lzma86 and more. We supports all format the 7z decompressor supports.
Directory will only be created if parent directory exists.
@ZipNothing/
Error
Zip a directory and sub directory to a file.
Parameters
- Directory to zip
- Zip file name path

Zip formats supported for zipping is .zip, .7z, .bz2, .gz, .tar, .swm, .txz and more. We supports all the formats the 7z compressor supports and recognizes as file endings.

Written by DataEase 15/07/16 at 16:04:24 Dataease [{8}]FIVE
DG3_BlogList