From Sprezz Towers

Notes from the workshop.

Technical discoveries, field notes, unlikely bugs and the occasional opinion.

If I was going to go there, I wouldn't have started from here...

For quite some time now people have been asking us to add an RSS feed to the blog and each time they do we mildly regret some of our life choices - especially Blogger. We will be moving to another host at some point but for now... Anyway - frabjous day! We think we've finally done it. Well, AI tells us it thinks we've done it. But ironically you won't know this as you're not subscribed yet! Just look  down at the bottom right of the side bar and we now have a plethora of options, some of which we hope even work!

Read article →

Warning Will Robinson!

I'm sure that we've all had to deal with the sort of user interface where we are working on a data aware form and only want to enable the OK/Save button when a series of conditions (other than simply required which the 4GL can happily enforce) are met. And like me you've probably written a generic validateOKRequirements: subroutine and wired it into every relevant LOSTFOCUS, CHANGED, CLICK event. Tedious, but necessary. Or so I thought. Enter SAVEWARN and SYSMSG. If you're thinking, "Oh I know about that" then please resume normal programming. If, like me, you apparently have been living under a rock for all these years then read on. The SAVEWARN property of the Window is a "Dirty" flag. If it is true then the data on the screen has changed from how it was when it was originally loaded. This is the flag the system checks the generate the "Changes will be lost... Continue?" prompt.  So to enable/disable our own button all we need to do it ch...

Read article →

Rollover Byte-Hoven

We would label this a tricky gotcha but truth be told BUT if it got you you must have had more time on your hands than sense. A recent announcement from Revelation   explained that the <> syntax has been updated - and that due to huge improvements in <>< processing speeds " you can continue using the familiar “<>” syntax for sequential dynamic array processing without needing to rewrite code using LOOP/REMOVE or LOOP/[] parsing patterns.".  Historically nobody in their right mind would have processed the 65,536th element of a dynamic array using <>. If they wanted to get there they'd have used loop/remove. When the Revelation compiler was originally written, the maximum row size was 64K - so the maximum possible populated columns was 32K. So to speed up processing, the compiler replaced a < N > reference to a special opcode optimised for such extractions. Using < N, N > and < N, N, N > don't redirect to this special opcode,...

Read article →

Oui, Ja? Summoning Entities

One of the best parts of the new IDE is that every control type has its own designer: open it in-place, tweak the editable properties, and inspect the repository metadata. We live in these designers every day when we open a form, a program, a popup, or even a menu. What’s less obvious is that there’s also a designer for object code. It turns a lot of “system sleuthing” from writing code to take object code apart into something closer to browsing. To get to it: File → Open → Entity, then choose Stored Procedure Executables. Here's an example of using the designer to look at RLIST Open RLIST and the first thing you notice is how readable fragments are more easily visible due to them being plain text. Once you recognise the layout, that visibility gives you quick signals about what the routine is doing and which external routines it calls. On the right, the ObjectCode Properties panel tells you the basics immediately: RLIST is a subroutine (not a function) and it takes five parameters...

Read article →

Put a lic in - keep on tickin'

OI 10 marked the introduction of a new licensing method, replacing the old `oengine.dll` stamping. Historically, the licensing information was baked into `oengine.dll`. If you wanted to “change” the characteristics of your OI system you could just drop in a different `oengine.dll` and, effectively, you had a new system. OI 10 introduces a separate licence metadata file called `revengine.lic`. It’s a simple XML file that looks like this (with some minor obfuscation): <OI>     <Signature>PEe80-Uf189-5mg27-m1t80-00m4Q-9hih7</Signature>     <SerialNumber>W10280784</SerialNumber>     <NumUsers>10</NumUsers>     <ExpirationDate>2025-05-21</ExpirationDate>     <ExpirationType>0</ExpirationType> </OI> The `Signature` element is the important part. It’s a cryptographic signature over the real licence attributes – serial number, user count, expiry date and type – generated wit...

Read article → 3 comments

A Catalog Of Errors

