Manage Learn to apply best practices and optimize your operations.

Using @For to cycle through sequential fields

Use the new @For in R6 command to present fields in a document named sequentially.

Use the new @For command in R6 to present all fields in a document that are named sequentially, for example: customer1, customer2, customer3 and so forth. The help database shows how to iterate over elements in an array (or list item). This tip complements that example by showing how to iterate over multiple similiarly-named fields. The following computed text (Passthru HTML) goes between <table> and </table> tags. It is used to present a list of attachments, creating a row for each if the corresponding "filedisplay#" field is set to "Yes". Change n<11 to suite your needs.


  
@For(n:=1;
n<11;
n:=n+1;
temp_filedisplay:=@GetField("fileDisplay"+@Text(n));
temp_filename:=@GetField("fileName"+@Text(n));
temp_filedescription:=@GetField("fileDescription"+@Text(n));
temp_filetype:=@GetField("fileType"+@Text(n));
temp_filesize:=@GetField("fileSize"+@Text(n));
@If(temp_filedisplay="Yes";
result:=result+
"<tr><td> <a href="../"+@Text(@DocumentUniqueID)+"/$file/"+temp_filename+"">"+temp_filename+"</a></td><td>"+temp_filedescription+"</td><td align="center">"+temp_filetype+"</td><td align="center">"+@Text(temp_filesize)+"</td></tr>"
;""));
result
This was last published in July 2002

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchExchange

SearchContentManagement

Close