Following on from our last post on colouring individual popup lines we move onto one of the holy grails of developers - the ability to add a button to a popup and launch our own program from it - interrogating the popup to display more information about the current row for example. Using the example we showed last time - note that we now have a button on the popup called "Display" Clicking the button results in this To accomplish this we need to be familiar with The TIMER tecnique we discussed in the last blog posting The fully qualified entity ids of the individual popup controls The use of Window Common The structure of the Window Common used for quick events The TIMER technique we discussed in the last blog posting If you haven't yet read the last blog entry then you might like to before continuing. The fully qualified entity ids of the individual popup controls To add a display buttton to the popup we could add a new control to the popup...
A recent Works forum posting posed the question "Is it possible to set the color for individual rows in a popup rather than odd/even row colors?". Received wisdom is that "you cannot change colors on specific rows using COLOR_BY_POS due to the modality of the popup". This set the folks in Sprezz Towers to thinking about how this could actually be accomplished. This blog posting reflects the fruits of the combined thoughts and efforts of both the UK and Philadelphia Sprezz offices. Take as a simple example a gender popup :- It might be nice to render this as follows :- To achieve this we need to be familiar with User Defined Properties The TIMER event The TIMER property The HANDLE property The COLOR_BY_POS send_Message message. The Window structure of a popup User Defined Properties The developer can add additional properties to any control within an OI app simply by setting a property name prefixed with an @. So call set_Property(@Window...
A developer recently asked on the Works forum if it was possible to use the table browser from within a program. Well the simple answer is "Yes". The slightly more complex answer is that since so many of the OI tools are now written in OI itself it is frequently possible to use these tools from within programs. The first thing we need to know is what the table browser window is called. It may come as a surprise to those more familiar with obscure naming conventions to find out that it is called "TABLE_BROWSER". So to call it programmatically we'd simply atWindow = Start_Window ( "TABLE_BROWSER" , @Window ) Of course launching it might not be enough - we might also want to populate it with the contents of a table. To do this we need to know the control names. To save you the investigative work we've included a table below :- TABLE_BROWSER The window TABLE_BROWSER.BTN_CANCEL The cancel button TABLE_BROWSER.BTN_L...
Finishing up our series on extended selects and readnexts, we will now turn our attention to managing the cursors. When working with the extended select and readnext statements, the developer is required to maintain the status of the select and readnext cursor. Additionally, as we hinted in our previous entries on Latent and Resolved Selects and Selects and File Resizing , the extended select and readnext statements allow the developer to work with multiple cursors. Multiple cursors means that it's possible to have up to 9 active select statements working at any particular time. We'll start with cursor status, since that needs to be maintained no matter how many selects may be active at any given time. We previously mentioned that the extended select syntax is: select table by columns using cursor then... While that's true, it's a little simplistic as there are two other keywords, SETTING and ASSIGNING, that you may use as well. The following table describes each ...
We'd recently installed a new report using RUN_REPORT at the client and the client complained that as the report progressed it became slower and slower and slower until it was taking minutes to print a line. When the report DID finally conclude it crashed with a SYS1000 error message. We tested ourselves and sure enough the report was painful. We started it running against a couple of thousand records before going home for the night and by the time we came back in the morning it wasn't even half way through. When it did eventually finish it crashed! Still this last bit was something we were familiar with having already documented it in this blog posting. The slowdown on the otherhand was something else. So we did what most developers do in these circumstances and stripped the report back to bare bones and continued adding features in until it started misbehaving. The report had several BY clauses and several BREAK-ONs but it was when we came to the BREAK-ON modifier "...
With conference coming up soon in October (see you there we hope?) we had to carefully select our presentations to ensure that they remained educational and weren't just product showcases. One of the subjects that we therefore decided not to cover was creating scaleable distributed applications using our proprietary engine farm. Whilst the techniques involved are interesting we'd ultimately be promoting our proprietary technology and if you wanted a sales presentation you'd have asked for one, right? So we decided to create a blog article about it instead! The results are what you're now reading.
What is an engine farm?
An engine farm is a program that is designed to spin up and spin down a variable number of OpenEngines on a server to deal with incoming and outgoing transactions. As load volumes increase, more engines are brought into play and as demand decreases engines are retired. The farm also has to deal with engines crashing - be it through programmer error...
In a previous blog on Latent and Resolved Selects , we talked about how processing through the Basic+ reduce function and select statements were quicker than using the RLIST command. As hinted at in the prior article, the speed increase comes with additional maintenance required by the developer. In this part of our series on Selection, we'll talk about this maintenance, and the steps you need to take.
There are three areas that the developer needs to be aware of. The first is file resizing. The second is readnext termination. The third is cursor status, which will be covered in the next in this series of postings.
File Resizing
As most of you know, Revelation's Linear Hash Filing System (LH) is more accurately known as "Linear hashing with two partial expansions, separate chaining, distributed control and variable length records". It's the "distributed control" portion we're interested in here, since that's the part that manages ...
One of the nice features that AREV has that is missing from OpenInsight is the ability to change the datafile of a databound window on the fly by adding the modifier DATAFILE=NewDataFileName onto the sentence being used to launch the window. This was frequently used when multiple files shared the exact same structure - for example a "current" file and the associated archive files. As we've mentioned we're working on a large AREV->OI conversion and we really missed this facility so in true Sprezz style we decided that we'd better implement it. This proved to be easier than even we had anticipated due to the similarity between OI Window Common and AREV Window Common. The workaround we implemented is only good for windows which only update one file, though it wouldn't take much to make it suitable for multi-file windows. The following code shows how to implement it in a create event although of course if you have a promoted event framework you might choose...
A recent question on the Revelation Forum asked how to detect an ENTER keypress when using an EditTable as this is not exposed by the standard OpenInsight CHAR event (ENTER is one of the keys that the EditTable normally considers to be "reserved" like TAB and the Arrow keys).
Despite this limitation it is actually possible to detect an ENTER keypress with WM_KEYDOWN window message and the WINMSG event but ONLY if the EditTable is set to "Protected" , i.e.
To trap the ENTER key we first need to tell OpenInsight that we want to be notified of any WM_KEYDOWN window messages that are sent to the EditTable by using the OpenInsight QUALIFY_EVENT message. This is normally done in the form's CREATE event:
0001 $insert winAPI_WindowMessage_Equates 0002 $insert logical 0003 0004 call send_Message ( @window : ".TABLE_1"...
We've been working quite a bit with OIPI at Sprezz Towers recently, and having not had a problem creating PDFs locally we were flummoxed when the same PDFs would not create on the client's workstations - rather, every time we called Set_Printer("TERM") we'd get the following... Being a little overawed by the apparent complexity of the INIT call we checked and rechecked our code but could find nothing wrong with it. Finally we gave in and contacted Revelation Support in the US who asked simply "Do you have a SYSTEMP table?". Well as it happens, locally we do - but on client sites we tend to only install directories we need so - as we weren't using AREV32 - we hadn't installed the AREV_DIR subdirectory and a file called SYSTEMP that lives there. So we created a SYSTEMP table and lo and behold our formerly recalcitrant program began creating PDFs like they were going out of fashion. But this still begs the question - why a SYS1000 loading err...
One of our current mega-projects is converting a very large AREV system over to OpenInsight and of course like most large systems it relies heavily on batch processes that perform selects and refine these selects before presenting the results. AREV had the useful status line update facility to let you know how processing was going but regretfully OpenInsight omitted this - presumably because lacking a dedicated status line there was nowhere to put it. With hindsight a SEND_INFO every 1% would at least have allowed the developer to intercept and update the information from a select. We tried the usual approach of looking the other way but when some of the queries were taking upwards of five minutes to return results to the user we decided that enough was enough. The problem as we saw it was split into two areas - selects against entire non-indexed files and selects against indexes. This article deals with the former. The next article in this series will deal with the latter. To st...