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.
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
ForAll i In doc.Items
If InStr(i.Name,"Product")>0 then
Call newdoc.ReplaceItemValue(i.Name,i.Text)
End If
End ForAll
:-)
Posted by Karl-Henry Martinsson At 06:08:47 PM On 11/08/2011 | - Website - |
Posted by John Kingsley At 05:09:31 PM On 11/09/2011 | - Website - |
Posted by Buy Supra Shoes UK At 06:16:50 AM On 11/29/2011 | - Website - |
"La La La La La La ..." Cher is het entertainen.
Posted by moncler At 09:44:15 AM On 12/19/2011 | - Website - |
Posted by barbour jacket sale At 07:24:25 PM On 12/25/2011 | - Website - |
Posted by At 08:17:54 PM On 12/25/2011 | - Website - |
Posted by Coach factory outlet At 01:17:37 AM On 02/22/2012 | - Website - |