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
@REM This will backup the File Extensions listed below for ROBOCOPY to a subfolder | |
@REM then zip using PowerShell to a file named: ProjName_Date_Time.ZIP | |
@REM I place this BAT file in the Project folder named: _Bak_and_Zip_ProjBane.bat | |
@REM This backs up to a sub folder named _Bak_ under the project, some times I place this folder elsewhere | |
@REM This saves the CLW that allows for doing a code compare | |
@REM ----------------------------------------------------------------- | |
@echo off | |
for /f %%I in ('wmic os get localdatetime ^|find "20"') do set dt=%%I | |
REM dt format is now YYYYMMDDhhmmss... |
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
RemoveDirectoryFiles(STRING FolderPath,STRING Specs2Purge,LONG ShowWindow=0,<*LONG OutCountRemoved>),LONG,PROC ! Returns Error Cnt | |
DB(STRING DBString) !OutputDebugString wrapper DebugOutput.clw https://gist.github.com/CarlTBarnes/d3c7a3779b094f0ed48186d04a9b45e6 | |
MODULE('Win32') | |
DeleteFileA(*cstring lpFileName),BOOL,RAW,PROC,PASCAL,DLL(1) | |
GetLastError(),LONG,PASCAL,DLL(1) | |
END | |
!Specs2Purge can be multiple using semicolon e.g. *.tmp;*.$$$;*.xxx |
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
DateSplit PROCEDURE(LONG Date2Split, *? OutMonth, *? OutDay, *? OutYear) | |
!========================================================================================================== | |
DateSplit PROCEDURE(LONG D, *? OutMonth, *? OutDay, *? OutYear) | |
!This is much faster than calling MONTH() DAY() YEAR() | |
D1 DATE | |
DG GROUP, OVER(D1) | |
D BYTE | |
M BYTE | |
Y USHORT | |
END |
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
! Clarion EXISTS() returns True for File or Directory. | |
! Sometimes you need to know you have a Directory, or a File | |
!----------------------------------------------------------------------------------------------------- | |
MAP | |
ExistsDirectory PROCEDURE(STRING pDirName),BOOL !True if Directory and Not file | |
ExistsFile PROCEDURE(STRING pFileName),BOOL !True if File and Not Directory | |
MODULE('win32.lib') | |
GetFileAttributes(*CSTRING FileName),LONG,PASCAL,DLL(1),RAW,NAME('GetFileAttributesA') !Returns Attribs | |
END |
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
MAP | |
FileStripReadOnly PROCEDURE(string _filename),BOOL !True if Worked | |
MODULE('win32.lib') | |
SetFileAttributes(*CSTRING FileName,LONG NewFileAttribs),BOOL,PROC,PASCAL,DLL(1),RAW,NAME('SetFileAttributesA') | |
GetFileAttributes(*CSTRING FileName),LONG,PASCAL,DLL(1),RAW,NAME('GetFileAttributesA') !Returns Attribs | |
END | |
!-------------------------------------------------------- | |
FileStripReadOnly PROCEDURE(string _filename) !,BOOL | |
Attrs LONG,AUTO |
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
!Add local ReportPrint() | |
!Define: DbgString BYTE | |
! | |
!Change PRINT(Rpt:Detail) to ReportPrint(?Detail,'Rpt:Detail') | |
!If desired set DbgString=1 and each Band gets a String Label 'Rpt:Detail' | |
MAP | |
ReportPrint PROCEDURE(LONG BandFEQ, STRING BandName) | |
END | |
DbgString BYTE |
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
!DEP Policy Test by Carl Barnes released under the MIT License | |
!C11.13620 has a new Project DEP setting. This does NOT require 13620 | |
!You do NOT need the new 13620 DEP Project setting to turn on DEP, just call SetProcessDEPPolicy(1) | |
!You can add this procedure in your application to check DEP status at runtime on the end user machine. | |
!It probably should be wrapped in a simple CLASS. | |
! | |
!FYI - DEP sets the IMAGE_DLLCHARACTERISTICS_NX_COMPAT bit in the IMAGE_OPTIONAL_HEADER‘s DllCharacteristics. | |
!-------------------------------------------------------------------------------------- | |
!Must DEP be turned On in Both EXE and DLL projects? NO. Only the EXE the project. | |
! It is suggested to turn on DEP in the DLL as an FYI it works with DEP. |
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
!Use the POPUP('xxx', X, Y, 1=Relative) to position a POPUP() right under a Button so it appears to drop down | |
!The fourth parameter is not documented well. Pass 1 to indicate the X/Y are Relative so can use Clarion GetPosition() | |
! | |
!Replace existing Popup() placing the ?Control as the first parameter | |
!Example: OF ?MenuBtn ; CASE PopupUnder(?,'Copy|Delete') | |
!--------------------------------------- | |
MAP | |
PopupBeside(LONG BesideCtrlFEQ, STRING PopMenu),LONG | |
PopupUnder(LONG UnderCtrlFEQ, STRING PopMenu),LONG | |
PopupBeside PROCEDURE(LONG BesideCtrlFEQ, STRING PopMenu),LONG |
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
Tips: https://clarionhub.com/c/ide/tips/19 | |
IDE: https://clarionhub.com/c/ide/9 | |
Msbuild example for Clarion | |
https://clarionhub.com/t/msbuild-example-for-clarion/274/10 | |
FIXED statement in EXP for 4% smaller EXE without .reloc table | |
https://clarionhub.com/t/fixed-statement-in-exp-for-4-smaller-exe-without-reloc-table/3450/4 | |
How to successfully start the debugger from the command line? |
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
-- #################### Clarion110.RED #################### -- | |
-- Project Redirection for Clarion 11.0 to Copy the Clarion10\Bin\Debug DLLs only for Debug builds | |
-- This RED has a [Copy] *.dll = %BIN%\debug | |
{include clarion_DebugDllCopy.red} | |
-- this includes the normal RED -- | |
{include %REDDIR%\%REDNAME%} | |
-- review: https://clarionhub.com/t/how-to-improve-the-call-stack-when-your-program-gpfs/188 |