@Antonio Linares I copied the hbclass.ch to my seamap directory and when I start seamap.prg I get following error: Error: Syntax error "syntax error at '_HB_MEMBER'" operation: line:58 called from: ../../../apache.prg, (b)MAIN, line: 50 Can you please help me Zip seamap.zip Zip Klicken zum Herunterladen Otto 22:23 Uhr Antonio inside model I fill an array with the data which I want to show in the view. How can I pass the Array to the view? Otto 00:31 Uhr For the ARRAY I found the solution in GENESIS: {{BuildBrowse()}} but I have still the problem with Syntax error "syntax error at '_HB_MEMBER'" Antonio Linares 07:20 Uhr buenos dias :sonnig: Otto you have to modify this line: //{% hb_SetEnv( "HB_INCLUDE", "/Users/anto/harbour/include" ) %} like this: //{% hb_SetEnv( "HB_INCLUDE", "c:\harbour\include" ) %} Otto 07:58 Uhr good morning Dear Antonio then I get the error Error: Error: Syntax error "syntax error at 'MODEL'" and if I delete // Incomplete statement or unbalanced delimiters operation: line:3 Antonio Linares 08:04 Uhr Do you have a c:\harbour\include folder in your server ? Otto 08:04 Uhr May I ask if makes sense that a mod harbour starter like me tries to user MVC and OOP or would it be better starting with spaghetti code getting used to js and html and then re-write the programs. Antonio Linares 08:04 Uhr spaghetti code, sooner or later, will trap you A new version, much more enhanced: We have to clearly understand how the MVC works and then the whole process gets simplified in our heads https://github.com/FiveTechSoft/mod_harbour/blob/master/samples/seamap.prg GitHubGitHub FiveTechSoft/mod_harbour Apache mod for Harbour. Contribute to FiveTechSoft/mod_harbour development by creating an account on GitHub. structured programming gets more simplified using objects Otto 08:11 Uhr for example yesterday my code in a standalone prg worked well - then I included into a view - saved the output of the function view to a file and the file looks same as standalone - but code inside view does no longer work. I tried to add TEMPLATE PARAMS alinks /ENDTEXT to function view but without success. Antonio Linares 08:15 Uhr https://harbour.fourtech.es/modharbour_samples/seamap.prg Otto 08:15 Uhr Dear Antonio thank you so much. shttps://github.com/FiveTechSoft/mod_harbour/blob/master/samples/seamap.prg is working fine. Slackbot 08:15 Uhr Pssst! Ich habe für https://github.com/FiveTechSoft/mod_harbour/blob/master/samples/seamap.prg keine Link-Vorschau erstellt, weil dieser Link erst vor Kurzem in diesem Channel geteilt wurde (innerhalb der letzten Stunde) und ich nicht wollte, dass es zu unübersichtlich wird. Antonio Linares 08:15 Uhr live demo. Please click on it Otto 08:16 Uhr Can you please add a button to browse Antonio Linares 08:16 Uhr The MVC idea is to divide the app in THREE parts: The "C"ontroller interacts with the user and talks to the "M"odel (which deals with tables only) and to the "V"iews (which deals with output only) When the user ask for a default browser, the "C"ontroller tells the "M"odel: "Hey give the data for a default browse" then tells the "V"iew "here is the data, so please give me the view to display" "C"ontroller interacts on one side to the user, on the other side with the "M"odel (data) and with the "V"iew (the output) Now you ask for a "Add" button. Lets think about it... Who may provide it ? The "C"ontroller ? ... no The "M"odel ?... no the "V"iew... yes :leichtes_lächeln: Where to put it ? in the method where the browse gets built Now in Method Browse() CLASS View we add this line: ::cHtml += "" + CRLF and we have it working :leichtes_lächeln: https://harbour.fourtech.es/modharbour_samples/seamap.prg Now we want to provide an "onclick" action to the button... -------------------------------------------------------------------------------------------------------------------------------- Otto 08:32 Uhr Antonio is it OK if I copy your answers to the forum? Antonio Linares 08:32 Uhr Yes, sure, please dot it. many thanks :leichtes_lächeln: do it onclick="add()" and we implement a simple javas cript function add() to request the add. Done! https://harbour.fourtech.es/modharbour_samples/seamap.prg Neue Nachrichten Please click on "add" and see how our "C"ontroller is properly routing it :leichtes_lächeln: Still we are not interested on the "nice" style yet... -------------------------------------------------------------------------------------------------------------------------------- Charly:palme: 08:35 Uhr Bon dia Antonio Linares 08:35 Uhr We just want to check that the "C"ontroller is doing its job properly Lets think about Add now... Who may implement it ? The "C"ontroller is already processing it... fine The "M"odel has to add a record... ok The "V"iew has to be refreshed... lets do it -------------------------------------------------------------------------------------------------------------------------------- Antonio Linares 08:43 Uhr We implement the method Add() for the Class Model and the "C"ontroller uses it done! https://harbour.fourtech.es/modharbour_samples/seamap.prg -------------------------------------------------------------------------------------------------------------------------------- Otto 08:51 Uhr Thank you now only Edit() is missing :leichtes_lächeln: Antonio Linares 08:52 Uhr We want to add support for "Edit" and "Del", ok Otto 08:52 Uhr Would you be so kind to show me / us also how to implement edit() . Thank you so much for your help. This is a great template. And if you code all is so simple and clear. Antonio Linares 08:52 Uhr who may implement them ? The "V"iew must show the "edit" and "del" buttons The "M"odel must provide a record data and later save the data The "C"ontroller will organize those actions :leichtes_lächeln: Lets first modify the "V"iew to show those buttons... Antonio Linares 09:05 Uhr Done... https://harbour.fourtech.es/modharbour_samples/seamap.prg The actions are already being routed to our "C"ontroller :leichtes_lächeln: -------------------------------------------------------------------------------------------------------------------------------- Antonio Linares 10:09 Uhr Delete already implemented https://harbour.fourtech.es/modharbour_samples/seamap.prg Otto 10:27 Uhr @Antonio Linares thank you. I have tested *delete" button Cristobal 10:27 Uhr Bonjour Antonio Linares 10:30 Uhr Otto, Edit is already working though it does not allows to modify data yet https://harbour.fourtech.es/modharbour_samples/seamap.prg --------------------------------------------------------------------------------------------------------------------------------