I tested HMGObjects, the latest released along with a working application. But before the test I made a few tweaks as follows:
1. I've copied objects.ch to hmg\include
2. I've added #include "objects.ch" to the bottom of minigui.ch
(To save time instead of modifying the source codes). I've also found hmg.ch on hmg\include but it seems the best place for me is to put it in into minigui.ch since this has been included in the prg source #include statement.
3. Then I've modified objects.prg and removed the paths e.g. set procedure to ..\..\source\application and changed it into set procedure to application, button, etc...
4. I recompile HMGObjects and packaged them as libHMGObjects.a
So here's the script for hmgobjects.gcc:
Code: Select all
HRB_DIR = c:/hmg/harbour
INC_DIR = c:/hmg/include
OBJ_DIR = f:/dad/hmgobjects/source --> replaced this with your source paths or obj path
LIB_DIR = f:/dad/hmgobjects/source --> replaced this with your source paths or lib path
SRC_DIR = f:/dad/hmgobjects/source --> replaced this with your source paths or src path
CFLAGS = -Wall -mno-cygwin -O3
all: \
$(LIB_DIR)/libhmgobjects.a \
$(LIB_DIR)/libhmgobjects.a : \
$(OBJ_DIR)/objects.o
ar rc $@ $^
$(OBJ_DIR)/objects.o : $(OBJ_DIR)/objects.c
$(OBJ_DIR)/objects.c : $(SRC_DIR)/objects.prg
$(HRB_DIR)/bin\harbour.exe $^ -n -I$(HRB_DIR)/include -i$(INC_DIR) -d__WINDOWS__ -o$@ $^
.prg.c:
$(HRB_DIR)/bin\harbour.exe $^ -n -I$(HRB_DIR)/include -i$(INC_DIR) -d__WINDOWS__ -o$@ $^
.c.o:
gcc $(CFLAGS) -c -I$(INC_DIR) -I$(HRB_DIR)/include -o $@ $^
pointers to the path statement to make them del *.o and so on. After I completed that, I copied the libhmgobjects.a to hmg\lib.
6. Next I fire-up HMG IDE and my text editor and load demo_3.prg from main.menu (directory is renamed to mainmenu, HMG IDE does not accept the path). Right before the include statement I inserted #include 'minigui.ch". And I played some more with demo_3 and added a static function to display a child window and msginfo() only using the syntax from minigui.ch. Up to this point it works fine.
7. So to see what would be the effect, I recompile a working application and added hmgobjects to the Additional libs: under
configuration tab of HMG IDE. I was expecting a run-time-error but instead I've got syntax error as follows:
hbmk2: Processing configuration: C:\hmg\harbour\bin\hbmk.cfg
hbmk2: Processing: Trends.hbc
hbmk2: Compiling Harbour
sources...
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
F:/TRENDS/SOURCE/trends.prg(115) Error E0030 Syntax error "syntax error at '.'"
F:/TRENDS/SOURCE/trends.prg(133) Error E0030 Syntax error "syntax error at '.'"
F:/TRENDS/SOURCE/trends.prg(162) Error E0061 Implicit send operator with no WITH OBJECT in sight
F:/TRENDS/SOURCE/trends.prg(164) Error E0030 Syntax error "syntax error at '.'"
F:/TRENDS/SOURCE/trends.prg(165) Error E0030 Syntax error "syntax error at '.'"
F:/TRENDS/SOURCE/trends.prg(173) Error E0030 Syntax error "syntax error at '.'"
F:/TRENDS/SOURCE/trends.prg(176) Error E0030 Syntax error "syntax error at '.'"
F:/TRENDS/SOURCE/trends.prg(196) Error E0030 Syntax error "syntax error at '.'"
8 errors
In conclusion, the syntax errors are mainly because of conflict of semi-oop statement and oop statement syntax. And of course due to those controls that has no oop wrappers and HMG Objects is still experimental so I think there's nothing wrong with experimentation...
Now, I am wondering if it is possible to translate those semi-oop statement thru compiler directives when hmgobjects is linked-in? With the arrival of HMG Objects which syntax are we going to adapt?
IMHO, and for compatibility with the HMG semi-oop syntax HMGObjects somehow translate those semi-oop to full oop syntax.
Well, it's not that I'm too lazy to modify my source codes it's because whether hmgobjects is linked or not, semi-oop has been a hallmark of HMG all through these years. So with the advent of HMGObjects the same HMG tranditional syntax can be used and or a full oop syntax can be used. So for those who do not want OOP syntax but if they linked-in the HMGObjects they are not aware that they are using OOP. For those OOP aficionados they can used OOP syntax as in the case of this latest build.
As I have said, if there is a way to translate those semi-oop at compile time it is far more better.
Anyway, whatever will be the direction of Master Roberto for sure I'll follow.....
HMG is just getting better and better and very interesting too...
Regards,
Danny