Announcement

Collapse
No announcement yet.

Lance, what do you think of...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tom Hanlin
    replied
    I have my doubts about SHARED values. They're nothing more than a way of having one SUB or FUNCTION cause side-effects in another, which is considered a really bad programming practice. Most modern programming languages are expressly designed to avoid such capabilities, aside from the sanctioned (though discouraged) use of GLOBAL values. I'm not going to go into detail about the whys and wherefores. Let's just say that it makes programs harder to understand and to maintain.

    Extensions for subclassing is an interesting idea.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Gregery D Engle
    replied
    I really like that #1 idea. I have never thought of such an idea before but thinking about it I have come up hundreds of times when I only want two or three functions using the same variable and instead of making it global you could just do that... Great IDEA!

    ------------------
    -Greg

    Leave a comment:


  • Troy King
    replied
    Mark, those are some good ideas. If or until they make it into the language, you can do some "faking it" on your #2 by having each message in a WndProc call other routines, like PowerGen does. Pass the values of CBMSG, etc to the other routine, and you can have it separated off to its own little chunk of code rather than part of a giant SELECT CASE in your own WndProc. Just a thought...

    As to getting Lance (or any other PB folks) to admit to what features will or won't make it into the next version, all I can say is GOOD LUCK &gt . Tell us your secret when you get them to do it <grin>.

    ------------------
    Troy King
    [email protected]

    Leave a comment:


  • mark smit
    Guest started a topic Lance, what do you think of...

    Lance, what do you think of...

    Lance,

    What do you think of the following additions to PBDLL...

    1. reimpliment SHARED variables to combat GLOBAL worries. What I mean is bring the SHARED idea from PBDOS to PBDLL. Each sub or function that contains the same named variables followed by the key word SHARED will share the same memory address. (hope that makes sense).

    2. Extend DDT to allow sub classing of windows messages. This would allow the programmer to break up the windows proc. into smaller chunks. here is an example...

    Code:
    callback function OnInitDialog as long
      rem in here we can use all the DDT variables
      rem CBMSG,CBCTL,CBCTLMSG,CBWPARAM,CBLPARAM, etc...
    end function
    
    callback function OnDestroy as long
      rem in here we can use all the DDT variables
      rem CBMSG,CBCTL,CBCTLMSG,CBWPARAM,CBLPARAM, etc...
    end function
    
    callback function DlgProc as long
      select case cbmsg
        case %WM_INITDIALOG call OnInitDialog
        case %WM_DESTROY call OnDestroy
      end select
    end function

    3. Do you think that my other suggestion for "CONTROL SET|GET INT" will be included in the current release fixes if any? or will this be a "NEW FEATURE" for PBDLL7?



    -------------
    Cheers
Working...
X
😀
🥰
🤢
😎
😡
👍
👎