This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unit Roller; | |
{$G+} | |
Interface | |
Procedure ScrollLeft (X, Y, L, H : Word); | |
{ ‘¤¢¨£ ¥â ¨§®¡à ¦¥¨¥ ¢ ¯àאַ㣮«ì¨ª¥ ¢«¥¢® â®çªã 横«¨ç¥áª¨; /á } | |
Procedure ScrollRight (X, Y, L, H : Word); | |
{ ‘¤¢¨£ ¥â ¨§®¡à ¦¥¨¥ ¢ ¯àאַ㣮«ì¨ª¥ ¢¯à ¢® â®çªã 横«¨ç¥áª¨; /á } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ ------------------------------------------------------ | |
StringGrid als Excel Tabelle speichern (Hilfsfunktion) | |
------------------------------------------------------} | |
function RefToCell(ARow, ACol: Integer): string; | |
begin | |
Result := Chr(Ord('A') + ACol - 1) + IntToStr(ARow); | |
end; | |
{ -------------------------------------- | |
StringGrid als Excel Tabelle speichern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ Folgende Prozeduren speichern bzw. laden den Inhalt eines TStringGrid-Objekts.Das Vorgehen ist dabei folgendes: Mithilfe von StringList wird eine Textdatei angelegt, die in den ersten beiden Zeilen die Zeilenzahl (RowCount) und die Spaltenzahl (ColCount) beinhalten. Anschließend werden in einer Schleife alle Zeilen des StringGrids ausgelesen und in die Textdatei geschrieben. Beim Auslesen wird die Funktion Rows[i].CommaText verwendet, die den kompletten Zeileninhalt als einen String zurückgibt, in dem die einzelnen Spalten durch Komma getrennt sind.Prozedur zum Speichern (Parameter: Name des StringGrids und Name der Datei, in der der Inhalt gespeichert werden soll):} | |
{ ------------------------------------------------------------------- | |
StringGrid als CSV sichern beim Klick auf den Button | |
------------------------------------------------------------------- | |
Angelegt: 10.10.2022 | |
Author: Carsten | |
Geändert: | |
Hinweis: Die CSV wird nur in den Download-Ordner des aktuellen | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ ---------------------------------------------------------------------------- | |
Berechnung des Ostersonntags (und damit das Datum vieler anderer beweglichen | |
Feiertage) eines bestimmten Jahres berechnen kann. Ostern ist der 1. Sonntag | |
nach dem 1. Frühjahrsvollmond und kann deshalb frühestens am 22.3. eines | |
Jahres sein. | |
---------------------------------------------------------------------------- | |
Aufruf: Ostern(JJJJ) | |
Ergebnis: Genaues Datum des Ostersonntag | |
------------------------------------------------------------------------------} | |
function Ostern(AYear: Word): TDate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetFilesCount(Folder, WildCard: string): Integer; | |
var | |
intFound: Integer; | |
SearchRec: TSearchRec; | |
begin | |
Result := 0; | |
if (Folder <> '') and (Folder[Length(Folder)] <> '\') then | |
Folder := Folder + '\'; | |
intFound := FindFirst(Folder + WildCard, faAnyFile, SearchRec); | |
while (intFound = 0) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Unzipping is a much easier process and only requires the files to be copied from the zip file into the folder. | |
Sub UnzipAFile(zippedFileFullName As Variant, unzipToPath As Variant) | |
Dim ShellApp As Object | |
'Copy the files & folders from the zip into a folder | |
Set ShellApp = CreateObject("Shell.Application") | |
ShellApp.Namespace(unzipToPath).CopyHere ShellApp.Namespace(zippedFileFullName).items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Create a zip file from a folder | |
' This procedure has only a few steps: | |
' Create an empty zip file | |
' Copy the files from the folder into the zip file | |
' Wait for all the zip files to stop compressing | |
Sub CreateZipFile(folderToZipPath As Variant, zippedFileFullName As Variant) | |
Dim ShellApp As Object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub GetFileAttributes() | |
Dim myFile As String | |
myFile = "C:\Users\marks\Documents\Folder\ReadOnlyFile.xlsx" | |
'If the file is Read-Only, display message box | |
If (GetAttr(myFile) And vbReadOnly) <> 0 Then | |
MsgBox "The file is Read only" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' The following code deletes a specific file. | |
Sub DeleteSpecificFile() | |
'Delete a specific file | |
Kill "C:\Users\marks\Documents\Folder\DeleteMe.xlsx" | |
End Sub | |
' The code below deletes files using a wildcard. In this circumstance, it deletes all files with a .xlsx file extension. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub CopyAFile() | |
'Copy a file | |
FileCopy "C:\Users\marks\Documents\Folder\Original File.xlsx", _ | |
"C:\Users\marks\Documents\New Folder\Copied File.xlsx" | |
End Sub |
NewerOlder