Nice questions Gilbert.
Let me answer to the level possible.
1. Because, window type is already predefined one. Like "define window". We can't change the compiler preprocessor directives.
However we can do the following:
Code: Select all
cWindowType := "MAIN"
do case
case cWindowType == "MAIN"
define window..... MAIN
case cWindowType == "CHILD"
define window ..... CHILD
endcase
end window
2. Because, if we don't include the macro symbol, the variable name would be the windowname!
For example,
Suppose we have,
"define window cName" would define a window in the name of cName, where thiswindow.name = 'cName'
"define window &cName" would define a window in the name of WindowName where thiswindow.name = 'WindowName'
Therefore, using macro symbol depends upon our requirement.
3. If we go through all the header files (c:\hmg\include\i_tree.ch,i_tab.ch,i_window.ch) defining the statements (from alternate syntax) which can't be broken (like window, tab, tree etc.,) we can understand the following:
Window, tree and tab controls are controls containing other controls. Prior to entering the control details (ie., before end tree/end tab/end window) we must give the proper name, width, height, row, col and other properties in the define statement itself. Once we give the define statement, a corresponding function is executed to define these containers and the "end window", "end tree" and "end tab" statements will be just closing the definitions.
Where as, for all other controls (say textbox, editbox, button, slider, grid etc.,) once we give "define textbox" statement, no function is called for. It is only fixing the default values for all the properties. At the time of giving the "end textbox" statement, a function with all these parameters is called.
So, the difference is, the time of calling the function defining the control/container. If we define the container before "end window/tree/tab" we can't break the line. If we define the control after "end textbox/editbox/button..." we can break the line.
We must thank Roberto for designing this excellent syntax via compiler preprocessor directives.
