Ben Langhinrichs

Photograph of Ben Langhinrichs

E-mail address - Ben Langhinrichs







Recent posts

Thu 18 Feb 2021

Getting the point(s) across with Domino, O365, and Outlook365



Mon 15 Feb 2021

Exciton Boost 4.6.3 released



Mon 1 Feb 2021

REST plus RPC: storing actions as JSON or JavaScript


February, 2021
SMTWTFS
 01 02 03 04 05 06
07 08 09 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28

Search the weblog





























Genii Weblog

Sometimes your own dogfood tastes good

Wed 13 Jul 2005, 02:36 PM



by Ben Langhinrichs
While I don't much like the phrase "eating your own dogfood", the concept is good.  Any software developer should use his or her own software on a regular basis.  Sometimes that is a nuisance, but sometimes, like today, it is a pleasure.  I realized that our Web Editors page had lots, as in 285, URL links, and that many of them had a target of "_top" to replace the current page, when I wanted them to have a target of "_blank" to create a new page.  I changed about ten by hand, got bored, and wrote a quick Midas script which took care of them all in about 5 seconds (plus the five minutes it took to write).  Here is the code:

Call rtitem.ConnectFormBody("", "showcase.nsf", "WebEditors")
Set rtchunk = rtitem.DefineChunk("URLLink 1")
While rtchunk.Exists
   target = rtchunk.GetTargetProperties("URLLink", "Target")
   If target <> "_blank" Then Call rtchunk.SetTargetProperties("URLLink", "Target='_blank'")
   rtchunk.GetNextTarget
Wend
rtitem.Save
Messagebox("Fixed up all " & rtitem.Everything.GetCount("URLLink") & " URL hotspots")

See, your own dogfood can taste good, once in a while.  Of course, I could have written it more simply and efficiently, I now see, with:

Call rtitem.ConnectFormBody("", "showcase.nsf", "WebEditors")
Set rtchunk = rtitem.DefineChunk("URLLink *")
Call rtchunk.SetTargetProperties("URLLink", "Target='_blank'")
rtitem.Save
Messagebox("Fixed up all " & rtitem.Everything.GetCount("URLLink") & " URL hotspots")

which runs in about a second and a half, but in either case, it sure beats going to each hotspot manually.

Copyright 2005 Genii Software Ltd.

What has been said:

No documents found