using V5.5
I have a screen set consisting of a main body and a footer with buttons. I've been swapping pics in the main section using the following code for years now.
The cFixPicture Initialize section of each pic (except for the footer) contains
This has been working great for years.
Today we added a header pic. So we now have a header, main and footer.
Next we found that using the same ReplacePicture line of code would alternate replacing the header and the main. One click would replace the main as expected, the next would replace the header which should never happen.
Reviewing code I saw that the footer has a alias so i added an alias of "Header" the Initialize section of the header code fixed it. We tested this over and over and it didn't matter what we called the alias, it just had to have one. Remove it and the behavior returned.
My question is why? the header was never aliased as CurrentPic, ever. Why would the ReplacePicture procedure ever try to replace it?
I have a screen set consisting of a main body and a footer with buttons. I've been swapping pics in the main section using the following code for years now.
Code:
ReplacePicture "newPic", "CurrentPic"
Code:
PictureAlias "CurrentPic"
Today we added a header pic. So we now have a header, main and footer.
Next we found that using the same ReplacePicture line of code would alternate replacing the header and the main. One click would replace the main as expected, the next would replace the header which should never happen.
Reviewing code I saw that the footer has a alias so i added an alias of "Header" the Initialize section of the header code fixed it. We tested this over and over and it didn't matter what we called the alias, it just had to have one. Remove it and the behavior returned.
My question is why? the header was never aliased as CurrentPic, ever. Why would the ReplacePicture procedure ever try to replace it?