TRILIGHT
10-14-2003, 06:54 PM
I don't really know if this is the correct way to describe it but
I want to include a way to do things with multiple matches. Basically, what I've seen and used is the following...
ForeachMfsFile fsid name type "/Resource/Image" "" {
RetryTransaction {
set resobject [db $db openid $fsid]
set resname [dbobj $resobject get Name]
set resfsid [dbobj $resobject get File]
if { $resname == "PowerOnCoverup.1" } {
set newfsid [ToMfs POC1.png]
dbobj $resobject set File $newfsid
}
}
}
Now, this searches through "/Resource/Image" and performs the function if the name is matched. However, this is only effective for a single match and replacement. I would like to know how to include other matches/replacements during the same search. So as things are matched, they are replaced and only a single scan is required. Can someone assist me with figuring out how to do this properly? Thanks!
I want to include a way to do things with multiple matches. Basically, what I've seen and used is the following...
ForeachMfsFile fsid name type "/Resource/Image" "" {
RetryTransaction {
set resobject [db $db openid $fsid]
set resname [dbobj $resobject get Name]
set resfsid [dbobj $resobject get File]
if { $resname == "PowerOnCoverup.1" } {
set newfsid [ToMfs POC1.png]
dbobj $resobject set File $newfsid
}
}
}
Now, this searches through "/Resource/Image" and performs the function if the name is matched. However, this is only effective for a single match and replacement. I would like to know how to include other matches/replacements during the same search. So as things are matched, they are replaced and only a single scan is required. Can someone assist me with figuring out how to do this properly? Thanks!