Difference between revisions of "ReNamer:Pascal Script"

From den4b Wiki
Jump to navigation Jump to search
(reference sections added)
Line 1: Line 1:
This rule uses Delphi/Pascal programming syntax and conventions.
+
This rule uses Delphi/Pascal programming syntax and conventions.  
  
* Changes to the '''FileName''' variable will be treated as changes to the New Name of the File.
+
*Changes to the '''FileName''' variable will be treated as changes to the New Name of the File.  
* The '''FilePath''' constant holds the original path to the file, and provided for the direct file access.
+
*The '''FilePath''' constant holds the original path to the file, and provided for the direct file access.  
* Main code must be within the "'''begin'''" and "'''end.'''" keywords.
+
*Main code must be within the "'''begin'''" and "'''end.'''" keywords.  
* User defined procedures, functions, variables, constants and types are supported, as well as importing of external functions from DLLs.
+
*User defined procedures, functions, variables, constants and types are supported, as well as importing of external functions from DLLs.
  
All manipulations with the FileName variable should be done using Unicode functions, i.e. WideString type should be used instead of an ordinary String type.
+
All manipulations with the FileName variable should be done using Unicode functions, i.e. WideString type should be used instead of an ordinary String type.  
  
'''Warning:''' Do not override registered variables, [[ReNamer:Pascal Script:Types|types]] and [[ReNamer:Pascal Script:Functions|functions]]. Some of the functions able to alter your file system, so use those with caution!
+
'''Warning:''' Do not override registered variables, [[ReNamer:Pascal Script:Types|types]] and [[ReNamer:Pascal Script:Functions|functions]]. Some of the functions able to alter your file system, so use those with caution!  
  
== Reference ==
+
== Reference ==
  
* [[ReNamer:Pascal Script:Types|Types]]
+
*[[ReNamer:Pascal Script:Pascal Script quick guide|Pascal Script quick guide]]
* [[ReNamer:Pascal Script:Functions|Functions]]
+
*[[ReNamer:Pascal Script:Types|Types]]  
 +
*[[ReNamer:Pascal Script:Functions|Functions]]
  
== In a nutshell ==
+
== In a nutshell ==
  
# [[ReNamer:Pascal Script:FileName|FileName variable, or How to rename a file]]
+
#[[ReNamer:Pascal Script:FileName|FileName variable, or How to rename a file]]  
# [[ReNamer:Pascal Script:FileName Utilities|Basic FileName Utilities or How to skip extention]]
+
#[[ReNamer:Pascal Script:FileName Utilities|Basic FileName Utilities or How to skip extention]]  
# [[ReNamer:Pascal Script:WideUpperCase|WideUpperCase or How to uppercase the filename]]
+
#[[ReNamer:Pascal Script:WideUpperCase|WideUpperCase or How to uppercase the filename]]  
# [[ReNamer:Pascal Script:Unicode String Handling Routines|Unicode String Handling Routines or How to operate on words]]
+
#[[ReNamer:Pascal Script:Unicode String Handling Routines|Unicode String Handling Routines or How to operate on words]]  
# [[ReNamer:Pascal Script:Basic Conversion Routines|Basic Conversion Routines or How to serialize files]]
+
#[[ReNamer:Pascal Script:Basic Conversion Routines|Basic Conversion Routines or How to serialize files]]  
# [[ReNamer:Pascal Script:Initialization of variables|Initialization of variables]]
+
#[[ReNamer:Pascal Script:Initialization of variables|Initialization of variables]]  
# [[ReNamer:Pascal Script:Dialogs|Interactive dialogs or How to let user decide]]
+
#[[ReNamer:Pascal Script:Dialogs|Interactive dialogs or How to let user decide]]  
# [[ReNamer:Pascal Script:FilePath|FilePath and working with folders]]
+
#[[ReNamer:Pascal Script:FilePath|FilePath and working with folders]]  
# [[ReNamer:Pascal Script:Break script execution|How to break the script execution]]
+
#[[ReNamer:Pascal Script:Break script execution|How to break the script execution]]

Revision as of 17:58, 9 July 2009

This rule uses Delphi/Pascal programming syntax and conventions.

  • Changes to the FileName variable will be treated as changes to the New Name of the File.
  • The FilePath constant holds the original path to the file, and provided for the direct file access.
  • Main code must be within the "begin" and "end." keywords.
  • User defined procedures, functions, variables, constants and types are supported, as well as importing of external functions from DLLs.

All manipulations with the FileName variable should be done using Unicode functions, i.e. WideString type should be used instead of an ordinary String type.

Warning: Do not override registered variables, types and functions. Some of the functions able to alter your file system, so use those with caution!

Reference

In a nutshell

  1. FileName variable, or How to rename a file
  2. Basic FileName Utilities or How to skip extention
  3. WideUpperCase or How to uppercase the filename
  4. Unicode String Handling Routines or How to operate on words
  5. Basic Conversion Routines or How to serialize files
  6. Initialization of variables
  7. Interactive dialogs or How to let user decide
  8. FilePath and working with folders
  9. How to break the script execution