A new article, the second tip and some news
Ok, so I promised at least one article for every month of this year. Well, here's January covered. Debugging JavaScript in Your Applications. It's a rewrite of an old article on the same subject. This new one takes it all a little further; describing how to call the debugger and how to use it to debug more effectively. If you use alert boxes to debug your JavaScript then you really should read this.
Today's tip is a simple one to save space. It's about an enhancement to the @DBLookup function in Domino 6. Have you ever used code like this to handle @DBLookup errors?
tmp := @DBLookup( ""; ""; "myView"; "myKey"; 2);
@If( @IsError( tmp ); @Return( "" ); "");
tmp
In Domino 6 there's no need to. The DBLookup function has a new optional argument called [FailSilent]. If you include this in your code, as below, the code will return "" instead of throwing a paddy. Brilliant! If you're in the process of upgrading to 6 then you can get rid of some code whilst you're at it.
@DBLookup( ""; ""; "myView"; "myKey"; 2; [ FailSilent ]);
Finally, a bit on LotuSphere. I am attending as guest of the makers of PeerWire - "Peer File Sharing for Lotus Developers". As soon as I know the booth number I will let you know where you can find me. If any of you want to actually arrange to meet, feel free to get in touch.
Hey Jake,
Thanks for bringing the @dblookup up. I was just noticing last night that @dbcolumn in R6 seems to fail silently by default (which is odd). I was just getting ready to investigate this morning... thanks for saving me some time.
Can someone explain "throwing a paddy"? I'd guess it means like "throwing a fit" in US, but where does "paddy" come from?
Well it could mean:
\Pad"dy\, n.; pl. Paddies. [Corrupted fr. St. Patrick, the tutelar saint of Ireland.] A jocose or contemptuous name for an Irishman.
That's not how I meant it though. Now I think about it I wonder if anybody at all knows what I am talking about.
You're right though. I meant having a fit. Throwing the toys out of the pram etc.
PeerWire's booth numbers are #709 and #710 :)
from peerwire website : "PeerWire partners with CodeStore.net
12/02/2003: PeerWire has joined forces with the popular CodeStore.net site to add an extensive and searchable library of how-to articles and other helpful tips."
What is it exactly ?
Jake, what's a pram?
I'll be sure and stop by the booth to meet you!
Off to Lotusphere you lucky chap! I went back in 1997 when there were over 10,000 attendees, oh what a week :)
On the Paddy front, not sure where it came from but a Paddy Wagon is an old term for a Police Van, maybe it started as "thrown in a paddy?"
You should also mention the other new feature, @IfError. It comes in handy when you want to set the value to something other than "".
tmp := @IfError(@DBLookup( ""; ""; "myView"; "myKey"; 2);"No Match Found");
I like the short cut code, but along Niel's line of thought, I rarely want to return an empty string, but a more descriptive error message (either a system generated message or a custom message.
It would be cool if the code could work as such:
@DBLookup( ""; ""; "myView"; "myKey"; 2; "<my Error Message>");
The new parameter I really like is
[RETURNDOCUMENTUNIQUEID] !
Tom: A Pram is a stroller. I learned some things from my Trini family:-)
Now for Paddy Wagon:
Americans took to calling all Irish "Paddy" when they began to arrive in large numbers in the middle of the 19th century. (The term was far from complimentary, in many circles considered it was (is) considered derogatory.) Unfortunately, many of the more raucous Irish developed a reputation for running afoul of the law and were hauled away in what was officially a "Police Patrol" vehicle but took on the name "paddy wagon".
from:
{Link}
Hi Jake,
late but I must say this. PeerWire has one of the best Domino websites I have ever seen, both for Design as of Content. Very, very nice. If everything from PeerWire has such a high quality standard they hopefully will have a bright future.
Have fun at Lotusphere.
Cheers
Heini
Throwing a Paddy means to lose your temper. The saying began in the 1800's when English invaders regarded Irish people as being below their intelligence and as being a less civilized.
The way became to compare acts of unsociable behavior with the Irish. Anyone who became angry or distressed would therefore be throwing a paddy