Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WITH/END WITH?
#5
Well lets ask AI
Quote:Using WITH/END WITH in QB64 Phoenix Edition (PE) would be a positive addition because it improves code readability and reduces the chance of typing errors, particularly when working with User-Defined Types (UDTs) that have many members.
Benefits of WITH/END WITH
Improved Readability: It allows you to perform a series of statements on a single object or UDT without having to specify the object's name repeatedly, making the code cleaner and easier to read.
Reduced Errors: By referencing the object only once, it minimizes potential typing errors in object names.
Potential Performance Gain (Historically): In older VB versions, using With...End With could offer a minor performance boost because the object's address reference was looked up only once at the beginning of the block, rather than for each property access. While this performance difference is likely negligible in modern compilers like QB64PE, the primary benefits are related to code maintenance and clarity.
Current Status in QB64PE
Currently, WITH/END WITH is not a supported feature in QB64PE's standard syntax, which primarily aims for compatibility with QuickBASIC 4.5. However, the idea has been discussed in the community forums, with users expressing a desire for this feature, especially those who frequently used it in VB6.
Recommendation
If you wish to see this feature officially implemented, the best approach is to engage with the developer community on the QB64 Phoenix Edition forum and the GitHub repository. The developers are actively adding enhancements and improvements, and community input can help prioritize new features.
In the meantime, a common workaround is to use a short, temporary variable as an alias for the object you are repeatedly accessing, though this is less elegant than a dedicated WITH block.

So nice work around idea, no?
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
WITH/END WITH? - by bobalooie - 11-21-2025, 07:16 PM
RE: WITH/END WITH? - by hsiangch_ong - 11-22-2025, 12:41 AM
RE: WITH/END WITH? - by Pete - 01-19-2026, 04:32 PM
RE: WITH/END WITH? - by bplus - 01-19-2026, 05:25 PM
RE: WITH/END WITH? - by bobalooie - 01-27-2026, 02:44 AM
RE: WITH/END WITH? - by Pete - 01-19-2026, 05:34 PM
RE: WITH/END WITH? - by NakedApe - 01-19-2026, 06:21 PM
RE: WITH/END WITH? - by bplus - 01-19-2026, 06:39 PM
RE: WITH/END WITH? - by Pete - 01-19-2026, 06:40 PM
RE: WITH/END WITH? - by hsiangch_ong - 01-20-2026, 02:30 PM
RE: WITH/END WITH? - by bplus - 01-20-2026, 02:44 PM
RE: WITH/END WITH? - by Magdha - 01-20-2026, 04:10 PM
RE: WITH/END WITH? - by SMcNeill - 01-20-2026, 05:54 PM
RE: WITH/END WITH? - by bplus - 01-20-2026, 05:47 PM
RE: WITH/END WITH? - by hsiangch_ong - 01-21-2026, 02:39 AM
RE: WITH/END WITH? - by madscijr - 01-21-2026, 11:14 PM
RE: WITH/END WITH? - by bobalooie - 01-27-2026, 01:55 AM
RE: WITH/END WITH? - by madscijr - 01-27-2026, 04:38 AM
RE: WITH/END WITH? - by SMcNeill - 01-27-2026, 02:04 AM
RE: WITH/END WITH? - by bobalooie - 01-27-2026, 02:56 AM
RE: WITH/END WITH? - by Pete - 01-27-2026, 04:51 AM
RE: WITH/END WITH? - by madscijr - 01-27-2026, 05:02 AM
RE: WITH/END WITH? - by luke - 01-27-2026, 08:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question What happened to end year holiday season code? mnrvovrfc 5 1,106 12-27-2023, 02:39 PM
Last Post: GareBear
  So... I *think* I found the cheese at the end of the maze? MrCreemy 11 2,115 12-30-2022, 11:24 AM
Last Post: JRace

Forum Jump:


Users browsing this thread: 1 Guest(s)