Sunday, 17 May 2009

Some history, - in the beginning - - -

Way back in the days of the ZX Spectrum (over 25 years ago now) I was shown the basics of programming by the teenage sons of a colleague. It occurred to me that this would be an ideal way of pricing picture frames. Upto that point we had used a 2 way table - add the horizontal and vertical measurements together, then go down a column adding in the various items. This, of course regularly produced mistakes in the addition and the customers, looking at the long list charges, often wanted to know what each item was. The new simple program for the Spectrum solved all this, after a few key presses the price appeared on the screen, and the customers said "Yes please". I think I must be one of the few people who used the Spectrum for business rather than games!

For those who don't know of the Sinclair ZX Spectrum it was about the size of today's tablet PCs. It plugged into a TV and stored its programs on a cassette tape. The weakness was its keyboard, the rubber membrane kept giving up. After I got through 3 we bit the bullet and bought a PC (about £1000 20 years ago). This meant the program was rewritten in GW Basic and then with the coming of Windows 3.1 -QBasic. With each rewrite extra features were added.
There was none of the pretty interface of today, and the mouse was superfluous. To change the parameters you edited the program code directly (not quite the problem it appears as QBasic was bundled with Windows 3.1). It did show the way, however, so when I got hold of VB6 it was a revelation - you could, with a bit of work, produce a program that looked professional, was reliable and could easily be packaged for other people's computers.

The result was what came to be the original Wessex Pricing Program (wpp1). I took the CD along to the Spring Fair to show Wessex Pictures, and the rest, as they say, was history (actually it was the start of a steep learning-curve which is still going on).
The proof of the pudding is that the program is still regularly sold by Wessex.
More recent history will be covered in another blog.

nb. There is an update for wpp1 to allow for the increase in moulding costs since the CDs were originally printed - go to www.wessexpictures.com.

Wednesday, 6 May 2009

Troubleshooting bulk update


Wessex Premier is able to perform a bulk update on Wessex & Frinton moulding records. It's very useful to, say, add all the mouldings from Wessex (as, after all, you can order just one length with your weekly delivery). But as the list consists of somewhere in the region of 1300 records this is where the update-from-file comes in.

The program has proved to be very reliable in this area (you download the update files from the www.wessex.com, tell the program whether you want to just update the existing records or to update and add everything else, then navigate to the downloaded files and press go).

One point to note is that Wessex & Frinton share some mouldings (actually over 200), these are the "WFxxx" and "PWxxx" ranges. So, if you already have them listed under (say) Wessex when you update the Frinton section the program will report that it cannot add duplicate records.

Any problems that have arisen have always been to do with the update file itself. These files are in "Excel" format and are prepared by hand at Wessex, so one problem has been where an expected value hasn't been entered (usually the price has been left blank). Now, whilst the program updates now have more code to cope with this, it can cause the bulk update to stop.
The answer is to open the file with Excel and look for the blank values and then either - delete the line, or - put in a sensible value, save the file and rerun the bulk update. 9 times out of 10 this fixes the problem.
However, we did have one brainteaser where there was a whole blank line at the end of the file!
So that blank line had to be deleted, very strange getting your head around deleting something that wasn't there!

Wednesday, 22 April 2009

Designing the Wessex Premier GUI

A program can be amazingly sophisticated but unless the user can easily operate it then it's pretty useless. This is where a well designed GUI (graphical user interface), or in other words a good looking, easy to understand main form comes in.

The Wessex Premier main form is that shape because it is logical to start entering data from the top and with each new type of data continue downwards, finishing with what we all want to know - the total price.
Also it is important to stop the operator accidentally entering data that the program does not expect. For instance the top two size boxes will only accept numbers or a decimal point. The moulding boxes will only allow upto 5 characters (the maximum allowed for a moulding ID.) plus lower case letters are converted to upper case.
Next to the total price button is shown the quantity. Which is a numeric up/down control, numbers are changed using the small arrows rather than allowing the operator to enter them directly.

Those Visual Basic aficionados amongst you will have noticed that the buttons have a non-standard appearance. This is achieved programmatically rather than using bitmaps - the same goes for the graded background. The total effect is (I think) one of good design which helps promote intuitive usage as well as looking right in a sophisticated retail environment.

Whilst the most used part of the program is designed to be as quick & simple to use as possible, other parts the GUI is used to slow down the operator and give them pause for thought. One example is saving of the Options form.
It is purposely meant to be slightly out of the ordinary so the operator has to pause to decide what's going on, and in doing so may save themselves from making a mistake.

Of course what is invaluable is being able to test the program in a real environment with operators who don't really care how it works, just as long as they don't get into a mess with it! Here, the most lowly member of staff is as important(if not more so) than any number of "experts", because they are the ones who will produce the combination of keystrokes and mouse clicks that these experts haven't even conceived of!

Monday, 20 April 2009

Optimizing for Vista

It's taken quite a long time to get my hands on a computer capable of running Vista, a couple of months ago I managed it.
The obvious thing to do was to check that all the Wessex Programs worked. They did - WPP1 & WPP2 (written in VB6) had no issues. WPP3 however threw up a couple of interesting things.
The first was the graded colour background to many of the forms which finished (in Vista) before the bottom border. This is because the Menu & border widths are smaller in Vista, so I had to find code that would allow for XP & Vista. This turned out to be (instead of hard-coding for the physical width of the menu & border) to use "Me.DisplayRectangle.Height".
The 2nd issue was when opening another program (PDF reader or Media player) an error message appeared saying no application was associated with the process - the application then went on to open correctly! Annoying or what?
After a bit of digging I found the answer in "VB 2008" published by Wrox (it also applied to VB 2003 that WPP3 is written in). It was to add 1 line of code -
" myProcess.StartInfo.Verb = "Open"" It works without this line in XP, why does it need it in Vista?
Along the way I also tried a preview of the upcoming Windows 7 (Vista as it should have been) and found the programs were fine with that too.
So - Wessex now have the modified WPP3 (version 3.2.1) and all's well ?!

Saturday, 18 April 2009

View of Programs

The original Wessex Pricing Program(WPP1)


Wessex Pricing Program Advanced (WPP2)



The main form of Wessex Premier (WPP3)


.