Author Topic: [RESOLVED] With./End With vs. With/End With  (Read 1381 times)

0 Members and 1 Guest are viewing this topic.

Mike Lobanovsky

  • Guest
[RESOLVED] With./End With vs. With/End With
« on: March 25, 2018, 04:53:58 PM »
Hi Charles,

The current implementation of With./End With meta doesn't allow us to use member name shorthand as rvalues in the O2 statements within the block. That's not very handy when the UDT name appears descriptive and thus relatively long.

Why not use a conventional With/End With notation with dotted shorthand within the block? That'll make the dotted member names usable anywhere in the statements, and it will also automatically allow free use of possible member "namesakes" that happen to be distinct variables in the same sub or function.

TIA
« Last Edit: March 26, 2018, 08:24:57 AM by Mike Lobanovsky »

Charles Pegge

  • Guest
Re: With./End With vs. With/End With
« Reply #1 on: March 25, 2018, 08:13:24 PM »
Good idea, Mike. It will be implemented in the next release :)

WinUtil.inc is the only file in the pack which requires a dot-member alteration.

Corrected WNDCLASSEX wc
Code: [Select]
  with wc
    .cbSize        = sizeof WNDCLASSEX                 '
    .style=CS_HREDRAW or CS_VREDRAW
    .lpfnWndProc   = @wndproc
    .cbClsExtra    = 0
    .cbWndExtra    = 0   
    .hInstance     = inst
    .hIcon         = LoadIcon 0, IDI_APPLICATION
    .hCursor       = LoadCursor 0,IDC_ARROW
    .hbrBackground = GetStockObject WHITE_BRUSH
    .lpszMenuName  = 0
    .lpszClassName = strptr "wins"
    .hIconSm       = null
  end with
« Last Edit: March 25, 2018, 08:48:55 PM by Charles Pegge »

Mike Lobanovsky

  • Guest
Re: With./End With vs. With/End With
« Reply #2 on: March 26, 2018, 02:30:56 AM »
Excellent! Thanks Charles! :)