Mark Alexander Bain's Blog

Sep 17, 2009

Posted by Mark Alexander Bain

There is no direct way to work out how many arrays there are in a VBScript multidimension array, however a simple VBScript function will do the job:

Function dimensions (inarray)

On Error Resume Next

Dim dims: dims = 0

Dim dim_check

Dim i: For i = 1 to 32

dim_check = ubound(inarray, i)

If Err.Number = 0 Then

dims = dims + 1

End If

Next

dimensions = dims

End Function

There's more on VBScript multidimensional arrays in Using Multidimensional Arrays with VBScript: How to Work with More than One Dimension in VBScript Programming.




Oct 23, 2008

Posted by Mark Alexander Bain

I've been a long time fan of Notepad++, in fact I've just used it for the Javascript coding for An Introduction to Dynamic HTML with Javascript; however, I've always felt it's been lacking one thing - a word count. Turns out that I've just been looking in the wrong place.

To carry out a word count in Notepad++:

  • select all of the text (by pressing Control-A)
  • click on TextFX (on the menu bar)
  • then click on TextFX Tools
  • and then Word Count

and that's all there is to it.

Now if I could just get Notepad++ to work on my Jornada 720....


There is a Word Count in Notepad++, Mark Alexander Bain
There is a Word Count in Notepad++, Mark Alexander Bain
     


Sep 13, 2008

Posted by Mark Alexander Bain

Well, that's my first day as the Computer Programming Feature Writer over and done with; and how much writing have I done? Absolutely none. Why? Because the MOT (the UK's Ministry of Transport annual test certificate) is due on my kit car - a 2.6 V6 Eagle Jeep. So instead of writing I've become a expert on hazard warning lights (which had stopped working).

The symptoms were quite simple:

  • indicators worked normally with the hazard warning switch off
  • indicators switched off when the hazard warning switch turned on, but nothing else happened

The cabling, engine and gearbox for the Eagle Jeep are from 1971 Ford Granada, and as such the hazard warning lights are quite simple:

  • all of the wires for the indicators go into the hazard warning switch
  • the indicator relay switch is connected to the hazard warning switch
  • there are connections from the ignition and the the battery are also connected to the hazard warning switch

And, after most of the day trying to follow the wiring I was none the wiser; which is when Maplin came to the rescue - a quick trip into Peterborough, and an hour and £14.99 later I had a brand new Maplin's multimeter; and ten minutes after that I found that the permanent live for the switch wasn't actually permanent. Which just goes to show - save yourself a lot of time and effort by making sure that you have the right tools at hand.

So, it's not been a Computer Programming day, but at least it's been a technological one.