[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Checking for open dialogbox in ABL using the widget tree?

  • Thread starter Thread starter Patrick Tingen
  • Start date Start date
Status
Not open for further replies.
P

Patrick Tingen

Guest
Not meant offensive, but I find style and naming used in the example not so simple; why do you return an error and why is your procedure called 'WalkTheTree'. Surely it does something more than just walk the tree. Keep in mind that someone else will eventually read this code too. This person might be yourself in a few years. You should give as much clue as possible to the future reader to what this code is actually doing. Personally, I find something like the below more readable: FUNCTION getWindowType RETURNS CHARACTER (phWidget AS HANDLE): phWidget = phWidget:FIRST-CHILD. DO WHILE VALID-HANDLE(phWidget): IF phWidget:TYPE = "DIALOG-BOX" THEN RETURN "DIALOG-BOX". phWidget = phWidget:NEXT-SIBLING. END. RETURN "WINDOW". END FUNCTION. /* getWindowType */ Although one could argue that it would be even better to create an ENUM for window types and return that.

Continue reading...
 
Status
Not open for further replies.
Back
Top