Skip to content

Instantly share code, notes, and snippets.

@MarkGoldberg
MarkGoldberg / PictureNotation.txt
Last active February 12, 2019 15:32
Clarion - Proposed Picture Notation for Hex,Octal and Binary
It would be great to extend the picture notations to Support Hex, Binary and Octal Notations.
Ideally these new pictures would be available for use in the RTL and Topscan
The following specification is intended to match the current Language Reference for @N pictures
-----------------------------------------------------------------------------------------------
@[B|b|O|o|H|h] [currency] [sign] [fill] size [grouping] [places] [sign] [currency] [B]
Base
@[N|n] = Decimal - status quo, will not alter (see existing doc for @N)
@MarkGoldberg
MarkGoldberg / PartOf_ABFile.clw
Last active January 31, 2019 17:40
A refactored FileManager.EqualBuffer
FileManager.EqualBuffer PROCEDURE(*USHORT Id)
! Why *USHORT, Id is never altered, so why not pass by value ?
RetAreEqual BYTE(TRUE)
CODE
IF SELF.UseFile()<>Level:Benign ! Is this needed? Should a buffer compare require an open file?
OR SELF.BlobChanged ! A blob has changed so the buffers are unequal
THEN
RetAreEqual = FALSE
ELSIF SELF.FindBuffer( Id ) <> NoError
@MarkGoldberg
MarkGoldberg / FindFEQFromLabel.clw
Created September 6, 2018 00:11
Clarion - Find FEQ from LABEL using DBG.GetFEQDescr
WindowManagerEst.FindFEQFromLabel PROCEDURE(STRING Label, SIGNED xLowFEQ=-MAX:FEQ, SIGNED xHiFEQ=MAX:FEQ)
SearchFor &STRING
CurrFEQ FEQ
CREATE:_ComboButton EQUATE(CREATE:combo + 0100H) !see NG: Softvelocity.clarion.documentation Thread:"What is {prop:type}=271" Sept-18-2006
CODE
DO SetSearchFor
! ASSERT(0,eqDBG&'FindFEQFromLabel SearchFor['& SearchFor &']')
LOOP
CurrFEQ=SELF.MyWindow{PROP:NextField, CurrFEQ}
@MarkGoldberg
MarkGoldberg / gist:6a9fb3e50600b103c7ed5c51ce7004ba
Last active October 5, 2017 21:05
Enumerate Controls and Find Overlapping Controls
!! Note: I have not tried to compile this code... so it might have bugs
qtFEQs QUEUE,TYPE
FEQ SIGNED
END
gtXYWH_Signed GROUP,TYPE
X SIGNED
Y SIGNED
@MarkGoldberg
MarkGoldberg / ListOverEntries.clw
Last active October 2, 2017 16:43
Disable Obscured Field under a list, to solve focus grabbing bug.
! There is an apparent problem where click on a row on a list, is interpretted as a click on an obsucred field under the row.
! This proof of concept shows that DISABLING the control under the list, solves that problem
! Some extra complexity was added to correct tabbing around
! for some reason the EVENT:Selecting and EVENT:Selected are showing FIELD()=0 when MyListFEQ exists.
PROGRAM
MAP
END
@MarkGoldberg
MarkGoldberg / ThreadMonitor.clw
Created September 6, 2017 17:34
Clarion ThreadMonitor class - used to Notify a thread as each thread starts and ends
MEMBER
MAP
END
INCLUDE('ThreadMonitor.inc'),ONCE
eqDBG EQUATE('<4,2,7>')
MOD:ConstructEvent SIGNED
MOD:DestructEvent SIGNED
MOD:ThreadToInform SIGNED
! File Access Modes
OMIT('__FileAccessModes__',FileAccessMode:WriteOnly)
!FILE:ReadOnly EQUATE ( 0H)
!FILE:WriteOnly EQUATE ( 1H)
!FILE:ReadWrite EQUATE ( 2H)
!!-------------
!FILE:AnyAccess EQUATE ( 0H)
!FILE:DenyAll EQUATE (10H)
!FILE:DenyWrite EQUATE (20H)
@MarkGoldberg
MarkGoldberg / ShowQ.clw
Created August 16, 2017 16:18
Show ctQueue on ClarionLive Open Webinar 2017-Aug-16
PROGRAM
MAP
END
include('ctQueue.inc'),ONCE
!gtPoint GROUP,TYPE
!X REAL
@MarkGoldberg
MarkGoldberg / CenterAppModalWindow.CLW
Created June 7, 2017 12:52
Centering Application Modal Window
PROGRAM
MAP
MAIN()
BrahnModal()
NonMDIChild()
END
glo:Frame &Window
@MarkGoldberg
MarkGoldberg / WeekendDaysInRange.clw
Last active April 22, 2017 13:24
Function to return number of weekend days in a date range, written in Clarion for Windows
PROGRAM
Day ITEMIZE,PRE(Day)
Sunday EQUATE(0)
Monday EQUATE
Tuesday EQUATE
Wednesday EQUATE
Thursday EQUATE
Friday EQUATE
Saturday EQUATE