It's not working with 1 image because the name of the temp file does not change.
Edit your example, fill the array with just 1 record, the image "image1.jpg" in the 1st case, the image "image2.jpg" in the 2nd case (yes, this is no more "sort ascending" and "sort descending", it's "show image1" and "show image2".
Rene
if sSeq = "A" then
let tabimgA[1].tabimgtype = "1"
let tabimgA[1].tabimgtext = "This is image number one."
locate tabimgA[1].tabimgimage in file
call tabimgA[1].tabimgimage.readFile("image1.jpg")
{
let tabimgA[2].tabimgtype = "2"
let tabimgA[2].tabimgtext = "This is image number two."
locate tabimgA[2].tabimgimage in file
call tabimgA[2].tabimgimage.readFile("image2.jpg")
}
else
let tabimgA[1].tabimgtype = "2"
let tabimgA[1].tabimgtext = "This is image number two."
locate tabimgA[1].tabimgimage in file
call tabimgA[1].tabimgimage.readFile("image2.jpg")
{
let tabimgA[2].tabimgtype = "1"
let tabimgA[2].tabimgtext = "This is image number one."
locate tabimgA[2].tabimgimage in file
call tabimgA[2].tabimgimage.readFile("image1.jpg")
}
end if