Ben Langhinrichs

Photograph of Ben Langhinrichs

E-mail address - Ben Langhinrichs







Recent posts

Thu 17 Sep 2020

Exciton Boost - WYSI(hopefully)WYG



Tue 15 Sep 2020

Exciton Boost - Formula(s) for success



Tue 15 Sep 2020

Pushing harder at the limits of formulas


September, 2020
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 29 30

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