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
DowName PROCEDURE(LONG pDate)!,STRING | |
CODE | |
RETURN CHOOSE( pDate % 7 + 1,'Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','???') |
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
MonthName PROCEDURE(LONG DateOrMonth),STRING !Pass Clarion Date or Month Number 1 to 12 - Month name from @d04 | |
MonthName2 PROCEDURE(LONG DateOrMonth),STRING !Pass Clarion Date or Month Number 1 to 12 - Month name English Only | |
MonthName PROCEDURE(LONG DateOrMonth)!,STRING | |
N STRING(32),AUTO | |
CODE | |
IF DateOrMonth <= 12 THEN | |
DateOrMonth=DATE(DateOrMonth,1,2000) | |
END | |
N=FORMAT(DateOrMonth,@d04) !Format Month ##, YYYY |
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 whethere File or Directory. These functions will check explicitly for File or Path. | |
MAP | |
FileExists(STRING FileName,<*LONG OutAttributes>),BOOL !Return 1 if FileName exists and is File not Directory | |
PathExists(STRING PathName,<*LONG OutAttributes>),BOOL !Return 1 if PathName exists and is Directory not File | |
ExistsFileOrPath(STRING FileOrPathName,<*LONG OutAttributes>),BYTE !Return 1=File 2=Path 0=N/A | |
MODULE('Win32') | |
GetFileAttributes(*CSTRING FileName),LONG,PASCAL,RAW,DLL(1),NAME('GetFileAttributesA') | |
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
#TEMPLATE (CBAltFix, 'Carl Barnes fix for Alt Key Lockup in Windows 7'),FAMILY('ABC','CW20') | |
#!=========================================================================== | |
#! Warning! Version 2 of the template changes things. | |
#! The Global template AltWin7Fix_Global has been removed and is no longer needed. | |
#! The Frame template AltWin7Fix_Frame has been renamed because it has new questions | |
#! Only the Frame Extension template is required, it is where you specify all choices. | |
#! It has a new name AltWin7Fix_Frame2 so you must populate it again on the Frame. | |
#! If you used the first version of the template you will get errors when you open | |
#! an APP. Ignore the errors, you should open the Frame, go to Extenstions and add the new template. | |
#! *** Removed ===>#EXTENSION (AltWin7Fix_Global,'Fix Windows 7 Alt Key Lockup-Global-by Carl Barnes'), APPLICATION |
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 | |
ParseTokenStringIntoQueue(CONST *STRING pString,STRING pToken,*QUEUE OutQueue,BYTE pBlanksOk=0),LONG,PROC !Return Count | |
END | |
ParseTokenStringIntoQueue PROCEDURE(CONST *STRING pString,STRING pToken,*QUEUE OutQueue,BYTE pBlanksOk=0)!,LONG,PROC !Return Count | |
SLen LONG,AUTO !pString Length | |
Ndx LONG,AUTO | |
TokenVal BYTE,AUTO !When hunting for chars I like VAL compares | |
BegPos LONG(1) !BegPos = 1 required to work right | |
EndPos LONG,AUTO !EndPos = 0 required to work right |
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 | |
SmashSpaces PROCEDURE(*string InOutText, BYTE Leave1Space=0) | |
MODULE('RTL') | |
LenFastClip PROCEDURE(CONST *STRING Text2Measure),LONG,NAME('Cla$FASTCLIP'),DLL(dll_mode) | |
!RTL has had this since at least C55. It is much faster because it passes *STRING and is CLIP and LEN in one call | |
END | |
END | |
SmashSpaces PROCEDURE (*string Txt, BYTE Leave1Spc=0) |
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 | |
Err4Msg PROCEDURE(Byte NoCRLF=0),STRING !Fromat ErrorCode() & Error() & FileError... for Message() Stop() Halt() or Log file (NoCRLF) | |
END | |
!----------------------------------------- | |
Err4Msg PROCEDURE(Byte NoCRLF=0)!,STRING | |
!Example: IF ERRORCODE() THEN STOP('Failed ADD(xxx)' & Err4Msg()). | |
!Note: Return starts '<13,10><13,10>Error Code:' so no need to put in the Message() | |
CODE | |
IF ~ERRORCODE() THEN RETURN ''. | |
IF ~NoCRLF THEN |
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
MODULE('RTL') | |
LenFastClip PROCEDURE(CONST *STRING Text2Measure),LONG,NAME('Cla$FASTCLIP'),DLL(dll_mode) | |
END | |
MODULE('RTL') | |
LenFastClip(CONST *STRING Text2Measure),LONG,NAME('Cla$FASTCLIP'),DLL(dll_mode) | |
END | |
!Use LenFastClip() or FastClip() instead of LEN(CLIP( string )) | |
!This has been around since at least C55. It runs much faster by passing *STRING. |