Migrating to Harbour

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Tue Dec 16, 2014 3:42 pm

hmpaquito wrote:Some samples of obsolescence in that document, please.


Sorry, I'm not in the mood to examine and test that document. What I can say is that it's a collection of differences, not features.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby hmpaquito » Tue Dec 16, 2014 3:54 pm

What I can say is that it's a collection of differences, not features


Incorrect afirmation.
That document is a collection of differences of features.
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Tue Dec 16, 2014 4:31 pm

hmpaquito wrote:Incorrect afirmation.
That document is a collection of differences of features.


Yes, features implemented in different ways. So?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby hmpaquito » Tue Dec 16, 2014 4:37 pm

Yes, features implemented in different ways. So?


No, off course.
features improved in harbour regarding xHarbour
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Tue Dec 16, 2014 5:27 pm

hmpaquito wrote:No, off course.
features improved in harbour regarding xHarbour


Improved? Show me a real improvement of Harbour, something that I can take advantage of in my applications, ad I will be glad to migrate.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby hmpaquito » Tue Dec 16, 2014 5:50 pm

Show me a real improvement of Harbour, something that I can take advantage of in my applications, ad I will be glad to migrate.



Almost all that document are improved harbour regarding xHarbour.

Sample:
Code: Select all  Expand view  RUN
###    PASSING ARRAY AND HASH ITEMS BY REFERENCE    ###
=======================================================
Harbour supports passing array and hash items by reference, f.e.:
      proc main()
         local aVal := { "abc", "klm", "xyz" }, ;
               hVal := { "qwe"=>"123", "asd"=>"456", "zxc"=>"789" }
         ? aVal[1], aVal[2], aVal[3], hVal["qwe"], hVal["asd"], hVal["zxc"]
         p( @aVal[2], @hVal["asd"] )
         ? aVal[1], aVal[2], aVal[3], hVal["qwe"], hVal["asd"], hVal["zxc"]

      proc p( p1, p2 )
         p1 := '[1]'
         p2 := '[2]'

Compiled by Harbour above code shows:
      abc klm xyz 123 456 789
      abc [1] xyz 123 [2] 789

In xHarbour only passing array items by reference works but does not work
passing hash items by reference though it does not generate either
compile time or run time errors so the above code can be compiled and
executed but it shows:
      abc klm xyz 123 456 789
      abc [1] xyz 123 456 789
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Tue Dec 16, 2014 6:01 pm

I don't like and will never use things like those. I'm happy to have a language that is far from C language. If I need C I use C.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby hmpaquito » Tue Dec 16, 2014 6:13 pm

I don't know you need.
My advice: check the documentation, harbour contribs, c compiler support, core RT, rdd extensions, netio communications, changelogs, etc... yourself
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Tue Dec 16, 2014 6:36 pm

I'm desperately trying to test Harbour with my applications but still unable to use it... :-(

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Antonio Linares » Tue Dec 16, 2014 6:55 pm

James,

James Bott wrote:Antonio,

hbcplr.lib holds the entire Harbour compiler inside it, so we can compile PRGs from our EXEs, in memory and execute the code. To me this is extremely important.


Are you saying this provides runtime compiling, and if so, why is this important?

This capability is the foundation to build a professional ERP software.


By ERP do you mean "Enterprise Resource Planning" or something else? And why would runtime compiling be important to ERP?

I never understood the advantage to runtime compiling--it seems it would be too slow.


The PRG is compiled in memory, no need to create a PRG file. And once the code is compiled we can also run it! :-) It goes as fast as Harbour.exe goes compiling! The whole harbour compiler can be linked inside our EXEs! Wow! :-) You can use your EXE instead of harbour.exe! and compile and run in memory. This is outstanding!

ERP have the ability to transform themselves as chamaelons :-) In order to achive this power, the final user has the ability to add more code to the app itself, and such code can be executed adding new features to the app. In other words: the app can grow as much as needed and transform itself, and without the need to rebuild the EXE. Thats exactly an ERP! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Migrating to Harbour

Postby James Bott » Tue Dec 16, 2014 7:36 pm

Antonio,

Well, I can see you are quite excited of this feature, but I am still not yet getting it.

I do understand ERP. I sold, installed, and serviced MRP (the precursor to ERP) about 20 years ago.

I do get that runtime compiling of FW code is interesting technologically, but I don't understand its practical use. Are you advocating that users write their own code? It has been my experience that users don't even know what they want much less how to implement it so I am not hopeful that this would be useful.

Also, it would seem that the code would still need to be stored in a PRG if it was to be reused, would it not? So, you have to read the PRG into memory, then compile it, then run it. This would have to be slower than running code already compiled into the EXE. Granted depending on the size of the PRG it may not be slow enough to matter to the user, I don't know.

