Variables do not need to be declared first but you must declare (or initialize) a variable if it is first set in the parameters on a call to a function or sub-routine.When calling functions or sub-routines that have no parameters, don't use empty brackets, e.g.:.Sub RunAfterConfig(constvar1, var variablevar2) - This is correct Sub RunAfterConfig(constvar1, variablevar2) - This is wrong When declaring functions or sub-routines, and there are variable arguments (non-constant), then prefix them with var, e.g.When declaring functions or sub-routines, and there are no arguments, then don't use brackets, e.g.You must use brackets with calls to sub-routines that have arguments (just as you must already do with functions).If not SBLocation.AddDirEx2(SubFol.Name, SubFol.Attributes, SubFol.DateLastModified, SubFol.DateCreated, '') then While FoldersEnum.ForEach(SubFol) do begin Instead you must use TEnumVariant.Create, e.g.:įoldersEnum:=TEnumVariant.Create(Folder.SubFolders)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |