When programming for the web using OECGI3, whether using O4W or just directly, occasions arise when the developer needs to query HTTP headers sent by the client that aren't included in the default information passed forward by OECGI3. Additionally, it can become necessary to set HTTP headers for return to the client. The following article discusses how to achieve such functionality. Querying HTTP Headers By default OECGI3 passes through a subset of the available HTTP headers. However there may be times when access to additional headers is required. For example, recently when writing a multi-lingual O4W application we wanted to determine which language the user who was attempting to use the system had set their browser to. Knowing this would allow us to deliver back content in their native tongue. To achieve this we'd have to examine the HTTP_ACCEPT_LANGUAGE header value. Examination of the HTTP_REQUEST passed through showed that this was not available to us.Fortunately...
For those of you who've expressed an interest, the internal Sprezzatura OpenInsight Coding Standards document is now available for download from our Whitepapers Section .
Regular users will know that calls to SET_PROPERTY and GET_PROPERTY can be made more efficient by passing @rm delimited arrays to the routines rather than making multiple individual calls. Although using the @rm concatenation method can lead to improved performance you need to be aware of how it is actually implemented, otherwise it can lead to some subtle bugs that may be hard to track down. This is because internally there are two types of properties; PS (Presentation Server) properties, and Synthetic properties, and the order in which they are processed when combined together could cause your code to behave in a manner that you are not expecting. The PS properties are implemented at a low-level inside the Presentation Server (OINSIGHT.EXE) and generally deal with “real” visual properties such as TEXT, SIZE, LIST and so on: basically they wrap the low-level UI attributes of forms and controls. Access to these properties is via two functions called ps_Get_Property and ps_Set_Prope...
Once again your intrepid consultant was called to an AREV/32 conversion of a system running a small business for decades on an AREV system. The majority of the actual work was performed by Martyn back at the office as he wished to a) hone his AREV/32 skills and b) show how straightforward the majority of conversions are. He succeeded on both points but at the same time underlined why a little consultancy help can occasionally come in handy. In preparation for this I burned all of the files I was going to need onto DVD using what Microsoft refer to as "Live File System". (Incidentally does anyone else get annoyed by Microsoft's habit of inventing their own acronyms for things? The world and his wife refers to "Live File System" as "Universal Disk Format" or UDF. Even windows.microsoft.com says " Learn about the Live File System (UDF) and Mastered disc formats"). My Windows 7 software ASSURED me that this would be readable on any machin...
We were testing an import routine the other day. It was nothing out of the ordinary, a simple tab delimited file which was being imported into a new OI table. The only tricky part (where tricky is a very loose term) is that the OI table required a multi-part key. The OI key was simply the first two columns of the imported data, and the customer wanted those fields stored in the data as well. Actually, calling it tricky is a bit dramatic. Let's say it was about as simple an import as you could want. We test for a reason, and the initial run through of the code managed to import an empty key. Normally when this happens, a null key is created. However, because we used a multi-part key, a key of "*" was created. Unlike working with null keys in the system tools, "*" has a length greater than 0, and could easily be examined by the system editor, which we did to ensure that the row was indeed empty. We then proceeded to use the File -> Delete menu optio...
In a previous posting , we talked about passing by reference versus passing by value. In that article, we mentioned we'd explain how this could adversely impact your programs. At a client site, we installed a custom index update program. This function allows the customer to run multiple indexers at a time, with each indexer updating only a subset of the indexes on each machine. Additionally, the UI displays statistics about the indexes, the time it takes to perform each update and other useful information. (If you're interested in said product, then please, by all means, let us know.) We recently discovered that some indexes were never updating, and a check showed that the test lock we placed on the index was never being released. A quick check of the code showed that this was theoretically impossible, and a detailed check validated that assumption. However, the theory was quite wrong since the lock was never being released. A test run through a number of indexes, c...
There's a slight chance that the first part of the above playground call may not travel well for those that never played marbles at school. But given the average age of the Rev community this is probably not a lot of us. Anyway a quick "whoops" that hit us recently which with hindsight is obvious but at the time surprised slightly. Consider the following code string = "'John','','','','','Smith'" swap ",''," with ",null," in string if youExpectedTheResultantStringToBe = "'John',null,null,null,null,'Smith'" then goSub carryOnReading end return carryOnReading: Well of course (if you're here) it wasn't - it was actually "'John',null,'',null,'','Smith'" and now we've pointed that out it will be painfully obvious won't it? The swap command traverse...
My children are currently obsessed by Doctor Who. As small children (they are four and six when this was written), the level of questions they can ask can be surprisingly advanced and sophisticated. For example, how many times has The Doctor used his sonic screwdriver? How many times has the TARDIS changed shape? Which companion traveled with The Doctor the most? Which companion was in the most episodes? How many companions worked with more than two doctors? Who was the doctor when I was born? What does this have to do with Revelation products? (They boys are surprisingly computer literate. Jacob has already BUDded his first entry screen.) Surprisingly, the last answer is the easiest one. While I like Doctor Who as much as the next programmer does, and have an extensive collection of material, including audio plays and books, I don't really know the answers to any of the above questions. As I tell the boys, I don't really care about the details at such a low level...
The Introduction Here at Sprezz we've just got back from the latest RevCon hosted at the Sheraton Music City in Nashville and it has to be said we had a great time. This was possibly one of the least stressful conferences for us as presenters in recent history. (Of course the same can't be said for poor Nancy who had the usual vicissitudes to contend with along with some new ones (Presenters losing their presenter tag from their badges anyone?)). Now we didn't attend every session so we can't provide commentary on all of the sessions (and for this, we apologise unreservedly to those whose presentations are not commented on) but we're sure that between our comments and those of other individuals you'll be able to piece together an overview of what went on. The Venue The Sheraton Music City is a pleasant looking building nestled in acres of landscaped gardens. It isn't really local to anything much but to the delight of at least one member of the Sprezz pa...
Putting the finishing touches to an order entry system this week, we were frustrated by the apparent unwillingness of one symbolic to update, whilst those around it had no such qualms. Looking at the dictionary items nothing stood out; they were all multivalued, they all derived their values based upon the code entry. So we decided to go for the sledgehammer to crack a nut approach and added a quickevent to the POSCHANGED event. Column 4 doesn't want to update - we'll tell it to update every single time the user moves cells. This was sort of successful - but not entirely. Sometimes it worked, sometimes the price column was the only one updated. In the Sprezz world, "Sort of" doesn't cut it. So just as we were about to start coding a POSCHANGED in the commuter routine to update ALL of the columns we reviewed our options. As is often the way when discussing problems rather than thinking about problems the solution becamse obvious. RTI have op...
An accusation once (correctly) levelled at your author is that he frequently neglects to read the ReadMe files that accompany each upgrade of OpenInsight. Despite having made this oversight the subject of a New Year's Resolution it seems that they still aren't being read with quite the right degree of attention otherwise this little snippet might have been noticed in the 9.2.1 readme... RTI_LOAD_DATABASE - Can Load a different DBT programmatically. Usage: Call RTI_Load_Database("MYDB") to load MYDB.DBT This will swap the DBT without all the initialisation we mentioned in our last blog post . It will even leave the inheritance chain in @APPID intact so that you can load a database which doesn't inherit from the existing database. In fact the only thing that changes is @DBID which changes to the new database value. As if that weren't enough (and thanks to RTI for this information) there is an additional boolean parameter to ...
As is often the case, postings on the Rev forum pique our intellectual curiousity and sometimes when you're on the road in a hotel room there's nothing more fun than probing some obscure piece of arcane system information "because we can". Welcome to the first blog of 2013 where we pretty much excel ourselves in the arcane department although we SUSPECT the results will have wider applicability - especially to those of you doing multiple attaches/detaches within your application. A recent post on the Rev forum asked about the use of SET_ATTACH_IMAGE and USE_ATTACH_IMAGE. Those of you with long memories may recall that these routines were introduced in AREV to allow essentially "Quick Attaches". They swap out the contents of @FILES and @VOLUMES for a previously stored set of values. Those of you with even longer memories will remember that the precursors to these routines were created by Dunbar & Co - a prolific contributor to the Rev com...