Can you provide a specific example of how this capability would be useful?
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Migrating to Harbour

Postby Antonio Linares » Tue Dec 16, 2014 8:13 pm

James,

The most important ERP sold in Caracas, Venezuela is developed with Harbour and FWH :-)

http://www.datapronet.com/home/

Juan Navas is the CEO and main developer. I was in Caracas with him for several weeks and I got really impressed of what his ERP is able to do :-)
I will ask Juan to post in this conversation explaining his point of view. it may be very interesting :-)

Besides DataPro, I also was consultant for a Madrid Spain company that based his bussiness model in the same technology and offered his product as an ERP too. I was for two years or so involved in their developments.

Final users don't modify the app. The final user hires the ERP company to fine tune the app to their needs and they are willing to pay for those changes that they need. The changes can be implemented in site (in the client company) or delivered remotely. There is no need to replace the EXE.

Most of times the code is stored in a database and they use some variables as cache, so the code is just compiled once and run many times :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Migrating to Harbour

Postby hmpaquito » Tue Dec 16, 2014 8:41 pm

Beyond scripting: remote scripting:

From harbour user list, LF builded a prg code http server :


On Tue, Oct 21, 2014 at 8:29 PM, Itamar M. Lins Jr. Lins
<itama...@gmail.com> wrote:
>
> You, use hbhttpd or apache... ?
> Use DBF ?

I use a new version of the hisbay-framework that I presented here in 2013.
Basically it's MVC framework that follows the principles of RoR or
Java Play Framework.
The only binary is the server which is launched directly inside the
app directory.
PRGs are ( ONLY ) classes derived from basic classes Controller, View
or Model that need to be put in the right directory ( convention vs
configuration ) and are compiled on the fly calling harbour compiler
using hb_run.
The developer simply writes the PRG and reload the page of the browser
to run the hrb.
Compiling errors are shown in the browser.
The UI part is done with html, js, css, jquery and clients are Macs,
PCs, IOS and Android devices.
Only hrbs are deployed to the customer.

Of course it took years to reach performance and stability.
Before I had CGI apps that worked with Apache and HRB apps that worked
with a small http server.
I heavily used dynamic libs and that required a specific version of
Harbour and a quite complex setup.
I've always worked in multiplatform environments where main server
environment is Linux ( RHEL flavor ), OSX is the preferred development
environment but I need also to work with contractors that often use
Windows and that are trained in JS, PHP, .NET or Java and know few or
nothing about xBase or Harbour.
So I needed a new framework that could be quickly mastered and
installed by a web developer.

Now the only thing I provide to a developer is the binary of the
server, an Harbour tree and a git access.
They don't need to know about hbmk2, compiling, linking or configure
an Apache server.
Apps use both dbfs and sql ( postgresql actually ) and I wrote an SQL
class that uses JDBC interface to be familiar to a Java or a .NET
developer.

For example to quickly move to web a "classic" reporting application,
I created a function that reads a GetList screen at runtime and
creates a json with the informations needed to render the same inputs
as an HTML5 form. The code was then pasted in the web app ( of course
something needed to be adjusted case by case ) and it called exactly
the same report function used in the desktop app. The only thing
needed was to define the output type ( report engine can renders the
report into PDF, XLSX, DOCX ecc. ). It took only few hours without a
single change in the DBF or the print code.

best regards,
Lorenzo
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Migrating to Harbour

Postby jnavas » Wed Dec 17, 2014 6:39 am

Porque llegamos a crear un ERP: Precedenctes.

Juan Navas “Creador de DataPro y AdaptaPro”, recopiló más de 20 años de experiencia siendo director y/o accionista de diversas firmas jurídicas dedicadas la actividad comercial “AdaptaPro”, gracias la responsabilidad legal, diseño un modelo de sistema proactivo basado en la planificación en las soluciones en diversas áreas: Tributario, Proyectos, Gestión de Clientes o (CRM) Finanzas, Laboral y demás deberes formales. La experiencia directa en AdaptaPro y experiencia obtenida en miles de implementaciones fue la materia prima para gestar un modelo de solución empresarial de alcance “ERP”, donde la gestión de la empresa se realiza mediante previa planificación y medidores de gestión para conocer las actividades: Realizadas en su debido momento, las actividades no realizadas en la fecha establecida y las actividades por realizar. Además el concepto logra evitar de manera proactiva las omisiones o incumplimientos causados por el factor humano: La memorización, discrecionalidad, desconocimiento y la disposición.
El concepto o filosofía del ERP está en la manera de realizar las transacciones o actividades del usuario, en un ERP el usuario de tesorería es informado mediante un formulario de actividades todas las actividades o tareas que debe realizar: Calcular y Pagar Impuestos, Servicios de electricidad, teléfonos, nóminas, entre otros. En cambio un sistema para la administración es discrecional, el usuario es quien decide las actividades que va a realizar y luego las registra en el sistema para luego generar listados o informes.
Aspectos tecnológicos:

