On Dec 09, 2006, at 10:44 AM, Karen wrote:
As we can Dim multiple variables and assign values to them in a
single DIM statement, I was wondering if we can count on order of
dimming and assignments to do dependent assignments such as:
Dim ContentWidth As Integer = Width - ContentMargin.TotalHoriz,_
ContentHt As Integer = Height - ContentMargin.TotalVert, _
NeedsNewPic as Boolean = ContentPic IS Nil _
OR ContentPic.Width <> ContentWidth _
OR ContentHt <> ContentPic.Height
Or to be safe on all platforms forever would I need to do:
Dim ContentWidth As Integer = Width - ContentMargin.TotalHoriz,_
ContentHt As Integer = Height - ContentMargin.TotalVert, _
NeedsNewPic as Boolean
NeedsNewPic = ContentPic IS Nil _
OR ContentPic.Width <> ContentWidth _
OR ContentHt <> ContentPic.Height
Or just save yourself the grief and questions and make it explicit ?
Dim ContentWidth As Integer
Dim ContentHt As Integer
Dim NeedsNewPic as Boolean
ContentWidth = Width - ContentMargin.TotalHoriz
ContentHt = Height - ContentMargin.TotalVert
NeedsNewPic = ContentPic IS Nil OR ContentPic.Width <> ContentWidth
OR ContentHt <> ContentPic.Height
This style has always worked without questions and continues to work
to this day
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>