Claude Code has not been set up for the Agent to run the Git HUB silo for it Yet. You will need the private version of UBS to run it.. Its been ported from Linux and Im awaiting a few fixes for Windows from the Linux team.. Im hoping to have this free version for Clarion users ready MID 2026… Im very lucky the owners of UBS have allow this to run on windows and have a win 32 compiled DLL CPP version for running in clarion.. I had to twist arms to get it…
These document and some source code are all AI generated.
https://claude.ai/public/artifacts/002ea7e8-5963-4eb2-95e3-f130a3f3dbbd
This was AI generated support for call the Paragraph generation classes in Clarion. Claude code will have to seperate out Include classes for general use as the Cla office service clw module has a fair bit of decades of junk supporting custom stuff for other apps.. Clarion developers may find this other junk off putting…also UBS for clarion will be free it is not a DLL that comes with source code. Its only 158 KB in size which means you dont have to install python or javascript.. Its a virtual binding machine ported from linux. AS AI says, you get all that normal control flow stuff classes, functions, software industry standard syntax and connectivity emulated in just 158K, not 15 megs…The way you use it may be not what clarion developers are used to nor what they feel comfortable with.. but once you make the leap… you never want to go back…
MEMBER
OMIT('***')
* Created with Clarion 11
* User: Quantum Dynamics Ltd
* Date: 4/10/2025
* Time: 7:14 pm
* include('C:\win32claclasses\ExcelParagraphscontent.inc'),once
* To change this template use Tools | Options | Coding | Edit Standard Headers.
***
MAP
MODULE('ParamAnyList.clw')
NewParameterListCAddress,proc,LONG,pascal
NewParameterList(),*ParamAnyList
END
END
include('C:\win32claclasses\paragraphscontentcontainers.inc'),once
! Ai Generated - Singletons.
ExcelParagraphscontentref &ExcelParagraphscontent
! WordParagraphscontentref &WordParagraphscontent
paragraphscontentcontainers.Construct PROCEDURE
CODE
self.Paragraphcontainersref &= NEW QParagraphcontainers
ExcelParagraphscontentref &= new(ExcelParagraphscontent)
self.Paragraphcontainersref.ParagraphName = 'EXCEL'
self.Paragraphcontainersref.IReportParagraphsref &= ExcelParagraphscontentref.IReportParagraphs
self.Paragraphcontainersref.IReportWordParagraphsref &= ExcelParagraphscontentref.IReportWordParagraphs
self.Paragraphcontainersref.PCIInvokeref &= ExcelParagraphscontentref.PCIInvoke
self.Paragraphcontainersref.ISetPCIInvokeref &= ExcelParagraphscontentref.ISetPCIInvoke
add(self.Paragraphcontainersref)
! AI Generated WORD Support - ADD Here.
! Set up WORD by default
paragraphscontentcontainers.ISetIUbsGlobals.SetUBSGlobals PROCEDURE(long IUniBindatypesAddress, long iUBSAddress, long GlobalBindAddress, long IGlobalBindableAddress)
CODE
! BIND paragrapghs
paragraphscontentcontainers.ISetPCIInvokeID.SetInterface PROCEDURE(string Named,long PCIInvokeaddress)
CODE
if not self.Paragraphcontainersref &= NULL and PCIInvokeaddress > FALSE
self.Paragraphcontainersref.ParagraphName = upper(Clip(Named))
get(self.Paragraphcontainersref,'ParagraphName')
if not errorcode()
if not self.Paragraphcontainersref.ISetPCIInvokeref &= NULL
self.Paragraphcontainersref.ISetPCIInvokeref.setinterface(PCIInvokeaddress) ! External Client Invoker
END
END
END
paragraphscontentcontainers.Destruct PROCEDURE
CODE
IF NOT self.Paragraphcontainersref &= NULL
DISPOSE(self.Paragraphcontainersref)
END
paragraphscontentcontainers.IUBSD.getAsInteger PROCEDURE(const *cstring BindobjectName, const *cstring objectname)
returnitem LONG
CODE
RETURN(returnitem)
paragraphscontentcontainers.IUBSD.getAsNumber PROCEDURE(const *cstring BindobjectName, const *cstring objectname)
returnitem REAL
CODE
RETURN(returnitem)
paragraphscontentcontainers.IUBSD.getAsString PROCEDURE(const *cstring BindobjectName, const *cstring objectname)
returnitem CSTRING(1000)
CODE
RETURN(returnitem)
paragraphscontentcontainers.IUBSD.setToInteger PROCEDURE(const *cstring BindobjectName, const *cstring objectname, LONG i)
CODE
paragraphscontentcontainers.IUBSD.setToNumber PROCEDURE(const *cstring BindobjectName, const *cstring objectname, REAL r)
CODE
paragraphscontentcontainers.IUBSD.setToString PROCEDURE(const *cstring BindobjectName, const *cstring objectname, const *cstring s)
CODE
paragraphscontentcontainers.IUBSD.setToBindable PROCEDURE(const *cstring BindobjectName, const *cstring objectname, LONG b)
CODE
paragraphscontentcontainers.IUBSD.invoke PROCEDURE(const *cstring BindobjectName, LONG boundequ, const *cstring objectname, LONG EquNumber, LONG IUbsaddrss, LONG cparamsinterfaceaddress, LONG igetsetequaddress)
returnitem LONG
ParamListRef &ParamAnyList
areturnvalue ANY
CODE
! message(' paragraphscontentcontainers invoke '&BindobjectName&' '&objectname)
IF cparamsinterfaceaddress > 0
ParamListRef &= (cparamsinterfaceaddress)
END
IF NOT ParamListRef &= NULL
EXECUTE self.CommandEqu
BEGIN ! AddParagraph
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.AddParagraph(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3))
END
END
BEGIN ! AddFragment
IF NOT self.IReportParagraphsinfocusref &= NULL
! message('P(1)=' & ParamListRef.IParamsAnyList.P(1) & |
! ' P(2)=' & ParamListRef.IParamsAnyList.P(2) & |
! ' P(3)=' & ParamListRef.IParamsAnyList.P(3) & |
! ' P(4)=' & ParamListRef.IParamsAnyList.P(4) & |
! ' P(5)=' & ParamListRef.IParamsAnyList.P(5))
self.IReportParagraphsinfocusref.AddFragment(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3), |
ParamListRef.IParamsAnyList.P(4), |
ParamListRef.IParamsAnyList.P(5), |
ParamListRef.IParamsAnyList.P(6), |
ParamListRef.IParamsAnyList.P(7), |
ParamListRef.IParamsAnyList.P(8), |
ParamListRef.IParamsAnyList.P(9), |
ParamListRef.IParamsAnyList.P(10), |
ParamListRef.IParamsAnyList.P(11))
END
END
BEGIN ! GetParagraph
IF NOT self.IReportParagraphsinfocusref &= NULL
areturnvalue = self.IReportParagraphsinfocusref.getParagraph(|
ParamListRef.IParamsAnyList.P(1))
END
END
BEGIN ! SetParagraphFormatting
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetParagraphFormatting(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3), |
ParamListRef.IParamsAnyList.P(4), |
ParamListRef.IParamsAnyList.P(5), |
ParamListRef.IParamsAnyList.P(6), |
ParamListRef.IParamsAnyList.P(7), |
ParamListRef.IParamsAnyList.P(8))
END
END
BEGIN ! SetMultiColumn
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetMultiColumn(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2))
END
END
BEGIN ! SetFontName
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFontName(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2))
END
END
BEGIN ! SetFontSize
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFontSize(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2))
END
END
BEGIN ! SetFontColor
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFontColor(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2))
END
END
BEGIN ! SetFontBold
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFontBold(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2))
END
END
BEGIN ! SetUnderline
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetUnderline(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2))
END
END
BEGIN ! SetDoubleUnderline
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetDoubleUnderline(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2))
END
END
BEGIN ! SetShadow
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetShadow(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2))
END
END
BEGIN ! SetFragmentFontSize
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFragmentFontSize(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3))
END
END
BEGIN ! SetFragmentFontColor
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFragmentFontColor(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3))
END
END
BEGIN ! SetFragmentFontBold
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFragmentFontBold(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3))
END
END
BEGIN ! SetFragmentUnderline
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFragmentUnderline(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3))
END
END
BEGIN ! SetFragmentDoubleUnderline
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFragmentDoubleUnderline(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3))
END
END
BEGIN ! SetFragmentShadow
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFragmentShadow(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3))
END
END
BEGIN ! RemoveParagraph
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.RemoveParagraph(|
ParamListRef.IParamsAnyList.P(1))
END
END
BEGIN ! CreateCombinedParagraph
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.CreateCombinedParagraph(|
ParamListRef.IParamsAnyList.P(1))
END
END
BEGIN ! AddChildParagraph
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.AddChildParagraph(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2))
END
END
BEGIN ! GetParagraphCount
IF NOT self.IReportParagraphsinfocusref &= NULL
areturnvalue = self.IReportParagraphsinfocusref.GetParagraphCount(|
ParamListRef.IParamsAnyList.P(1))
END
END
BEGIN ! ExecuteEvent
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.ExecuteEventParagraphs(|
ParamListRef.IParamsAnyList.P(1))
END
END
BEGIN ! ClearParagraphs
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.ClearParagraphs()
END
END
BEGIN ! GenerateParagraphsContent
if not self.IApplicationsCentreref &= NULL
self.IApplicationsCentreref.ApplicationEvent(11) ! Link to External Output Invoker for MS Office
END
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.GenerateParagraphsContents(|
ParamListRef.IParamsAnyList.P(1))
END
END
BEGIN ! GenerateAllParagraphsContent
if not self.IApplicationsCentreref &= NULL
self.IApplicationsCentreref.ApplicationEvent(11) ! Link to External Output Invoker for MS Office
END
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.GenerateAllParagraphsContents()
ELSE
END
END
BEGIN ! GetParagraphContent
IF NOT self.IReportParagraphsinfocusref &= NULL
areturnvalue = self.IReportParagraphsinfocusref.GetParagraphContent(|
ParamListRef.IParamsAnyList.P(1))
END
END
BEGIN ! AddTextFormatting
IF NOT self.IReportParagraphsinfocusref &= NULL
areturnvalue = self.IReportParagraphsinfocusref.AddTextFormatting(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3), |
ParamListRef.IParamsAnyList.P(4), |
ParamListRef.IParamsAnyList.P(5), |
ParamListRef.IParamsAnyList.P(6), |
ParamListRef.IParamsAnyList.P(7), |
ParamListRef.IParamsAnyList.P(8))
END
END
BEGIN ! RemoveTextFormatting
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.RemoveTextFormatting(|
ParamListRef.IParamsAnyList.P(1))
END
END
BEGIN ! GetTextFormattingByName
IF NOT self.IReportParagraphsinfocusref &= NULL
areturnvalue = self.IReportParagraphsinfocusref.GetTextFormattingByName(|
ParamListRef.IParamsAnyList.P(1))
END
END
BEGIN ! SetFragmentCharacterRange
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.SetFragmentCharacterRange(|
ParamListRef.IParamsAnyList.P(1), |
ParamListRef.IParamsAnyList.P(2), |
ParamListRef.IParamsAnyList.P(3), |
ParamListRef.IParamsAnyList.P(4), |
ParamListRef.IParamsAnyList.P(5))
END
END
BEGIN ! FragementWords
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.Fragementwords()
END
END
BEGIN ! FragementNotwords
IF NOT self.IReportParagraphsinfocusref &= NULL
self.IReportParagraphsinfocusref.FragementNotwords()
END
END
END
IF NOT ParamListRef &= NULL
DISPOSE(ParamListRef)
END
END
RETURN(returnitem)
paragraphscontentcontainers.IUBSD.selectobject PROCEDURE(const *cstring BindobjectName, LONG boundequ, const *cstring objectname, LONG EquNumber, LONG IBindableEqusaddress, LONG rtnEquMember)
CODE
! NOTE : Event 10 = MSOffice OLE Bound - Equate Numeric
! may be renumbered at a future date.
!message(' paragraphscontentcontainers selectobject '&BindobjectName&' '&objectname)
case upper(clip(objectname))
of 'EXCEL'
self.Paragraphcontainersref.ParagraphName = upper(Clip(objectname))
GET(self.Paragraphcontainersref, 'ParagraphName')
IF NOT ERRORCODE()
! Set interfaces in focus from container
self.IReportParagraphsinfocusref &= self.Paragraphcontainersref.IReportParagraphsref
self.IReportWordParagraphsinfocusref &= self.Paragraphcontainersref.IReportWordParagraphsref
if self.Paragraphcontainersref.IReportParagraphsref &= NULL
! message(' Assign IReportParagraphsinfocusref - NULL ')
END
! message(' Assign IReportParagraphsinfocusref ')
END
ELSE
! Map command to EQU
CASE UPPER(CLIP(objectname))
OF 'ADDPARAGRAPH'
self.CommandEqu = ParaCmd:AddParagraph
OF 'ADDFRAGMENT'
self.CommandEqu = ParaCmd:AddFragment
OF 'GETPARAGRAPH'
self.CommandEqu = ParaCmd:GetParagraph
OF 'SETPARAGRAPHFORMATTING'
self.CommandEqu = ParaCmd:SetParagraphFormatting
OF 'SETMULTICOLUMN'
self.CommandEqu = ParaCmd:SetMultiColumn
OF 'SETFONTNAME'
self.CommandEqu = ParaCmd:SetFontName
OF 'SETFONTSIZE'
self.CommandEqu = ParaCmd:SetFontSize
OF 'SETFONTCOLOR'
self.CommandEqu = ParaCmd:SetFontColor
OF 'SETFONTBOLD'
self.CommandEqu = ParaCmd:SetFontBold
OF 'SETUNDERLINE'
self.CommandEqu = ParaCmd:SetUnderline
OF 'SETDOUBLEUNDERLINE'
self.CommandEqu = ParaCmd:SetDoubleUnderline
OF 'SETSHADOW'
self.CommandEqu = ParaCmd:SetShadow
OF 'SETFRAGMENTFONTSIZE'
self.CommandEqu = ParaCmd:SetFragmentFontSize
OF 'SETFRAGMENTFONTCOLOR'
self.CommandEqu = ParaCmd:SetFragmentFontColor
OF 'SETFRAGMENTFONTBOLD'
self.CommandEqu = ParaCmd:SetFragmentFontBold
OF 'SETFRAGMENTUNDERLINE'
self.CommandEqu = ParaCmd:SetFragmentUnderline
OF 'SETFRAGMENTDOUBLEUNDERLINE'
self.CommandEqu = ParaCmd:SetFragmentDoubleUnderline
OF 'SETFRAGMENTSHADOW'
self.CommandEqu = ParaCmd:SetFragmentShadow
OF 'REMOVEPARAGRAPH'
self.CommandEqu = ParaCmd:RemoveParagraph
OF 'CREATECOMBINEDPARAGRAPH'
self.CommandEqu = ParaCmd:CreateCombinedParagraph
OF 'ADDCHILDPARAGRAPH'
self.CommandEqu = ParaCmd:AddChildParagraph
OF 'GETPARAGRAPHCOUNT'
self.CommandEqu = ParaCmd:GetParagraphCount
OF 'EXECUTEEVENT'
self.CommandEqu = ParaCmd:ExecuteEvent
OF 'CLEARPARAGRAPHS'
self.CommandEqu = ParaCmd:ClearParagraphs
OF 'GENERATEPARAGRAPHSCONTENT'
self.CommandEqu = ParaCmd:GenerateParagraphsContent
OF 'GENERATEALLPARAGRAPHSCONTENT'
self.CommandEqu = ParaCmd:GenerateAllParagraphsContent
OF 'GETPARAGRAPHCONTENT'
self.CommandEqu = ParaCmd:GetParagraphContent
OF 'ADDTEXTFORMATTING'
self.CommandEqu = ParaCmd:AddTextFormatting
OF 'REMOVETEXTFORMATTING'
self.CommandEqu = ParaCmd:RemoveTextFormatting
OF 'GETTEXTFORMATTINGBYNAME'
self.CommandEqu = ParaCmd:GetTextFormattingByName
OF 'SETFRAGMENTCHARACTERRANGE'
self.CommandEqu = ParaCmd:SetFragmentCharacterRange
OF 'FRAGEMENTWORDS'
self.CommandEqu = ParaCmd:FragementWords
OF 'FRAGEMENTNOTWORDS'
self.CommandEqu = ParaCmd:FragementNotwords
END
END
RETURN(address(self.IUBSD))
paragraphscontentcontainers.IUBSD.removeobject PROCEDURE(const *cstring BindobjectName, const *cstring objectname)
CODE
paragraphscontentcontainers.IUBSD.existsobject PROCEDURE(const *cstring BindobjectName, const *cstring objectname)
exists LONG
CODE
RETURN(exists)
paragraphscontentcontainers.IUBSD.nextobjectName PROCEDURE(const *cstring BindobjectName, const *cstring objectname)
CODE
RETURN(0)
paragraphscontentcontainers.IUBSD.copy PROCEDURE
CODE
paragraphscontentcontainers.IUBSD.share PROCEDURE
CODE
paragraphscontentcontainers.IUBSD.unShare PROCEDURE
CODE
paragraphscontentcontainers.IUBSD.getDescription PROCEDURE
description CSTRING(255)
CODE
description = 'ParagraphsContainer'
RETURN(description)
paragraphscontentcontainers.IUBSD.getBinding PROCEDURE
CODE
RETURN(ADDRESS(self.IUBSD))
paragraphscontentcontainers.IUBSD.UbsNewParams PROCEDURE
paramAddress LONG
CODE
paramAddress = NewParameterListCAddress()
RETURN(paramAddress)
omit('*scriptsexamples')
! T4: 2x2 Grid with colored cells
paragraphs.excel.addparagraph('TestPara4', 1, 1)
! Cell A1: 'Cell' + 'A1' (Red)
paragraphs.excel.addfragment('TestPara4', 'Cell', 1, 12, global.xlRgbDarkRed, 0, 1, 1, 0, 0, 0)
paragraphs.excel.addfragment('TestPara4', 'A1', 0, 12, global.xlRgbDarkRed, 0, 1, 1, 0, 0, 0)
! Cell B1: 'Cell' + 'B1' (Blue)
paragraphs.excel.addfragment('TestPara4', 'Cell', 0, 12, global.xlRgbDarkBlue, 0, 1, 2, 0, 0, 0)
paragraphs.excel.addfragment('TestPara4', 'B1', 0, 12, global.xlRgbDarkBlue, 0, 1, 2, 0, 0, 0)
! Cell A2: 'Cell' + 'A2' (Green)
paragraphs.excel.addfragment('TestPara4', 'Cell', 0, 12, global.xlRgbDarkGreen, 1, 2, 1, 0, 0, 0)
paragraphs.excel.addfragment('TestPara4', 'A2', 0, 12, global.xlRgbDarkGreen, 1, 2, 1, 0, 0, 0)
! Cell B2: 'Cell' + 'B2' (Purple)
paragraphs.excel.addfragment('TestPara4', 'Cell', 1, 12, global.xlRgbHotPink, 0, 2, 2, 0, 0, 0)
paragraphs.excel.addfragment('TestPara4', 'B2', 1, 12, global.xlRgbHotPink, 0, 2, 2, 0, 0, 0)
paragraphs.excel.generateparagraphscontent('TestPara4')
! fragRef.TextClen = self.scriptInterface.computeIntFromString('cstrlen("' & CLIP(text) & '")')
! fragRef.Textaddress = self.scriptInterface.computeBindableFromString('varName')
! fragRef.TextType = 1
! *scriptsexamples