Debe estar basado en el modelo de bases de datos relaciones (RDBMS), todas las aplicaciones deben utilizar la misma base de datos sin procesos de integración ni redundancia de datos.

Arquitectura Abierta: Mediante el concepto de diccionario de datos o Metadatos “todas las tablas podrán ser adaptadas según la necesidad del cliente”.

Código fuente abierta o disponible: Todos los programas que generan las transacciones financieras podrá estar disponible para que el usuario las adapte a sus necesidades o país. En nuestro caso hemos utilizado FIVESCRIPT adaptado a nuestro criterio, y programas (PRG) precompilados en modulos HRB

Programa DPXBASE
// Programa : DPCONTENIDOS
// Fecha/Hora : 14/12/2014 23:06:29
// Propósito : Incluir/Modificar DPCONTENIDOS
// Creado Por : DpXbase
// Llamado por: DPCONTENIDOS.LBX
// Aplicación : Administración del Sistema
// Tabla : DPCONTENIDOS

#INCLUDE "DPXBASE.CH"
#INCLUDE "TSBUTTON.CH"
#INCLUDE "IMAGE.CH"

FUNCTION DPCONTENIDOS(nOption,nId)
LOCAL oBtn,oTable,oGet,oFont,oFontB,oFontG
LOCAL cTitle,cSql,cFile,cExcluye:=""
LOCAL nClrText
LOCAL cTitle:="Gestión de Contenidos"

cExcluye:="CON_ID,;
CON_CODIGO,;
CON_ACTIVO"

DEFAULT nID :=SQLGET("DPCONTENIDOS","CON_ID"),;
nOption:=1

DEFINE FONT oFont NAME "Verdana" SIZE 0, -10 BOLD
DEFINE FONT oFontB NAME "Arial" SIZE 0, -12 BOLD ITALIC
DEFINE FONT oFontG NAME "Arial" SIZE 0, -11

nClrText:=10485760 // Color del texto

IF nOption=1 // Incluir
cSql :=[SELECT * FROM DPCONTENIDOS WHERE ]+BuildConcat("CON_ID")+GetWhere("=",nID)+[]
cTitle :=" Incluir {oDp:DPCONTENIDOS}"
ELSE // Modificar o Consultar
cSql :=[SELECT * FROM DPCONTENIDOS WHERE ]+BuildConcat("CON_ID")+GetWhere("=",nID)+[]
cTitle :=IIF(nOption=2,"Consultar","Modificar")+" Gestión de Contenidos "
cTitle :=IIF(nOption=2,"Consultar","Modificar")+" {oDp:DPCONTENIDOS}"
ENDIF

oTable :=OpenTable(cSql,"WHERE"$cSql) // nOption!=1)

IF nOption=1 .AND. oTable:RecCount()=0 // Genera Cursor Vacio
oTable:End()
cSql :=[SELECT * FROM DPCONTENIDOS]
oTable :=OpenTable(cSql,.F.) // nOption!=1)
ENDIF

oTable:cPrimary:="CON_ID" // Clave de Validación de Registro

oCONTENIDOS:=DPEDIT():New(cTitle,"DPCONTENIDOS.edt","oCONTENIDOS" , .F. )

oCONTENIDOS:nOption :=nOption
oCONTENIDOS:SetTable( oTable , .F. ) // Asocia la tabla <cTabla> con el formulario oCONTENIDOS
oCONTENIDOS:SetScript() // Asigna Funciones DpXbase como Metodos de oCONTENIDOS
oCONTENIDOS:SetDefault() // Asume valores standar por Defecto, CANCEL,PRESAVE,POSTSAVE,ORDERBY
oCONTENIDOS:nClrPane:=oDp:nGris

IF oCONTENIDOS:nOption=1 // Incluir en caso de ser Incremental
// oCONTENIDOS:RepeatGet(NIL,"CON_ID") // Repetir Valores
oCONTENIDOS:CON_ID :=oCONTENIDOS:Incremental("CON_ID ",.F.)
ENDIF

//Tablas Relacionadas con los Controles del Formulario

oCONTENIDOS:CreateWindow() // Presenta la Ventana

// Opciones del Formulario


//
// Campo : CON_ID
// Uso : Id del Registro
//
@ 3.0, 1.0 SAY oCONTENIDOS:oCON_ID VAR oCONTENIDOS:CON_ID ;
BORDER ;
FONT oFontG;
SIZE 16,10;
RIGHT

@ oCONTENIDOS:oCON_ID :nTop-08,oCONTENIDOS:oCON_ID :nLeft SAY "Id del Registro" PIXEL;
SIZE NIL,7 FONT oFont COLOR nClrText,15724527


