S/ENL - The Sprezzatura Electronic Newsletter (All the RevSoft News That's Fit To Print (And bits that probably aren't as well...))
Welcome to the latest copy of the Sprezzatura Electronic News Letter. We’re cramming in some fairly meaty technical articles this time to try and catch up on some of the promised documentation projects, but even so regretfully in this issue we’ll still have to leave some promised coverage until next time. This issue is being put out in time for CeBIT in Sydney on May 28-30th. Sprezzatura will have a stand there and will be joined on the stand by Revelation US and Revelation Australia! We’ll be unveiling our new look brochures and corporate image – the ZZ stays but the image has been significantly updated. Over time we’ll be revamping the website and our normal stationery too – so by the time we see everyone in Vegas the transition should be complete. If you’re based in Australia or New Zealand and you’d like to meet up with Sprezz personnel before or after the show then let us know. We’ll be arriving on the 17th of May so will have spare time. Some enterprising individuals have already booked time to do some in-depth training in some of the more esoteric product areas – and now that more people in Australia are signing up to use S/Web we’ll be covering that in training too. We’ll also have a contingent at the User Group, which is meeting in Sydney on the 30th May in the evening at the Quay West Hotel. We hope to see you there! If you need tickets for CeBIT (and to be honest they’re not exactly rocking horse droppings) then let us know. Don’t forget – you don’t have to be in Australasia to benefit from CeBIT – we’re still holding our “Celebrate CeBIT with Sprezz Local” promotion that can have a Sprezz consultant on your door step for just the cost of consultancy – no travel or accommodation expenses. Check out http://www.sprezzatura.com/cebit.htm for details. S/List continues to go from strength to strength and in this issue of SENL we review the first release of S/List for OI32. The product is going to be released in two stages :- the first stage just ensures forward compatibility and introduces a number of minor tweaks. The second stage will be a more fundamental change and will replace the existing Wizards with Win2K style wizards extend the abilities of S/List to take advantage of some of the more extended features of OIPI Professional such as exporting data to PDF and data files! The second stage will not be a chargeable release, although if you bought your S/List before the beginning of 2002 the initial upgrade will be. S/List pricing has stayed pretty much solid for 5 years now, but were you aware that if you wanted to include S/List in your vertical product, we can negotiate special rates to make it more advantageous? We can even customise the product so it fits more seamlessly into your environment. A recent licensee for S/List as standard reporting tool is BG-Base (http://www.rbge.org.uk/BG-BASE/) whose client base is now in over 20 countries around the world. Since the last issue of SENL it has been becoming increasingly easy to negotiate reasonably priced S/Web licenses – helped in no small part by the continuing reasonableness of the new management at Revelation. One of our more recent licensees, Centrex has just gone live with a web-based version of their hospital linen application. Additional details may be found at http://www.centrex.com.au/. Finally as ever we're keen to meet up with all of our colleagues out there whenever possible. I'll be in SoCal on a social trip in very early July but will have 2 or 3 days spare if anyone would like to meet up to chat! Until we next meet - all at Sprezz look forward to seeing as many of you as possible at the User Conference in Vegas in August! Best wishes All at Sprezzatura SENL Feedback Firstly Robert Lee from New Zealand asks"Have you ever covered MFS's in a S/ENL? I'm pretty sure you haven't as I think I have read them all now and am sure I would remember. If not, I for one would welcome an article on them."Well Robert, here at Sprezz we try not to document information that is available elsewhere - if we can't be "Ur" we'll skip it (that's if we're allowed to use "Ur" as an adjective rather than as a prefix)! We may make an exception for MFSs in the future but they have already been well covered in a set of documentation released with AREV by Revelation Software. In case you can't get your hands on it Revelation have very kindly given us permission to distribute it with our Sysknowledge application so download this from our Web site - it is free of charge and also includes all of the other technical bulletins!John Edgar writes from Conway Information Systems in Canada"We have heard many great comments bout Andrew's discussion/tutorial/document on "promoted events". We were given a link but the file is no longer available.We would really appreciate reading this document if it still lurking about. Please e-mail us with a link (or attachment) if you are able to find it.".As you'll have noticed this has been reformatted into the new look SENLs - so the SENL you want is SENL Volume 1 Issue 7 - the article is entitled "The X Events".While we're on the subject - if you want some real hands on explanations of how promoted events work, don't forget to book your seats now for the Revelation User Conference in Vegas in August where Don Bakke from SRP Computer Solutions will be presenting a talk entitled "Promoted Events - going deeper into OpenInsight Development" . For more details check "What's New" on http://www.srpcs.com. Ron Hollar writes from California"Hello, I found the word sprezzatura in an article in CIO magazine, and thought you might like to read it. It defines it as "sprezzatura, an Italian word that refers to the ability to execute difficult tasks gracefully." You picked a good name for your company. Here is the link:http://www.cio.com/archive/041502/shmooze.htmll"Why thanks Ron - that's a great link! We liked it so much we enquired about reprints. Unfortunately it seems it'd be cheaper to buy everyone an Italian/English dictionary!Meanwhile more than one person tried to take us up on our "Free CeBIT" ticket offer. Regretfully they misunderstood the offer. The offer is for tickets to get into CeBIT in Sydney and doesn't include the airfare and accommodation. Nice try though Tony - if we find a Brussels/Sydney ticket lying around we'll be sure to let you know!And finally our favourite mail from a long time user who'd disappeared for a while"I can't tell you how much I enjoyed reading V3I1. I enjoyed for the openness, and for the wit. Man, I've missed you guys! With Mike Ruane in charge, I might just come back."And he did...S/List 32 - For OI 4.x - Aaron Kaplan It's been a long time since I've had time to write for SENL. Because I know how much everyone cares, and I do it in most of my SENL articles, here's a quick overview of life in Aaron World. I spent most of January at the Emu's house in not-so-sunny Melbourne. Not so surprising, I found myself down under for the coldest summer on record. I have it on good authority that the weather cleared up the moment I left for home. Eric and family were most gracious hosts and showed me one of the best few weeks of my life. In other news, my faithful dog of 16 years passed away in October. For those of you who want to check out some pictures, she's at http://aiko.sprezz.com. My loss is the community's gain, since the last of my ties to a home are gone, so I'm out travelling around the world. We've been making a lot of changes to S/List over the last few months. Internally, we have a new interface, with a more modern wizard interface and UI. We were hoping to have all those in the next major release of S/List, but life is what happens while you're busy making other plans. The release of OpenInsight 4.0 in native 32 bit has been causing problems with S/List. I suppose it serves us right for being on the bleeding edge of OpenInsight technology and design. We've had to rush out a new version to run on OI 4, so now there's no reason to avoid upgrading before RTI's special upgrade price goes away. So, order now! Order a copy for your friends! Order a copy for your enemies! It makes a great stocking stuffer! The first set of changes to S/List involve the installation process. We've moved up to InstallShield 5 and can now use their PackageForWeb option to create a single EXE download. This also allows us to give you a warning about installing this on a 16 bit OI. It will not work, as OI16 can not read the new 32bit DLL's we've incorporated into S/List. We've also introduced build numbering to S/List so we can more easily tell what version of S/List you are running. However, the biggest change to the system is serialization. We've decided, for a variety of reasons, to require a registration key for installation. This key is available from us at slistinfo@sprezzatura.com. I wonder if anyone will be able to figure out who created all the bitmap images used in this article? The S/List workspace remains unchanged for this version so there will be no surprises there. however, we've made some modifications to the windows. Field definition windows in the report screens now show you the description as defined in the dictionary, and for those who like long dictionary names we've added horizontal scrollbars to the column name list boxes. We've also added support for legal sized paper for our US customers. We've enhanced the About window to show you the current S/List build version, your license key, and your user count values. User count will tell you the number of users you are licensed for and the number of users currently logged into the system. We've also added an update license field. Now, when you add users to your system, we don't need to send you a full copy of S/List, we can email or read you a license key over the phone. We've also fixed number of bugs and added some enhancements. Using {fieldname} in a HEADING statement is now supported. We've got some more fixes and enhancements coming out in the next version of S/List, which we expect to hit the shelves for the Vegas conference. We hope you've enjoyed this little marketing break on what's new in S/List. Next month's column is open for suggestions! Anyone with any ideas, any ideas at all on what I should write about, is more than welcome to mail us at Sprezz. We'll do what we can to honor your requests. Important Developer Warning Everyone knows that real programmers don't read the manuals but the OIPI manuals make a very important point which you ignore at your peril. It is YOUR responsibility to STOP32 when the application exits. Failure to do so will lead to errors on restarting OpenInsight and trying to reuse OIPI/SList. We'll talk about this in more detail at one of our Vegas presentations but hopefully RevSoft should have a fix in my then. Editorial - S/List Pricing We know that you'll be itching to know how much it will cost you to provide your users with a quality reporting tool like S/List. The simple answer is, next to nothing! Please contact sales@sprezzatura.com for a quotation for S/List. Hi All, I am the ‘New Guy’ at Sprezzatura. I am actually fairly new to the UK as I only moved over here from South Africa 8 months ago. My full name is Clinton Peter Krynie if that is in fact of any interest to anyone; By the way if someone out there has any clue where my surname comes from I would love to know! As is obvious from the previous statement I was born in and grew up in South Africa, but moved to the UK to experience a bit of a different lifestyle, like not being carjacked, not being mugged, not being warm etc. Everyone has to live in London at least once in his or her life! Coming here from Africa can be compared to Arthur Dent finding himself on a Vogon spaceship; I have been calm but very disorientated and cold! Luckily these people drive on the ‘correct’ side of the world like all civilised nations and speak the same language (or is that a Babel fish in my ear?). Actually London is a really cool place to live, there is always something going on, places to see and the rest of Europe is just a small hop away. For those of you who don’t know where South Africa is, it is at the Southern tip of Africa, just before you get to Antarctica. It is to the Left of Australia and to the right of South America. Another hint is that AFRICA IS NOT A COUNTRY IT IS A CONTINENT! The reason I explain it so carefully is due to previous experience explaining all this – apologies to those of you who already know this. I am also proud of the fact that right now South Africa probably has the most democratic constitution of any country (in complete contrast to its immediate past); unfortunately it also has the highest crime rate. I sincerely hope there is no correlation! My previous work experience is quite varied, I have coached swimming while at University, taught high school kids, worked as a general IT guy at a small company, moved on to programming and business analysis and now here I am working at Sprezz. As far as programming is concerned, I worked with Cobol way back and then moved into the general Pick world, which Revelation is (sometimes reluctantly). Basically anything to do with IT interests me to some extent, problem is that it all changes so fast it is quite difficult to keep up. My pet theory is that nothing much changes, the IT ‘leaders’ just keep changing the buzzwords and confusing us with techno speak. Logic is logic; algorithms are algorithms. I am not going regress into the whole ‘my favourite colour is’… routine. So from here on speak to me and I will give you answers; either about myself or other technical stuff that has something or other to do with my job. I think this was what Andrew was muttering, but maybe it was just the Babel fish playing up! Printing from AREV (DOS) to a network printer: Clint Krynie - Sprezz Tech Support Printing to a network printer from an AREV session running in Windows 2000 (I would imagine that Windows XP would be similar) can be a problem. I recently had this problem at Sprezzatura after purchasing a new HP Laserjet. Directly after installing the printer on the network server AREV programs could not ‘see’ the printer. After much head scratching and investigation I finally gathered these tips from all corners of the world. Mapping of LPT at command prompt:From the command Prompt, type NET USE and ensure that the LPT port is mapped. Even though Windows says that the printer is using LPT1, I still had to explicitly map the printer. The command to set the mapping is NET USE LPT1: \\SERVER_NAME\SHARED_PRINTER_NAME You might want to make that NET USE LPT1: \\ SERVER_NAME\SHARED_PRINTER_NAME /PERSISTENT:YES (to have it mapped all the time.) The printer may also prefer RAW data output from the DOS box, so check this option on the driver set-up, however be aware that this may affect the printers ability to print properly from Windows. Printer will not print all pages: The timeout of the spooler might also need to be adjusted either using REGEDIT or the system.ini REGEDIT: Try the registry value HKEY_CURRENT_USER\Network\LPT1 It can also be set as HKEY_USERS\S-1-5-21-1728650768-596203951-526660263-1006\Network\LPT1 SYSTEM.INI: Add or modify the following sections (found after the [386Enh] section) [Network] PrintBufTime=10 [IFSMGR] PrintBufTime=10 The entry in the [Network] section controls the network printing timeout using the real-mode redirector. The entry in the [IFSMGR] section controls the network printing timeout using the protected-mode redirector. By default these are set to 45 seconds. The description above is only of how we solved our particular problem at Sprezzatura, if it does not apply to your situation, look on the Microsoft support web site http://support.microsoft.com/ I have found the following articles at the Microsoft web site:
Although S/Web has been deployed in various places around the world for a couple of years, we’ve always been asked “where can I see an S/Web application running live”? We’ve directed people to some of our client’s web-sites (such as http://www.uia.org) but most of the reference sites have been on intranets or were password protected from non-customers. We’re pleased to report that finally the world’s first web site ENTIRELY drive by S/Web has gone live. What this means is that from the home screen on you are dealing with a web site served by S/Web. The site is that of one of our oldest clients (we’ve been dealing with the principals of the organisation since the mid-eighties) and can be found at http://www.mpr.co.uk. All of the work on the site was undertaken by Sprezzatura personnel, including the site design and graphics thus providing a “one stop” solution to MPR’s problems. The site is intended for researchers with an interest in non-classified military issues and already counts some of the world’s largest military academies as clients. As a non-registered subscriber you may do generic searches but the results will not contain details of the base reference point – thus enabling you to see what’s available but not actually look further without subscribing. So if you visited the site and typed “Bin Laden” into the “Look for:” box and pressed “Go” you’d see the following followed by the first screen of information The site also features full credit card transaction processing and people may subscribe in Pounds Sterling or Dollars US. If you are a subscriber you also have access to additional screens as the following shows :- Once logged in the user can modify various preferences including the length of their subscription.
and start an advanced search which brings back a paged result set Celebrity Interview - Bob Carten Who are you? Bob Carten, Revelation developer. Who do you work for? WinWin Solutions Inc, and through them, Revelation Software. What is your role in the RevSoft community? Consultant for WinWin Solutions, Trainer for Revelation Software, and grunt idea man for OI32. How long have you been involved with RevSoft? I first worked with RevG in about 1985, became a heavy user in about 1987, joined WinWin in 1998. Which products do you use? I work primarily with OpenInsight and JOI. I also use Visual Basic, vbScript, java, and transact-sql, primarily to interface OpenInsight with other products. I like to think of Microsoft Office and Internet Explorer as OpenInsight add-ons. What do you most like about RevSoft products? While you are solving a problem with Revelation software you can adapt the solution faster than your client can change the problem. Once you have solved a problem with Revelation products it stays solved. Revelation's core ideas -- delimited data storage, separate the meta-data from the data, bind both methods and properties to the data, use a late binding scripting language, treat scripts / programs as just another kind of data -- are all being embraced by today's mega-products, for instance the .Net architecture. Because Revelation products support a fairly simple coding style, I get the benefits of the mega ideas without encountering the complexity of software designed by committee or suffering the instability of software that is being 'churned' to keep customers paying for upgrades. What do you most dislike about RevSoft products? I love Arev, but reaching out from a DOS session to other devices gets harder and harder, reducing my ability to stay cost-effective. I think OpenInsight's developer tools, especially the table builder, are weak. Luckily, I get to address these issues. If you HAD to use another database what would it be and why? I HAVE had to use other databases, principally msAccess and SQLServer. I spent a few years on a large Powerbuilder / SQL Server project. I found that I was one of the more effective SQL coders because I used a very 'Revvy' approach to assembling data. At the end if that project I was qualified to sell my self as a senior SQL kind of guy for senior SQL kind of money. I chose to come back to Revelation because it is more fun and I am more effective and because I noticed a striking resemblance between the Dilbert story line and my SQL work experience. A common SQL application for me has been to build a data warehouse in SQL Server so that a client can hand off their web-site to some Microsoft house. Our latest XML tools combined with JOI or .Net components should obviate the need for these warehouses. What are your favourite 3 books and why? Ayn Rand - Atlas Shrugged. Disliked elitism, but liked idea of personal accountability for success Madeline L'Engle - I read "A Swiftly Tilting Planet" just after September 11. The book was a perfect description of the battle at hand. Nothing like curling up in bed with a nice thick, terse reference manual! What are your favourite 3 CDs/Albums and why? Recently took a 3 day car trip with my 8 year old son and the Shrek CD. After 30 hours of Eddie Murphy and Smashmouth I'm off CD's for a while. What are your three favourite films and why? These days my movie fare usually has 'Disney' in the credits. Thus, I judge a film by how short it is. What event in history would you most like to have been present at? I'm kind of enjoying the present. A confirmed coward, I want to be in a time when the force of ideas exceeds the force of arms. We live in such a time. And finally Your motto/witty aphorism From a fortune cookie: Nothing is accomplished without passion. Corollaries are: Attitude determines outcome, Discipline is the price of excellence; Disappointment is the reward for mediocrity OpenInsight for Dummies - Formatting Legacy Code - John Godfrey, Carys Consulting My experience of dealing with legacy code has convinced me that the best way of deciphering this stuff is to tidy it up first, by formatting the source code. As I am a terrible typist, even formatting completely new code using the Tab facilities in the editor, does not seem a particularly productive use of my time. Far better to feed the crudely typed code into a formatting engine which does all the hard work for me, and produces readable formatted code which I am not ashamed to use. In AREV, I used to use BLIST to output a formatted program to a text file, then import the formatted program back as nice tidy source code. I have not found a good replacement for BLIST in OI so I customised one, which was first written in SENL by Andrew. My incarnation of it is entitled FIX_CASE and is set out in the Appendices. Beware that it is not suitable for everyone as my prejudices may certainly not be the same as yours, but for what its worth this is what’s behind it. First of all the program saves the original source code in an archive Table entitled ARCHIVE. The key is the name of the source routine suffixed with a date and Time. The ARCHIVE Table must be created first of all. The program is not absolutely fail safe in that respect but perhaps someone would like to embellish it further. FIX_CASE then capitalises the initial letter of each variable or piece of syntax and saves the code. A second program (FLIST) is then called to indent the code and save it with a date and time stamp at the end. A trick I learned from another Sprezz warhorse - Aaron. NB. If you like programming your variables in a combination of Upper and Lower case then this program will destroy all you hard work, so don’t use it. I make my own variables stand out by using the underline character to split a variable name and make it comprehensible. E.g. In FIX_CASE the var name ProcessRecord is dumbed down to Processrecord unless you type in the name as Process_Record I consider a mixture of lower and upper case is desirable. The reason was first disclosed to me by a colleague who had studied ergonomics all his life. He told me that all road signs are written in upper and lower case so that they may be distinguished rapidly when driving along a fast flowing freeway or motorway. From a distance Liverpool looks like L---p----l displaying a visible pattern. This would not be so distinguishable if it were spelt completely in block capitals. If the principle holds good for road signs then it’s good enough for my code. FLIST had to be tweaked for OI as Char(10) and Char(9) are present which interfered with the formatting process. FLIST saves the source record with an @ prefixed to it so that the programmer can check it first before manually overwriting the original code. I wrote the FIX_CASE code so long ago I’ve actually forgotten how it works; but it seems to be an improvement on formatting every line within the editor. This article might strike a chord with someone, but don’t forget it is written by a dummy and so is not guaranteed in any way. Appendix 1 FLIST Subroutine Flist(Charstr File,Charstr Id) * Original Author AMcA * Date April 1990 * Revised JG 31 5 01 * Purpose To provide a format function for programmers to tidy up * source code * EG RUN FLIST 'TABLENAME','SUBROUTINENAME' Equ True$ To 1 Equ False$ To 0 Label = '' Gosub Set_Variables If Ok Then Gosub Initialise Gosub Process_Record Gosub Program_Or_Sub New_Record[1,1] = "" * Create new record and copy over manually once checked Write New_Record On Src_File,'@':ID Else Status = Set_Fserror() Call Msg(Status,'','','') End /* When you are very brave you may overwrite the existing code otherwise use the Write Control above and copy your code over manually. Write New_Record On Src_File,Id Else Status = Set_Fserror() Call Msg(Status,'','','') End */ End Else Call Msg(Message,'','','') End Return Process_Record: *************** Loop Next_Line = Trim(Record[1,@Fm]) Record[1,Col2()] = '' If Next_Line Then Gosub Process_Line If Dec = True$ And Indent >= Tab Then Indent -= Tab Dec = False$ End If Left_Margin = True$ Then Indent = 0 If Insert Then New_Record := @Fm End New_Record := @Fm :Space(Indent):Next_Line If Inc = 1 Then Indent += Tab Line_Counter += 1 End While Record Do Inc = False$ Dec = False$ Left_Margin = False$ Insert = False$ Repeat Return Initialise: *********** New_Record = '' Header_Done = False$ Old_Ind = Indent Dec = False$ Inc = False$ Left_Margin = False$ Insert = False$ Line_Counter = 0 Last_Line = "" Remarks = 1 Construct = 0 Return Program_Or_Sub: *************** Next_Line = Record[1,@Fm] Record[1,Col2()] = '' First_Word = Next_Line[1,' '] Convert @Lower.Case To @Upper.Case In First_Word If New_Record Then Gosub Process_Line End Else New_Record := @Fm : Next_Line End Return Process_Line: ************* Orig_Line = Next_Line Next_Line = Trim(Next_Line) Old_Line = Next_Line If Not(Index("!*",Next_Line[1,1],1)) Then Header_Done = True$ If Remarks = 1 Then * At the end of a Remark so reset Margin Indent = Margin End Remarks = 0 End Tmp = Next_Line Convert @Lower.Case To @Upper.Case In Tmp Last_Word = Tmp[-1,'B '] First_Word = Tmp[1,' '] Second_Word = Tmp[2,' '] If Index(Last_Word,"*/",1) Then Header_Done = True$ End If Trip Then Inc = 1; Trip = '' Begin Case Case Index("!*",Tmp[1,1],1) And Not(Header_Done) * Header comment, leave at left margin Left_Margin = True$ Next_Line = Orig_Line Old_Ind = Indent Case Index("!*",Tmp[1,1],1) * Header comment, sET TO left margin If Tmp[1,2] = '**' Then If Index(Last_Word,"*/",1) Else Left_Margin = True$ Inc = 1 End End Next_Line = Old_Line Case Num(Tmp) Or (Tmp[-1,1] = ":" And Tmp = First_Word) * Header comment, leave at left margin If Len(Tmp) Then Left_Margin = True$ Inc = 1 End Else Indent = Margin Insert = True$ Label = 1 Case Tmp[-1,1] = ":" * Header comment, leave at left margin Left_Margin = False$ Inc = 1 Case Tmp = 'END ELSE' Dec = True$ Inc = True$ Construct = 1 Case Tmp = "END CASE" Dec = True$ Indent -= Tab Construct =0 Case Index("END",First_Word ,1) Dec = True$ Case Index("-ELSE-LOOP-THEN-UNTIL-WHILE-","-" : Last_Word : "-",1) Inc = True$ Construct = 1 Case Index("-END-REPEAT-NEXT-","-": Last_Word : "-",1) Dec = True$ Case Index("-UNTIL-WHILE-","-" : First_Word : "-",1) Dec = True$ Inc = True$ Construct = 1 Case Tmp = "BEGIN CASE" Inc = True$ Construct = 1 Case First_Word = "CASE" And Last_Line = "BEGIN CASE" Inc = True$ Case First_Word = "CASE" Inc = True$ Dec = True$ Case First_Word = "FOR" Inc = True$ Construct = 1 Case First_Word = "LOOP" Inc = True$ Case First_Word[1,6] = "RETURN" If Construct = 1 Else If First_Word = 'RETURNED' Else Left_Margin = True$ Dec = 1 End End Case Index("-STOP-ABORT-ABORT ALL-","-" :Tmp : "-" ,1) Left_Margin = True$ Construct = 0 Case First_Word = "NEXT" Dec = True$ Construct = 0 End Case If Last_Line[-1,1] = ":" Then If Next_Line[1,1] # '*' Then New_Record := @Fm:Str('*',Len(Last_Line)) End Else Next_Line = Str('*',Len(Last_Line)) End End Last_Line = Next_Line Convert @Lower.Case To @Upper.Case In Last_Line Return Set_Variables: ************** Ok = False$ Add_On = '' Count_Returns = 0 Trip = '' Open File To Src_File Then Record_Id = Id Read Record From Src_File,Id Then Convert Char(10) To '' In Record Convert Char(9) To '' In Record Margin = 3 Tab = 3 Indent = Margin Ok = True$ Lines = Count(Record,@Fm) + (Record # "") End Else Message = "Unable to read " : Id End End Else Message = "Unable to open file " : File End Return * Tidied On 13:44:26 04 JAN 2002 By JG
Appendix 2 - FIX_CASE Compile Subroutine Fix_Case(Table,Row_Id) Declare Subroutine Msg,Rtp29,Namecap Declare Function Fncount /* Invoke from Exec Line by Typing eg. RUN FIX_CASE 'TABLENAME','SUBROUTINE' eg. RUN FIX_CASE 'SOURCE','NAMECAP' */ Comments = 0 If Row_Id = '' Then Msg("Incomplete Command");RETURN Gosub Open_Table Convert Char(10) To '' In @Record Convert Char(9) To '' In @Record Gosub Action Gosub Final_Tidy Newrecord<-1> = "* Tidied On ":Timedate():" By ":@Username Write Newrecord On Htable,'@':Row_Id Else Msg() Write Newrecord On Htable,Row_Id Else Msg() Call Flist(Table,Row_Id) Return Action: Newrecord = '' Toggle = 0 Done = 0 Tab = '' T_Rws = Fncount(@Record,@Fm) Idle = 0;* Tidycase Start Or Return For I = 1 To T_Rws Before = Len(@Record<I>) Line = Trimf(@Record<I>) After = Len(Line) Tabcols = Before-After Line = Trim(@Record<I>) Newline = Line If Line[1,1] # "*" Then Gosub Namecap If Line[-2,2] = "*/" Then Idle = 0 Newline = Trim(Newline) Newrecord<-1> = Tab:Trimb(Newline) Next I Return Namecap: * Rtp29 Trims Which Screws Up Formatting So Split Int A & B A = '';B = '' If Line[1,1] = ' ' Then Gosub Splitter End Else B = Line * CALL Rtp29(B,Converted,'') Convert ' ' To @Fm In Line Convert @Vm To ' ' In Line Swap '(' With @FM:'(' In Line Swap ',' With @FM:',' In Line Newline = A Pos = 0 Lastchar = 0 * Loop Thru The String * Sq = 0; Dq = 0 Loop Remove Oldword From Line At Pos Setting Flag Ans = Index(Oldword,"'",2) Ans = Index(Oldword,'"',2) Begin Case Case Index(Oldword,"'",2) Newline: = OldWord:" " *msg('single ':oldword) Case Index(Oldword,'"',2) Newline: = OldWord:" " Case Index(Oldword,'"',1) If Dq = 1 Then Dq = 0;Idle = 0 End Else Dq = 1;Idle = 1 Newline: = Oldword:" " Case Index(Oldword,"'",1) If Sq = 1 Then Sq = 0;Idle = 0 End Else Sq = 1;Idle = 1 Newline: = Oldword:" " Case 1 If Oldword[1,2] = '/*' Then Convert ' ' To @Vm In Oldword Newline: = Oldword:" " Idle = 1 End Else * Outside Quotes So Namecap @Ans = Oldword If Idle = 0 Then Namecap(Oldword) * New Word = Oldword Gosub Tidycase End End Case If Index(Oldword,"*/",1) Then Idle = 0;DEBUG While Flag Repeat Swap '(' With '(' In Newline Swap ',' With ',' In Newline Swap ' (' With '(' In Newline Swap ' ,' With ',' In Newline Return Splitter: L = Len(Line) J = 0 Loop J+ = 1 Char = Line[J,1] While Char = ' ' Repeat A = Str(' ',J-1) B = Line[J,L] Return Tidycase: L = Len(Word) Oldword = Word * Make Uppercase Anything After These Chars:- * Chars = "#$()_.@<>:[;/,*+- = " For X = 1 To L Char = Word[X,1] Ans = 0 Ans = Index(Chars,Char,1) If Ans > 0 Then Nextchar = Word[X+1,1] Convert @Lower.Case To @Upper.Case In Nextchar Word[X+1,1] = Nextchar End Next X Newline: = Word:" " If Index(Word,') = ',1) Then Newline: = " " Return Final_Tidy: **Impose Your Prejudices Here** * Hide < = & = > = <> = * Swap "< = " With "<." In Newrecord /* Swap " = <" With ".." In Newrecord Swap " = >" With ".>" In Newrecord Swap "+ = " With "+." In Newrecord Swap "- = " With "-." In Newrecord Swap ": = " With ":." In Newrecord Swap " = " With " = " In Newrecord Swap "('" With "('" In Newrecord Swap ":'" With ":'" In Newrecord * Reveal < = & = > = <> = Swap "<." With "< = " In Newrecord Swap ".>" With " = >" In Newrecord Swap "+." With "+ = " In Newrecord Swap "-." With "- = " In Newrecord Swap ":." With ": = " In Newrecord */ *Swap " *" With " * " In Newrecord Swap "/*" With "/*" In Newrecord Swap "*/" With "*/" In Newrecord Swap "**" With "**" In Newrecord */ *Swap " *" With " * " In Newrecord Swap "/*" With "/*" In Newrecord Swap "*/" With "*/" In Newrecord Swap "**" With "**" In Newrecord Swap " = " With " = " In Newrecord Swap " = " With " = " In Newrecord Swap " = " With " = " In Newrecord Swap ")" With ")" In Newrecord Swap "(" With "(" In Newrecord Swap "," With "," In Newrecord *Swap ",'" With ",'" In Newrecord *Swap "," With "," In Newrecord Swap ";" With ";" In Newrecord Swap ":" With ":" In Newrecord * Swap " '" With "'" In Newrecord - Removed As Affects Quote Scripts **End Of Prejudices** Return * Tidied On 15:45:57 02 MAR 2000 By ZHLWB *Indenter: If Toggle = 1 Else Indent = 1 Begin Case Case Newline[1,' '] = "Subroutine" Indent = 0 Case Newline[1,2] = "/*" Idle = 1 Indent = 0 Comments = 1 Case Newline[1,1] = "*" * Indent = 0 Case Newline[-1,1] = ":" Indent = 0 Case Newline[-1,"B " ] = "Return" Indent = 0 Case Newline[-1,"B " ] = "Stop" Indent = 0 Case Newline[1,4] = "Case" Toggle = 1 Case 1 Indent = 1 End Case If Newline[-2,2] = "*/" Then Indent = 0; Comments = 0 Idle = 0 End Newline_Tmp = Trim(Newline) X = Index(Newline_Tmp,"End Case",1) If X Then Toggle = 0; End Return Open_Table: Open Table To Htable Then Read @Record From Htable,Row_Id Then Arc_Id = ROW_ID:'*':OCONV(Date(),'D2-E'):'*':OCONV(Time(),'MT') Open 'ARCHIVE' To H_Archive Then Write @Record To H_Archive,Arc_Id Else Msg() End Else Msg(row_id:' MISSING FROM ':table) End * Delete HTABLE,ROW_Id Else msg() End Else Msg(row_id:' MISSING FROM ':table) End End Else Msg(Table) Return Tidied On 12:13:07 03 JAN 2002 By JG A Question of Style - Carl Pates Recently we were asked how to add a minimize button to a form when it was created using the Dialog frame style. The idea was to keep the standard 3D look but to add in the minimize functionality which the Dialog style removes. (The other option that could have been used here was a form with a Thin-frame style, but although that has Minimize functionality it has a very different look, and in this case, undesirable) So, there are 2 issues to look at here: 1) Getting the window to draw the minimize button on the caption bar 2) Responding to the button click to minimize the window The first requirement is not too difficult and merely involves altering the form’s STYLE property to add the button. This is done by adding the WS_MINIMIZEBOX style bit like so: equ WS_MINIMIZEBOX$ to 0x00020000 winStyle = iconv( get_Property( @window, "STYLE" )[3,\00\], "MX" ) winStyle = bitOr( winStyle, WS_MINIMIZEBOX$ ) winStyle = "0x" : oconv( winStyle, "MX" ) call set_Property( @window, "STYLE", winStyle ) This should probably be done on the form’s CREATE event and before the form is made visible. That was the easy bit – the problem now is that although we have our button nothing happens when it’s clicked so the next job is to find out how to respond to that. For this we used a tool like Microsoft’s Spy++ to watch what messages were being passed between the button and it’s parent form and we found was that a WM_NCLBUTTONDOWN was sent to the parent form that tells it when the user has clicked on the non-client area of the window (in this case the caption bar). Also, we could see that the wParam of this message was set to HTMINBUTTON when the minimize button was clicked, so armed with this we can do the following: 1) Trap the WM_NCLBUTTONDOWN message in a WINMSG event on the button’s parent form. 2) Check if wParam is HTMINBUTTON and if so set the form’s VISIBLE property to 2 (minimized) First we need to tell OpenInsight to trap the message which we do with the QUALIFY_EVENT message in the form’s CREATE event equ WM_NCLBUTTONDOWN$ to 0x00A1 call send_Message( @window, “QUALIFY_EVENT”, WM_NCLBUTTONDOWN$, 1 ) Then we create a WINMSG event handler for the form that contains the following: equ WM_NCLBUTTONDOWN$ to 0x00A1 equ HTMINBUTTON$ to 8 begin case case ( message = WM_NCLBUTTONDOWN$ ) // The user has clicked in the caption bar if ( wParam = HTMINBUTTON$ ) then // User has clicked the minimize button call set_Property( @window, “VISIBLE”, 2 ) end end case … and there we have a working form that has a minimize button but cannot be resized. Enjoy! The OpenInsight Repository - Part 2 - Andrew P McAuley In the last issue of SENL we dealt with the underlying structure of the repository and in this issue we conclude the discussion by documenting the primary methods associated with the repository, all instantiated via the REPOSITORY function. In earlier times the extensibility of the repository seemed to provide an ideal framework for developers to expand within. Developers can extend the repository to include their own components and tools – witness the way in which S/List integrates into the repository The developer can also develop custom methods to support these repository extensions but for now we will content ourselves with looking at the standard repository methods. The syntax of the REPOSITORY function is Result = Repository( Method, EntityId, Param1, Param2, … Paramn) Object = Repository( Method, CtrlEntId ) Used to retrieve the body of a repository entity. So if for example you wished to read an S/List report you would use code as follows :- ReportName = @AppId<1> : “*OIREPORT*SLISTLAYOUT*” ReportName := “REPORT_FOR_SENL” SlistReport = Repository(“ACCESS”, ReportName) CLEARFLAGRetVal = Repository(Method, CtrlEntId, Type, Tree) Used to reset the evaluation and compilation flags for an entity in the repository. Type can be 0 Clear both 1 Clear evaluation flag 2 Clear compilation flag Tree is a Boolean indicating whether the corresponding flags in the components using this component should be reset (the “Supers”). Used to compile an entity. The COMPILE method is polymorphic taking different parameters based upon the entity being compiled. RetVal is a field mark delimited array containing the compilation status in field 1 and an optional date time in field 2. 1 Compilation not needed 2 Compilation date/time For Windows is a Boolean indicating that tidying up of orphaned events should be undertaken. For Stored Procedures is a field mark delimited set of IFDEF definitions. Param3For Stored Procedures is a Boolean indicating whether line marks should be kept. COPY RetVal = Repository(Method, Destination, Source) Used to make a copy of an entity. RetVal = Repository(Method, EntityId, Param1) Used to launch the appropriate tool to edit the entiry. Param1 is the name of the Parent window and is used for AppNotes, Connections, DataSets, Messages and Popups. DESTROYRetVal = Repository(Method, EntId) Used to destroy (delete) an entity and it’s repository entry. EXECUTERetVal = Repository(Method, EntId, Param1, Param2, Param3…..Param20) Used to execute a repository entity. The EXECUTE method is polymorphic taking different parameters based upon the entity being compiled. STPROC and STPROCEXE just pass the parameters through, up to 20. Param1For MMEDIA.AUDIO and MMEDIA.WAVE Boolean flag indicating whether to play sound then return or play and return immediately. For WINEXE a command line parameter string For APPNOTE, MSG and POPUP the parent window name ForWINHELP a field mark delimited dynamic array with <1> The name of the current window <2> The command to pass Windows help <3> The associated information For OIREPORT.RDLAYOUT any command line parameters Param2 |