An old client recently got in contact about the system we had written for them in AREV in the early 90s and subsequently ported to AREV32. Over the years, we had added some bells and whistles including an incredibly specifically tailored OI export utility which we installed about 10 years ago. Just recently, we added another OI export utility, and it was working as expected. But now, the client has reported that when including a specific set of columns, the report just hung - no messages, nothing. Eventually they just had to kill it in the task manager. They wondered if this was in any way connected to the recent upgrade? Now here's where it gets interesting. The columns in question are used frequently throughout the system, displayed on entry screens, reports and the like with no issues, so we thought the client's concern might be justified. We spun up our test system and attempted to produce the report the client was trying to create. Immediately upon selecting the columns in...

Read article →

Regional Accents

Some seven years ago,  REVDEX  documented the then newly introduced concept of #region to allow folding of code. We find this to be incredibly useful when working on large commuter programs as it allows easy navigation between code sections. There's no point in reproducing the linked article, so briefly, you can bracket sections of code between #region  regionname  and #endregion  regionname  and then fold that section of code. Here's an example of one of our commuter routines with the various code sections "regioned". I'm able to see at a glance what a large program does. If I want to look at the supportingRoutines I can just dropdown the "Find label..." combo and select that option The editor then takes me to the line number where that region begins. However, there is a minor caveat to be aware of when we're cutting and pasting collapsed regions. In the following pseudo-code (with a nod to Jackson Structured Programming throwback for those as ancie...

Read article →

Active X Scripting Host

An interesting query made its way into the office this week. Our client wanted to be able to validate data using  Regular Expressions  (REGEXP) for Email validation (^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$ if you must know) and so unsurprisingly searched the documentation for REGEXP and came across its usage in RTI_JSON. This led to a series of mutual misunderstandings which led to a far greater understanding of what JSON actually is (see footnote) but still didn't help in actually validating using a REGEXP. Fortunately, we have resources in the office who were able to advise that what we wanted to achieve was actually relatively simple using the OI ActiveX Scripting Host. This is something that is not yet "officially" documented in the product - but like quite a few things in OI, there is profuse documentation in the Equates. In version 10 this has been handily encapsulated for us the the RTI_AXSH function - the ActiveX Scripting Host.  ActiveX Scripting and Ac...

Read article →

Feeling hot hot hot...

Recent queries on the Works forum led us to realise that there isn’t one single document that describes the various ways (well two) that you can interact with OLE controls within OI10. So we thought that we’d put it all together in one place using as an example a third party control called CSxGraph which you can download here . This is actually an ActiveX control, rather than an OLE control but that’s primarily a Microsoft branding exercise from nearly 30 years ago now, 1996! So, if you see something described as an ActiveX control, just assume it’s an OLE control. Put simply, OLE components can be added to forms and manipulated via the standard Presentation Server functions, GET and SET_PROPERTY, EXEC_METHOD etc, or they can be created programmatically and be manipulated using intrinsic R/Basic routines such as OLEGETPROPERTY. If you want the user to see the control and possibly interact with it, you’ll need to add it to a form. If that isn’t a requirement then you’d instantiate t...

Read article → 1 comments

A Forest Of Logs

Since the sad demise of  Revelation's article  on the subject, there seems to be no quick reference guide available for the various kinds of log that can be created by OpenInsight to assist in debugging strange occurrences and things that go bump in the night. As a service to the Rev community we therefore offer up our guide to all things log related. Speaking of logs, my best friend at school was nicknamed "Beaver". Steven Norwood. Oh the fun we had in maths lessons (this was pre-calculator days so we had to use log books)... Anyway Event Logs These logs are initiated when the "Start Log" button is pressed on the engine. The log file is created under the OpenInsight subdirectory. Version 9 The file is named OELOG NNN .LOG and will roll over at 1000.  The log will contain every event triggered and all programs run not called from BASIC+ along with the passed parameters. For example Start OpenEngine  log - 2/24/2024 13:55:03 **************************************...

Read article →