//
// Campo : CON_CODIGO
// Uso : Contenido
//
@ 4.8, 1.0 GET oCONTENIDOS:oCON_CODIGO VAR oCONTENIDOS:CON_CODIGO VALID !VACIO(oCONTENIDOS:CON_CODIGO,NIL);
WHEN (AccessField("DPCONTENIDOS","CON_CODIGO",oCONTENIDOS:nOption);
.AND. oCONTENIDOS:nOption!=0);
FONT oFontG;
SIZE 320,10

oCONTENIDOS:oCON_CODIGO:cMsg :="Contenido"
oCONTENIDOS:oCON_CODIGO:cToolTip:="Contenido"

@ oCONTENIDOS:oCON_CODIGO:nTop-08,oCONTENIDOS:oCON_CODIGO:nLeft SAY "Contenido" PIXEL;
SIZE NIL,7 FONT oFont COLOR nClrText,15724527


//
// Campo : CON_ACTIVO
// Uso : Activo
//
@ 6.6, 1.0 CHECKBOX oCONTENIDOS:oCON_ACTIVO VAR oCONTENIDOS:CON_ACTIVO PROMPT ANSITOOEM("Activo");
WHEN (AccessField("DPCONTENIDOS","CON_ACTIVO",oCONTENIDOS:nOption);
.AND. oCONTENIDOS:nOption!=0);
FONT oFont COLOR nClrText,NIL SIZE 76,10;
SIZE 4,10

oCONTENIDOS:oCON_ACTIVO:cMsg :="Activo"
oCONTENIDOS:oCON_ACTIVO:cToolTip:="Activo"





oCONTENIDOS:Activate({||oCONTENIDOS:ViewDatBar()})


STORE NIL TO oTable,oGet,oFont,oGetB,oFontG

RETURN oCONTENIDOS

/*
// Barra de Botones
*/
FUNCTION ViewDatBar()
LOCAL oCursor,oBar,oBtn
LOCAL oDlg:=oCONTENIDOS:oDlg


DEFINE CURSOR oCursor HAND
DEFINE BUTTONBAR oBar SIZE 52-15,60-15 OF oDlg 3D CURSOR oCursor


IF oCONTENIDOS:nOption=2


DEFINE BUTTON oBtn;
OF oBar;
NOBORDER;
FONT oFont;
FILENAME "BITMAPS\\XSALIR.BMP";
ACTION (oCONTENIDOS:Close())

oBtn:cToolTip:="Salir"

ELSE

DEFINE BUTTON oBtn;
OF oBar;
NOBORDER;
FONT oFont;
FILENAME "BITMAPS\\XSAVE.BMP";
ACTION (oCONTENIDOS:Save())

oBtn:cToolTip:="Grabar"

DEFINE BUTTON oBtn;
OF oBar;
FONT oFont;
NOBORDER;
FILENAME "BITMAPS\\XCANCEL.BMP";
ACTION (oCONTENIDOS:Cancel()) CANCEL

oBtn:cToolTip:="Cancelar"

ENDIF

oBar:SetColor(CLR_BLACK,15724527)
AEVAL(oBar:aControls,{|o,n|o:SetColor(CLR_BLACK,15724527)})

RETURN .T.


/*
// Carga de Datos, para Incluir
*/
FUNCTION LOAD()

IF oCONTENIDOS:nOption=1 // Incluir en caso de ser Incremental
oCONTENIDOS:CON_ID :=oCONTENIDOS:Incremental("CON_ID ",.F.)
ENDIF

RETURN .T.
/*
// Ejecuta Cancelar
*/
FUNCTION CANCEL()
RETURN .T.

/*
// Ejecución PreGrabar
*/
FUNCTION PRESAVE()
LOCAL lResp:=.T.

lResp:=oCONTENIDOS:ValUnique(oCONTENIDOS:CON_ID )
IF !lResp
MsgAlert("Registro "+CTOO(oCONTENIDOS:CON_ID),"Ya Existe")
ENDIF

RETURN lResp

/*
// Ejecución despues de Grabar
*/
FUNCTION POSTSAVE()

EJECUTAR("DPCNTMNU",oCONTENIDOS:CON_ID)

RETURN .T.

/*
<LISTA:CON_ID:Y:SAY:Y:N:Y:Id del Registro,CON_CODIGO:N:GET:N:N:N:Contenido,CON_ACTIVO:N:CHECKBOX:N:N:Y:Activo>
*/
User avatar
jnavas
 
Posts: 479
Joined: Wed Nov 16, 2005 12:03 pm
Location: Caracas - Venezuela

Re: Migrating to Harbour

Postby Antonio Linares » Wed Dec 17, 2014 7:32 am

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 8 guests

cron