H
- How to do multiline title for button?
You should use some icon for this button or empty one at least (ICON:None). ... - How to fix single or more columns in ListBox?
See ListBox Properties. Use checkbox Fixed. ... - How to know in which control mouse cursor is (before ACCEPT)?
Use SELECTED. For additional check use FOCUS. This function returns number of control from which they just went away. Or number of current control if ... - How to make smooth scrolling of rows in LIST?
See below for an example: SmoothScrolling PROGRAM MAP END NameQueue QUEUE,PRE(NMQ) Name STRING(30) ... - How to use animated cursor in application?
! In Global MAP MODULE('') SetCapture(LONG),LONG,PASCAL ReleaseCapture(),LONG,PASCAL LoadCursor(LONG,*CSTRING),LONG,PASCAL,RAW,NAME('LoadCursorA') LoadCursorFromFile(*CSTRING),LONG,PASCAL,RAW,NAME('LoadCursorFromFileA') WinSetCursor(LONG),LONG,PASCAL,NAME('SetCursor') END ! Global variables m_hSysCursor LONG m_hAniCursor LONG m_CursorFileName CSTRING(65) ! After Window opening m_CursorFileName = 'globe.ani' m_hAniCursor = LoadCursorFromFile(m_CursorFileName) ! Display ... - How to reset a group of checkboxes on window?
LOOP CurrentField# = FIRSTFIELD() TO LASTFIELD() IF Window$CurrentField#{PROP:Type} = CREATE:Check IF Window$CurrentField#{PROP:Checked} = TRUE CHANGE(CurrentField#,FALSE) ... - How to create disabled window control that is not differ from normal control by sight?
Use API function: BOOL WINAPI SetSysColors( int cElements, // number of elements CONST INT ... - How to define type of window control?
Use this property PROP:Type. For example: IF ?Control{PROP:Type} = CREATE:Button ... END ... - How to know the equate name of the control at run-time?
You may use undocumented procedure: ClaFieldName(LONG),NAME('Cla$FieldName'),CSTRING,PROC As mention above function is undocumented you may use legally user template (EXTENSION) that generates queue like: ControlNameQueue QUEUE Feq ... - How to set variable name for data file in the dictionary?
To specify a variable name for the actual file name, place it in this field, and prefix the variable name with an exclamation point (!). ... - How to construct a complicated filter for database?
Use this embed point Validate record: Filter checking: IF <Some Filter Condition> ... any Clarion statements EXIT ... - How do I test the ending 2 characters of my datastream to the hex value of 1A0D?
Try: IF SUB(CLIP(Received),-2,2) = '<26,13>' ... END ... - How to jump quickly to the bottom of a file with no index and grab a value?
Use this code: SET(file) PREVIOUS(file) ... - How do I handle a error 47?
Error 47 indicates Invalid Record Declarion, i.e. data file declared in application and real disk file does not match. To fix this problem you must ... - How to convert data file to new structure?
If a file's definition needs to be changed and meaningful data exists, follow these steps to convert the file. This method creates an executable file ... - How to place single quote into string?
You must duplicate it ('') inside string or use code representation ('<39>'). ... - How correctly to return QUEUE from function and work with it in calling procedure?
No problem. If they return typified queue it is necessary to do something like this: MAP NewMembersList(),*TMembersQueue END TMembersQueue QUEUE,TYPE Name ... - How to construct a complicated filter for database?
Use this embed point Validate record: Filter checking: IF <Some Filter Condition> ... any Clarion statements EXIT ... - How to register user errors and errorcodes?
Below the example: LOCALE('CLAMSG1000','I am sick, user!') ... RTL::SetError(1000) ... MESSAGE(ERROR(),ERRORCODE()) ... - How to avoid this error in Clarion for DOS: Link Error: Group or Segclass exceeds 64 k?
You should break your code on some blocks and use routines for these blocks. ... - How to call function from DLL using LoadLibrary and GetProcAddress with condition that function may take parameters and return result?
MAP MODULE('RTL') LoadLibrary(STRING _cLibName),LONG,RAW, | NAME('Clw$LoadLibrary') GetProcAddr(LONG _LibHandle,STRING _cProcName),LONG,RAW,PASCAL, | NAME('GetProcAddress') END MODULE('') dll_CallProc(LONG _ProcAddr,LONG _Param1,*CSTRING _Param2),LONG, | NAME('dll_CallProc') END dll::ProcType(LONG _Param1,*CSTRING _Param2),LONG,RAW,PASCAL,TYPE CallProc(dll::ProcType _Proc,LONG _Param1,*CSTRING _Param2),LONG, | NAME('dll_CallProc') END csStr CSTRING(40) CODE hLib# = LoadLibrary('MYLIB.DLL<0>') IF hLib# ProcAddr# = GetProcAddr(hLib#,'MyFunc<0>') IF ... - How to correctly declare prototypes and accepting variable to return queue from function and work with it?
Hoping typed queue need must returned? MAP NewMembersList(),*TMembersQueue END TMembersQueue QUEUE,TYPE Name ... - How to "reload" main application frame?
Just use the following expression: CHAIN(COMMAND('0')) ... - How to get parameters of command line?
Use this operator COMMAND([flag]). The COMMAND procedure returns the value of the flag parameter from the command line If flag = 0 it returns the command itself. ... - How to check presense of file on disk?
Short example: OF_READ EQUATE(0000h) ! Allow read OF_WRITE EQUATE(0001h) ... - How to deny recurring run of application?
Most reliable method is using of named kernel object - event or mutex. Even if application hangs with GPF kernel will free such resource automatically. ... - How to prevent running of Application Wizard creating new application?
It is necessary to use ini-file of appropriate Clarion IDE. For example we will concern Enterprise versions, c5ee.ini for Clarion 5, c55ee.ini for Clarion C5.5, ... - How to change first calling procedure when application started?
Use menu Application -> Properties -> First Procedure. Change text Main to something what you need. ... - How to see fields of tables located in main DLL for specified debugged DLL in multi-dll projects?
It is necessary to re-compile DLL with database declarations in debug mode. And all those fields will be displyaed in Global data. ... - How to set variable name for data file in the dictionary?
To specify a variable name for the actual file name, place it in this field, and prefix the variable name with an exclamation point (!). ... - How to sort tables in dictionary alphabetically?
Use menu Setup -> Dictionary Options. See tab Table Options and check on Sort dictionary tables ... - How to display Property Box inside Embed Editor?
You need open cXXee.ini (for Enterprise version) or cXXpe.ini (for Professional version) in %ROOT% directory of Clarion and set the option to on, i.e. [editor] showfieldbox=on ... - How to copy and paste procedures from one application to another?
There are two variants: In the first application in main menu choose item File - Selective Export..., set name of TXA-file where necessary procedures will be ... - How to get unique identifier GUID?
PROGRAM MAP MODULE('winapi') CoCreateGuid(*?),UNSIGNED,PASCAL,RAW,DLL(1),NAME('CoCreateGuid') StringFromGUID2(*?,*?,LONG cchMax),UNSIGNED,PASCAL,RAW,NAME('StringFromGUID2') WideCharToMultiByte(UNSIGNED CodePage=0,USHORT dwFlags=0,| *? lpWideCharStr,LONG cchWideChar,*? lpMultiByteStr,| LONG cbMultiByte,? lpDefaultChar,| BYTE lpUsedDefaultChar), | UNSIGNED,PASCAL,RAW,NAME('WideCharToMultiByte') END END pGuid ... - How to get the number of the currently printed page?
It is impossible to catch the moment of completion of page printing. ... - How to receive the list of %Primary and %Secondary files, used in current procedure by all templates?
Below code: #FOR(%ACtiveTemplate) #FOR(%ACtiveTemplateInstance) #ADD(%FileList,%Primary) #FOR(%Secondary) #ADD(%FileList,%Secondary) #END #ENDFOR #ENDFOR #FOR(%OtherFiles) #ADD(%FileList,%OtherFiles) #ENDFOR ... - How it is possible to receive information about Prompt text from dictionary?
All necessary information is in %FieldScreenControl. For each field of file in dictionary this "list" contains strings from list "Window Controls" on tab "Window" of ... - How to make smooth scrolling of rows in LIST?
See below for an example: SmoothScrolling PROGRAM MAP END NameQueue QUEUE,PRE(NMQ) Name STRING(30) ... - How to use animated cursor in application?
! In Global MAP MODULE('') SetCapture(LONG),LONG,PASCAL ReleaseCapture(),LONG,PASCAL LoadCursor(LONG,*CSTRING),LONG,PASCAL,RAW,NAME('LoadCursorA') LoadCursorFromFile(*CSTRING),LONG,PASCAL,RAW,NAME('LoadCursorFromFileA') WinSetCursor(LONG),LONG,PASCAL,NAME('SetCursor') END ! Global variables m_hSysCursor LONG m_hAniCursor LONG m_CursorFileName CSTRING(65) ! After Window opening m_CursorFileName = 'globe.ani' m_hAniCursor = LoadCursorFromFile(m_CursorFileName) ! Display ... - How to display Property Box inside Embed Editor?
You need open cXXee.ini (for Enterprise version) or cXXpe.ini (for Professional version) in %ROOT% directory of Clarion and set the option to on, i.e. [editor] showfieldbox=on ... - How to "reload" main application frame?
Just use the following expression: CHAIN(COMMAND('0')) ... - How to know if user leave the application?
It will be usefull to know if application is in focus: hForWnd UNSIGNED ForThreadID ULONG ForProcessID ULONG CODE hForWnd = GetForegroundWindow() ForThreadID ... - How to run application that will not be displayed in task bar?
It is possible to hide application only under Windows 95/98. It should use function RegisterServiceProcess: ! MAP Section MAP MODULE('API') GetVersionEx(LONG),NAME('GetVersionExA'),SIGNED,PASCAL,PROC,RAW ... - How to define IP address of computer?
PROGRAM MAP MODULE('wsock32.dll') WSAStartup(SIGNED, *lpWSAData),SIGNED,RAW,PASCAL,NAME('WSAStartup') Inet_NToA(ULONG),ULONG,RAW,PASCAL,NAME('Inet_NToA') WSACleanup(),SIGNED,RAW,PASCAL,NAME('WSACleanUP') GetHostByName(*CSTRING),LONG,RAW,PASCAL,NAME('GetHostByName') GetHostName(*CSTRING,LONG),LONG,RAW,PASCAL,NAME('GetHostName') END END lpWSAData GROUP,TYPE wVersion ... - How to know current position of mouse cursor?
Do not offer MOUSEX.
MAP MODULE('api') GetCursorPos(ULONG _PointPtr),BYTE,PASCAL,PROC END END ! Data section TPoint GROUP,TYPE X ... - How to read from application environment variable?
You need use Windows API function GetEnvironmentVariable. Let see the example for reading of content %TEMP%: MAP MODULE('kernel32.lib') GetEnvironmentVariable(*CSTRING lpName,*CSTRING lpBuffer,ULONG nSize), | ... - How to call WinAPI functions from Clarion applications?
For the first time it is necessary to declare in MAP-section the prototype of WinAPI-function in terms of Clarion, i.e. to replace C-data types with ... - How to know if process run by ShellExecute had been terminated?
Below function realises the required task: RunJob FUNCTION(*CSTRING ProgramName,*CSTRING ... - How to get unique identifier GUID?
PROGRAM MAP MODULE('winapi') CoCreateGuid(*?),UNSIGNED,PASCAL,RAW,DLL(1),NAME('CoCreateGuid') StringFromGUID2(*?,*?,LONG cchMax),UNSIGNED,PASCAL,RAW,NAME('StringFromGUID2') WideCharToMultiByte(UNSIGNED CodePage=0,USHORT dwFlags=0,| *? lpWideCharStr,LONG cchWideChar,*? lpMultiByteStr,| LONG cbMultiByte,? lpDefaultChar,| BYTE lpUsedDefaultChar), | UNSIGNED,PASCAL,RAW,NAME('WideCharToMultiByte') END END pGuid ... - How to receive creation date and time of file?
If you need time of last modification use DIRECTORY. And if you need also time of creation or opening use API - FindFirst, FindNext. ... - How to create disabled window control that is not differ from normal control by sight?
Use API function: BOOL WINAPI SetSysColors( int cElements, // number of elements CONST INT ... - How to deny recurring run of application?
Most reliable method is using of named kernel object - event or mutex. Even if application hangs with GPF kernel will free such resource automatically. ...