Print Page | Close Window

WITH or not WITH

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=7583
Printed Date: 26 June 2024 at 8:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: WITH or not WITH
Posted By: Bernie
Subject: WITH or not WITH
Date Posted: 11 July 2007 at 9:38pm

Yes, it's a silly question. I read all the samples that the CodejokeSoftware provided, but there are few "WITH ... END WITH" statements. The following codes are mine. I used "WITH ... END WITH" statement to make the program more efficient. Do you experts agree to avoid using "WITh ... END WITH" ?

      Dim RB As RibbonBar
      With CommandBars1
            Set RB = .AddRibbonBar("main")
            With RB
                  .AddSystemButton
                  .AllowMinimize = False
                  .AllowQuickAccessCustomization = False
                  .AllowQuickAccessDuplicates = False
                  .Closeable = False
                  .Customizable = False
                  .EnableFrameTheme
                  .ShowQuickAccess = False
                  .ShowGripper = False
            End With
      End With



Replies:
Posted By: gshawn
Date Posted: 12 July 2007 at 2:56am
Unless your With/End With block is inside a time-critical loop it won't matter one bit, so I don't see a reason to avoid using it. The With/End With block is actually good to use for the sake of clarity.
 
Cheers!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net