# code

**URL:** https://clarionhub.com/c/code/11.md?page=1

[Latest](https://clarionhub.com/latest.md) · [Categories](https://clarionhub.com/categories.md) · [Tags](https://clarionhub.com/tags.md)

**Page:** 2

---

## [GUID (Microsoft COM UUID Mixed-Endian) constants in Clarion](https://clarionhub.com/t/guid-microsoft-com-uuid-mixed-endian-constants-in-clarion/8093)

<div class="topic-metadata">

**Author:** [@CarlosGtrz](https://clarionhub.com/u/CarlosGtrz)\
**Replies:** 1\
**Last updated:** [April 14, 2025, 12:17pm UTC](https://clarionhub.com/t/guid-microsoft-com-uuid-mixed-endian-constants-in-clarion/8093 "2025-04-14T12:17:55Z")

</div>

Some times I wondered why SV's definition for GUIDs is structured as a group like this: GUID group, type Data1 long Data2 short Data3 short D…

---

## [Ripe for some re-factoring, a sample program](https://clarionhub.com/t/ripe-for-some-re-factoring-a-sample-program/8021)

<div class="topic-metadata">

**Author:** [@jslarve](https://clarionhub.com/u/jslarve)\
**Replies:** 14\
**Last updated:** [March 25, 2025, 4:42pm UTC](https://clarionhub.com/t/ripe-for-some-re-factoring-a-sample-program/8021 "2025-03-25T16:42:27Z")

</div>

This is a program, where I slapped some ideas together from classes that I created over the years. The classes are of varying levels of completion, and different coding styles. If nobody beats me to it, maybe I'll spend…

---

## [Example of Passing Window and List References to Another Thread](https://clarionhub.com/t/example-of-passing-window-and-list-references-to-another-thread/8000)

<div class="topic-metadata">

**Author:** [@donridley](https://clarionhub.com/u/donridley)\
**Replies:** 10\
**Last updated:** [March 17, 2025, 3:41pm UTC](https://clarionhub.com/t/example-of-passing-window-and-list-references-to-another-thread/8000 "2025-03-17T15:41:52Z")

</div>

Special thank you to Mark Goldberg! I wanted to know how to pass a reference to a LIST control to another thread. I wanted to access the List's properties in the new thread. For example, the maximum number of columns …

---

## [Simple ChatGPT example using Capesoft templates](https://clarionhub.com/t/simple-chatgpt-example-using-capesoft-templates/6488)

<div class="topic-metadata">

**Author:** [@SerhatSatir](https://clarionhub.com/u/SerhatSatir)\
**Replies:** 19\
**Last updated:** [February 23, 2025, 6:58am UTC](https://clarionhub.com/t/simple-chatgpt-example-using-capesoft-templates/6488 "2025-02-23T06:58:05Z")

</div>

You can communicate with ChatGPT using this Clarion code and integrate it into your software. However, please remember that the application requires Nettalk and StringTheory templates developed by Capesoft to function pr…

---

## [Class Composition over Inheritance](https://clarionhub.com/t/class-composition-over-inheritance/7841)

<div class="topic-metadata">

**Author:** [@fred](https://clarionhub.com/u/fred)\
**Replies:** 6\
**Last updated:** [January 16, 2025, 11:00pm UTC](https://clarionhub.com/t/class-composition-over-inheritance/7841 "2025-01-16T23:00:05Z")

</div>

We use class compositioning a lot! Typically a class (let’s call it TOPCLASS) would use a few other (often smaller) classes to do it’s stuff. So TOPCLASS is actually - in a sense - “derived” from multiple other classes…

---

## [Little tip for dates and datetimes](https://clarionhub.com/t/little-tip-for-dates-and-datetimes/7628)

<div class="topic-metadata">

**Author:** [@JonW](https://clarionhub.com/u/JonW)\
**Replies:** 7\
**Last updated:** [November 1, 2024, 2:10pm UTC](https://clarionhub.com/t/little-tip-for-dates-and-datetimes/7628 "2024-11-01T14:10:13Z")

</div>

Just a little hint if you deal with SQL databases that have datetime data types (like Oracle). If you import these into the dictionary, Clarion will add them as the clunky: dt string(8) dt\_group, over(dt) dt\_date date …

---

## [UUID v7 - Universally Unique Lexicographically Sortable Identifier (ULID)](https://clarionhub.com/t/uuid-v7-universally-unique-lexicographically-sortable-identifier-ulid/7417)

<div class="topic-metadata">

**Author:** [@Gustavo\_Saracca](https://clarionhub.com/u/Gustavo_Saracca)\
**Replies:** 10\
**Last updated:** [September 4, 2024, 4:48am UTC](https://clarionhub.com/t/uuid-v7-universally-unique-lexicographically-sortable-identifier-ulid/7417 "2024-09-04T04:48:00Z")

</div>

This simple library is an approach to the ULID defined in RFC4122, allowing the generation of time-ordered UUIDs. The code is written in pure Clarion and has been tested in C10. While implementations using (today() and …

---

## [Using EXPORT in classes](https://clarionhub.com/t/using-export-in-classes/7413)

<div class="topic-metadata">

**Author:** [@CarlosGtrz](https://clarionhub.com/u/CarlosGtrz)\
**Replies:** 3\
**Last updated:** [August 25, 2024, 5:43pm UTC](https://clarionhub.com/t/using-export-in-classes/7413 "2024-08-25T17:43:47Z")

</div>

I have a few classes with complex business rules and processes, but I’ve just been INCLUDEing them wherever I needed, resulting in their code being compiled in all the dlls. After some unexpected behavior caused by thi…

---

## [Extension methods: Adding methods to classes without deriving (with a simple StringTheory example)](https://clarionhub.com/t/extension-methods-adding-methods-to-classes-without-deriving-with-a-simple-stringtheory-example/7389)

<div class="topic-metadata">

**Author:** [@CarlosGtrz](https://clarionhub.com/u/CarlosGtrz)\
**Replies:** 1\
**Last updated:** [August 11, 2024, 9:46pm UTC](https://clarionhub.com/t/extension-methods-adding-methods-to-classes-without-deriving-with-a-simple-stringtheory-example/7389 "2024-08-11T21:46:33Z")

</div>

While coding a recent project I wrote something like this to call StringTheory to Append a Value with a ' ' Space Separator before the Value: st.Append(ValueOne,st:clip,' ') st.Append(ValueTwo,st:clip,' ') st.Append(Val…

---

## [WPF (Xaml) in WinForms in Clarion](https://clarionhub.com/t/wpf-xaml-in-winforms-in-clarion/7123)

<div class="topic-metadata">

**Author:** [@donridley](https://clarionhub.com/u/donridley)\
**Replies:** 1\
**Last updated:** [April 25, 2024, 5:39am UTC](https://clarionhub.com/t/wpf-xaml-in-winforms-in-clarion/7123 "2024-04-25T05:39:13Z")

</div>

I was curious if this was possible...

---

## [Template for generating Column and Group equates for ABC browse](https://clarionhub.com/t/template-for-generating-column-and-group-equates-for-abc-browse/3930)

<div class="topic-metadata">

**Author:** [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Replies:** 1\
**Last updated:** [April 23, 2024, 2:39pm UTC](https://clarionhub.com/t/template-for-generating-column-and-group-equates-for-abc-browse/3930 "2024-04-23T14:39:37Z")

</div>

I took Rick's template for Generating Column Equates and added Equates for LIST Groups. Everything Rick said applies to Groups also. Instead of using hard-coded numeric constants for column numbers in code for manipula…

---

## [How to Remove the BORDER of a LIST control](https://clarionhub.com/t/how-to-remove-the-border-of-a-list-control/292)

<div class="topic-metadata">

**Author:** [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Replies:** 4\
**Last updated:** [April 12, 2024, 5:16pm UTC](https://clarionhub.com/t/how-to-remove-the-border-of-a-list-control/292 "2024-04-12T17:16:21Z")

</div>

Below is a small testbed program to remove the border around a LIST control The hard work of figuring out which API calls to make was done by Dave Bratovich PROGRAM INCLUDE('svapi.INC'),ONCE MAP include('svapif…

---

## [Convert Clarion Standard Time to SQL Time or SQL Time to Clarion Time](https://clarionhub.com/t/convert-clarion-standard-time-to-sql-time-or-sql-time-to-clarion-time/1281)

<div class="topic-metadata">

**Author:** [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Replies:** 2\
**Last updated:** [April 1, 2024, 4:43pm UTC](https://clarionhub.com/t/convert-clarion-standard-time-to-sql-time-or-sql-time-to-clarion-time/1281 "2024-04-01T16:43:45Z")

</div>

If you have an INT data type in your SQL database that hold a Clarion Time value you can convert it to SQL Time using this snippet: select convert(time, dateadd(ms, (ClarionTimeField-1)\*10,0)) or to get a text format t…

---

## [MS Control Flow Guard Exploit protection](https://clarionhub.com/t/ms-control-flow-guard-exploit-protection/4985)

<div class="topic-metadata">

**Author:** [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Replies:** 1\
**Last updated:** [March 19, 2024, 6:08am UTC](https://clarionhub.com/t/ms-control-flow-guard-exploit-protection/4985 "2024-03-19T06:08:34Z")

</div>

So Windows has exposed a number of different options to mitigate security vulnerabilities. I’ve found the paper that looks at one of these which is called Control Flow Guard. TL;DR its a general term for computer secur…

---

## [Some information about WSLDIAL Errors](https://clarionhub.com/t/some-information-about-wsldial-errors/33)

<div class="topic-metadata">

**Author:** [@brahn](https://clarionhub.com/u/brahn)\
**Replies:** 6\
**Last updated:** [February 21, 2024, 11:32pm UTC](https://clarionhub.com/t/some-information-about-wsldial-errors/33 "2024-02-21T23:32:05Z")

</div>

The following has been compiled from various responses to questions in the clarion newsgroups. Authors have been mentioned where possible. Occasionally while using clarion you may get a runtime error mentioning WSLDIA…

---

## [Dead simple Clarion Stopwatch Class](https://clarionhub.com/t/dead-simple-clarion-stopwatch-class/298)

<div class="topic-metadata">

**Author:** [@brahn](https://clarionhub.com/u/brahn)\
**Replies:** 6\
**Last updated:** [February 8, 2024, 1:19am UTC](https://clarionhub.com/t/dead-simple-clarion-stopwatch-class/298 "2024-02-08T01:19:04Z")

</div>

Something I needed today but didn’t have. Based on the .NET Stopwatch Class but only using the precision of Clarion Clock() and Today() Implemented: Start StartNew Stop Reset Restart Elapsed ToString PROGRAM I…

---

## [Using WriteConsoleA from a Clarion application](https://clarionhub.com/t/using-writeconsolea-from-a-clarion-application/1734)

<div class="topic-metadata">

**Author:** [@brahn](https://clarionhub.com/u/brahn)\
**Replies:** 9\
**Last updated:** [February 1, 2024, 11:12pm UTC](https://clarionhub.com/t/using-writeconsolea-from-a-clarion-application/1734 "2024-02-01T23:12:19Z")

</div>

Today I was inspired to respond to a StackOverflow question and pulled this example together from pieces I found on the newsgroup :slight\_smile: Compile the program, run it from a command line and mash the button! …

---

## [Data Scrambler Class & Demo](https://clarionhub.com/t/data-scrambler-class-demo/5561)

<div class="topic-metadata">

**Author:** [@jslarve](https://clarionhub.com/u/jslarve)\
**Replies:** 7\
**Last updated:** [November 21, 2023, 1:05am UTC](https://clarionhub.com/t/data-scrambler-class-demo/5561 "2023-11-21T01:05:08Z")

</div>

I pushed a new repo to Github, for scrambling data. The demo requires C10 or higher, but some of the earlier C10 versions might not be able to compile it because of the differences in SystemStringClass over the course o…

---

## [The new function pointers in Clarion using Start()](https://clarionhub.com/t/the-new-function-pointers-in-clarion-using-start/3858)

<div class="topic-metadata">

**Author:** [@anon51095673](https://clarionhub.com/u/anon51095673)\
**Replies:** 19\
**Last updated:** [November 19, 2023, 5:17am UTC](https://clarionhub.com/t/the-new-function-pointers-in-clarion-using-start/3858 "2023-11-19T05:17:53Z")

</div>

! Calling MDI windows. Next to try is using start with an address of a function pointer. PMDITypeInvoke PROCEDURE(funcptr funcptrref,\*IWindowDisplay MDIRef ) areturntype LONG CODE funcptrref(MDIRef,aretu…

---

## [Find blocked and blocking sessions in MSSQL](https://clarionhub.com/t/find-blocked-and-blocking-sessions-in-mssql/6741)

<div class="topic-metadata">

**Author:** [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Replies:** 2\
**Last updated:** [November 2, 2023, 6:44pm UTC](https://clarionhub.com/t/find-blocked-and-blocking-sessions-in-mssql/6741 "2023-11-02T18:44:36Z")

</div>

Here are a couple of queries i use extensively while tracking down blocking issues in SQL server. This query shows all the lead blockers. A lead blocker is a session that is blocking other sessions but is not being bloc…

---

## [Updated my CSVParserClass](https://clarionhub.com/t/updated-my-csvparserclass/4143)

<div class="topic-metadata">

**Author:** [@jslarve](https://clarionhub.com/u/jslarve)\
**Replies:** 4\
**Last updated:** [October 7, 2023, 4:08pm UTC](https://clarionhub.com/t/updated-my-csvparserclass/4143 "2023-10-07T16:08:52Z")

</div>

I made a few improvements to my CSV Parser Class. It now auto-detects column separators & line endings (at least the non-exotic ones) Added a reload button to the demo app (which isn't as important, now that autodetect…

---

## [Old School Parsing of a file name and path for validation](https://clarionhub.com/t/old-school-parsing-of-a-file-name-and-path-for-validation/6611)

<div class="topic-metadata">

**Author:** [@Owen](https://clarionhub.com/u/Owen)\
**Replies:** 26\
**Last updated:** [September 28, 2023, 1:00pm UTC](https://clarionhub.com/t/old-school-parsing-of-a-file-name-and-path-for-validation/6611 "2023-09-28T13:00:45Z")

</div>

PROGRAM MAP IsValidFilePath FUNCTION(\*STRING pFilePath, \<\*STRING DeviceName\>, \<\*STRING PathName\>, \<\*STRING FileName\>, \<\*STRING ExtensionName\>),BOOL Main PROCEDURE() END …

---

## [Function to create a GUID](https://clarionhub.com/t/function-to-create-a-guid/6580)

<div class="topic-metadata">

**Author:** [@JonW](https://clarionhub.com/u/JonW)\
**Replies:** 6\
**Last updated:** [September 11, 2023, 11:39am UTC](https://clarionhub.com/t/function-to-create-a-guid/6580 "2023-09-11T11:39:15Z")

</div>

With Acknowledgements to Randy Rogers and Graham Dawson, here's how to add a function to create GUIDs to your app. Use LibMaker to create a .lib file for rpcrt4.lib, which you will find in Windows\\SYSWOW64 Add rpcr…

---

## [Creating custom-limited droplists: an example](https://clarionhub.com/t/creating-custom-limited-droplists-an-example/6339)

<div class="topic-metadata">

**Author:** [@JonW](https://clarionhub.com/u/JonW)\
**Replies:** 0\
**Last updated:** [June 21, 2023, 4:25pm UTC](https://clarionhub.com/t/creating-custom-limited-droplists-an-example/6339 "2023-06-21T16:25:09Z")

</div>

Attached to this post is a little demonstration of how to provide customized dropdown lists. A common requirement is that a dropdown list needs to be limited based on a previous choice on a form. Sometimes that previous…

---

## [Using GitHub actions to generate and build a clarion development repository](https://clarionhub.com/t/using-github-actions-to-generate-and-build-a-clarion-development-repository/6277)

<div class="topic-metadata">

**Author:** [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Replies:** 5\
**Last updated:** [June 1, 2023, 8:53am UTC](https://clarionhub.com/t/using-github-actions-to-generate-and-build-a-clarion-development-repository/6277 "2023-06-01T08:53:10Z")

</div>

I have spent a long weekend "playing" with GitHub actions to help me create a CI build pipeline for a simple clarion application. I am now able to, with the help of tools like @Rick\_UpperPark Version control (Order page…

---

## [How To: Use DllImport from C# to call a clarion procedure](https://clarionhub.com/t/how-to-use-dllimport-from-c-to-call-a-clarion-procedure/1104)

<div class="topic-metadata">

**Author:** [@brahn](https://clarionhub.com/u/brahn)\
**Replies:** 5\
**Last updated:** [May 25, 2023, 6:50pm UTC](https://clarionhub.com/t/how-to-use-dllimport-from-c-to-call-a-clarion-procedure/1104 "2023-05-25T18:50:16Z")

</div>

Just for fun, can we call into ClaRun directly from C#? Why yes, we can! :slight\_smile: using System; using System.Runtime.InteropServices; namespace ClarionDllImport { class Program { static void Main…

---

## [Runtime Dynamic Data Structures in Clarion](https://clarionhub.com/t/runtime-dynamic-data-structures-in-clarion/6063)

<div class="topic-metadata">

**Author:** [@anon51095673](https://clarionhub.com/u/anon51095673)\
**Replies:** 5\
**Last updated:** [April 20, 2023, 6:11am UTC](https://clarionhub.com/t/runtime-dynamic-data-structures-in-clarion/6063 "2023-04-20T06:11:04Z")

</div>

Dynamic SQL Query Example of accessing the Northwind database file via ODBC with No declared File structure or Queue.

---

## [Explanation of System Colors](https://clarionhub.com/t/explanation-of-system-colors/6132)

<div class="topic-metadata">

**Author:** [@jslarve](https://clarionhub.com/u/jslarve)\
**Replies:** 1\
**Last updated:** [April 8, 2023, 7:53pm UTC](https://clarionhub.com/t/explanation-of-system-colors/6132 "2023-04-08T19:53:20Z")

</div>

I pushed a small demo program to explain how system colors work in Clarion.

---

## [Dynamic Data structures in Clarion using DynaLib](https://clarionhub.com/t/dynamic-data-structures-in-clarion-using-dynalib/3908)

<div class="topic-metadata">

**Author:** [@anon51095673](https://clarionhub.com/u/anon51095673)\
**Replies:** 19\
**Last updated:** [March 21, 2023, 7:50am UTC](https://clarionhub.com/t/dynamic-data-structures-in-clarion-using-dynalib/3908 "2023-03-21T07:50:00Z")

</div>

Ok up till now we havnt had time or the knowledge of runtime data structures in the clarion runtime. With a quite winter and summer we have had a little time to look at the work of the russian in the early days of clar…

---

## [How to detect if an OutputDebugString viewer is running](https://clarionhub.com/t/how-to-detect-if-an-outputdebugstring-viewer-is-running/241)

<div class="topic-metadata">

**Author:** [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Replies:** 10\
**Last updated:** [January 26, 2023, 9:48pm UTC](https://clarionhub.com/t/how-to-detect-if-an-outputdebugstring-viewer-is-running/241 "2023-01-26T21:48:03Z")

</div>

Have you ever noticed that your program is running slowly because you have waaaaaay too many calls to OutputDebugString (ODS) ? What’s worse, is when it’s a complete waste, because there is no program running to benefit…

[Previous page](https://clarionhub.com/c/code/11.md)

[Next page](https://clarionhub.com/c/code/11.md?page=2)
