Skip to content

Instantly share code, notes, and snippets.

Mark Goldberg MarkGoldberg

Block or report user

Report or block MarkGoldberg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MarkGoldberg
MarkGoldberg / Dispose from a base class
Last active Mar 6, 2017
Clarion - test of using an interface to call into a derived class from a reference to it's parent
View Dispose from a base class
PROGRAM
MAP
END
include('debuger.inc'),ONCE
DBG debuger
iGoAway INTERFACE
GoAway PROCEDURE
END
@MarkGoldberg
MarkGoldberg / API_CommonDialog.inc
Created Nov 3, 2016
GetSaveFileName API wrapped for Clarion for Windows
View API_CommonDialog.inc
compile('***',_WIDTH32_)
ANSI EQUATE('A')
***
omit ('***',_WIDTH32_)
ANSI EQUATE('')
***
!-Rely On Once due to IDE Navigation Bugs-! omit('*** ifdef API_CommonDialog ***',ifDef_API_CommonDialog)
@MarkGoldberg
MarkGoldberg / ConfigureForMultipleWriters.bat
Created Sep 21, 2016
Claron - Set OpLocks (For TopSpeed files)
View ConfigureForMultipleWriters.bat
:: this batch file, created: by mark@tradesmens.com on Jan/19/2011
::
:: see http://support.microsoft.com/kb/296264
:: see http://www.dataaccess.com/whitepapers/opportunlockingreadcaching.html#Making_Windows_Registry_Changes
::
@echo You are about to configure your machine for Multi-user simulataneous sharing of files:
@echo\
@echo\
::
:: 0123456789 123
@MarkGoldberg
MarkGoldberg / FrameWndProc.clw
Last active Aug 22, 2016
Clarion Frame WndProc to detect frame gain/loss of focus
View FrameWndProc.clw
FRAME_WndProc Procedure(HWND arghwnd, UINT argmessage, WPARAM argwParam, LPARAM arglParam) !LRESULT,PASCAL
_WM_ACTIVATEAPP EQUATE(28)
RetVal LRESULT
CODE
CASE argMessage
OF _WM_ACTIVATEAPP ; IF argWParam
oGlo.OnGainFocus()
ELSE oGlo.OnLoseFocus()
END
@MarkGoldberg
MarkGoldberg / SpellNumber.clw
Created May 26, 2016
Convert a number to English, much like you'd see on a check
View SpellNumber.clw
!===========================================================================================
SpellNum PROCEDURE(REAL pInputNum)!,STRING
!Region Documentation
! ============================================================
! Purpose : Spell out a number
! Assume Dollars and Cents
! ex: 63.46 -> Sixty Three Dollars and 46 Cents
! Assume American System of Numbers
! I`ve read that 10^9 is Milliard not Billion in the British System of Numbers
! I`ve read that trillion in the British System is 10^18 not 10^12
View CompareTimeSpan.clw
!NOTE should be worked into https://github.com/MarkGoldberg/CwUnit/blob/master/Libsrc/ctDateTimeLong.inc
gtDateTime GROUP,TYPE
_Date DATE
_Time TIME
END
@MarkGoldberg
MarkGoldberg / TestDragAndDrop.clw
Created May 20, 2016
Clarion Drag and Drop Example
View TestDragAndDrop.clw
TestDragAndDrop PROGRAM
MAP
Frame
DragFrom
DragTo
END
! Note: if you don't have debuger.inc then just rem all lines using DBG -- it's just for sending event info to OutputDebugString
! which you can view with DebugView++ or DbgView
@MarkGoldberg
MarkGoldberg / ControlMinMaxButtons.clw
Last active May 11, 2016
Clarion - Control Min/Max Buttons
View ControlMinMaxButtons.clw
PROGRAM
MAP
Child
Child2
Child3
END
AppFrame APPLICATION('Application'),AT(,,505,318),CENTER,MASK,SYSTEM,MAX,ICON('WAFRAME.ICO'),STATUS(-1,80,120,45),FONT('Microsoft Sans Serif',8,,FONT:regular),RESIZE
MENUBAR,USE(?Menubar)
ITEM('Child'),USE(?child)
@MarkGoldberg
MarkGoldberg / ctAPIColor.clw
Last active Jan 19, 2016
Clarion Frame Background Color
View ctAPIColor.clw
MEMBER
! http://www.odata.de/Clarion/colored_background_for_appframe
! the above from Wolfgang Orth says this code was from Jim Gambon on the newsgroups
! that sounds right, but somehow I forgot to give credit in the class. (blush)
MAP
MODULE('Win32API')
GetClassLong (LONG _hWnd,LONG _Index ),LONG, PASCAL,NAME('GetClassLongA')
SetClassLong (LONG _hWnd,LONG _Index,LONG NewValue),LONG,PROC,PASCAL,NAME('SetClassLongA')
View CorrectControls.clw
!Below is a simplified version of code that I call after opening every window
MOD:LineHeight LONG(9)
CorrectControls PROCEDURE(*Window xWin)
CurrFEQ SIGNED !No Auto
IsFrame BOOL,AUTO
CODE
IsFrame = CHOOSE( xWin{PROP:Type} = CREATE:application )
You can’t perform that action at this time.