Diary of a Mac Virgin

Basically the idea is to document my experience of getting used to a MacBook with OS X Tiger and familiarise myself with Blogger at the same time. That's right, I've never blogged before either.

Sunday, October 15, 2006

Day 11 - Smultron Hash

I had a little programming job to do this morning and given that I now have a usable FTP client I decided to try doing it on the Mac instead of the PC. Downloading the files I wanted to work on was no problem but it didn't go too well after that.

The first thing was that I needed to comment out a couple of lines of PHP code; so, I reached for the hash key... erm, guys? The hash key?

No hash key on the MacBook! Now I know I can use // but, although I'm no great fan of UNIX (I can type), I do follow the principles of Tai Chi where possible and see no point in using two characters to comment out a line of code when one will do. Surely it had to be on here somewhere?

A quick web search told me that alt-3 is the answer, and here's one to prove it: #

Lots of other 'special' characters are also available in this manner however remembering which is which could be rather difficult if you needed many of them. I guess however that most people will only need two or three of them. In my case © (alt-G), ~ (alt-N) and ˚ (alt-K) in addition to the # (alt-3).

Interestingly, while there is no indiation on the keyboard of the availability of these characters, alt-2 is used to access the Euro currency symbol and this IS clearly marked on the keyboard! Perhaps Apple know something about British politics that we don't?


A bigger problem, big enough in fact to cause me to switch back to the PC, came when I wanted to find where a particular variable was being used in the code. Typing the name into Smultron's "Live Find" immediately moved to the first occurrence but pressing Command-G, as described in the Smultron help, would not take me to the next occurrence. I re-read the help, searched on-line, but couldn't find any information to solve the problem. Alas this wasn't getting the job done so I switched back to the PC.

After finishing the work I came back to the Mac and fiddled some more; but I still couldn't get it to work. It seemed really odd that I couldn't find any mention online of what seemed to me to be a real pain in the bum of a bug.

In the end I emailed the author of the software and was very please to received a reply only a few hours later with a simple solution to my problem: the cursor needs to be in the main text for Command-G to work. Thus if you type something into the "Live Find" and the first occurrence that it finds is not the one you want, you need to hit 'tab' to move the cursor into main text. You can then Command-G to find the one you want. Simple!

The author did also mentioned that: "it has a slight bug which can return focus to the live find field under certain circumstances, this is fixed in the next version which will be released within a few days".

So, at the end of the day I'm a happy bunny. :-)

0 Comments:

Post a Comment

<< Home