« Teaching an old dog... | Main| Developers, like lawyers, should not ask questions they do not know the answer to »

A development tip, and more

I recently inherited an application from someone who inherited it from someone else.

It reminded me of something I discovered back in the R4 days: When you copy and paste a field multiple times, Notes takes the original field name and then adds an underscore and a sequential number (as in Product, Product_1, Product_2, etc.).  The problem comes when you have to loop through each field -- and who hasn't had to do that?  What you get is something like this:

For x = 0 To 15
                If x =0 Then
                        newDoc.Product = doc.Product(0)
                Else
                        newDoc.replaceitem( "Product_" + Cstr( x ) ) = doc.getitemvalue( "Product_" + Cstr( x ) )
                End If
        Next

Which is horribly inefficient. All right, you can make it better by putting the first clause outside the loop. But still...

So here's the tip: Go back to the first field and rename it with an underscore and a "0," as in Product_0.  Now just do the loop with no "if."  Using a tool like  Ytria's scanEZ, you can change the documents in your database without writing a one-time agent.

And now for the "and more" segment of this post: I just got a new car (a Mini Cooper S hardtop)! And I'm just amazed at how technology in cars keeps changing.  My whole car is a hands-free headset!  When I get into the car, it says "hello" to my BlackBerry.  And, when a call comes in, radio is automatically turned down, and the call is put through to all 8 of my speakers. So cool.

While we're on the subject of ever-improving technology, have you seen what Teamstudio has done with DDE since 8.5.2?  CIAO!, our source code control product, is now beautifully integrated into the Designer navigator.  You get a nice little icon to tell you that CIAO is watching your design elements for changes. And it gives you a nice little check mark when you have an element checked out to make changes.  It also shows you if someone else has it checked out. I think you'll like it. Send a note to contactus@teamstudio.com, or go to http://www.teamstudio.com for more information.

Category

Comments

1 - Or you can do like this:

ForAll i In doc.Items
If InStr(i.Name,"Product")>0 then
Call newdoc.ReplaceItemValue(i.Name,i.Text)
End If
End ForAll

:-)

2 - But that means looping through all 300 items on the document. This form also has a QTY_1, etc, and a Price_1 meaning a lot of work.

3 - The Mens Supra Muska Skytop Shoes at its exterior using the snap closure. An adjustable belt for the supra uk has two benefits.

4 - Vergeet niet om te spelen!" Cher Pie Piezui, mopperen om te gaan. Zeker vloek, dit meisje, we lachen en schudde zijn hoofd.
"La La La La La La ..." Cher is het entertainen.

5 - The Barbour jackets outside is often found in { Link } ,.

6 -

7 - We have a Coach factory outlet, the items are very cheap and good, Go to Coach outlet online , it is the good choice for you. Let's shop Coach factory outlet online.

Post A Comment

Feeds

Custom Button Custom Button

Category Cloud

Disclaimer

The views expressed by the authors on this blog do not necessarily reflect the views of Teamstudio, those who link to this blog, or even the author’s mother, father, sister, brother, uncle, aunt, grandparents, cousins, step relations, any other blood relative - and sometimes not even the author himself or herself.

Comments on this website are the sole responsibility of their writers and it is assumed those writers will take full responsibility, liability, and blame for any libel or litigation that results from something written in, or as a direct result of something written in, a comment. The accuracy, completeness, veracity, honesty, exactitude, factuality and politeness of comments are not guaranteed. Oh, how they are SO not guaranteed.
en-us,en;q=0.5OFFCCBot/1.0 (+http://www.commoncrawl.org/bot.html)38.107.179.211www.getthemostfromnotes.comHTTP/1.180Lotus-Domino/tsblog.nsf/d6plinks/KFRA-8NESM8