Propuesta para que hagan un curso virtual FW

Propuesta para que hagan un curso virtual FW

Postby leandro » Tue Jul 09, 2024 2:18 pm

Hola buenos días para todos,

Que pena molestar con este tema, y no se, si muchos lo necesitemos, pero me gustaría de FW hiciera un curso o capacitación virtual, quizás no iniciar desde cero, ya que en este foro hay usuarios muy avanzados, pero si por ejemplo clarificar muchas dudas que tenemos, también aclarar cosas básicas que por lo menos nosotros, no sabemos hacer, como crear un BAT para compilar, de no ser por en su momento el VERCE (y nuestro amigazo William Morales) y en este momento FIVEDIT, nunca hubiera sido capaz de generar si quiera un ejecutable.

Otro de los temas que mas gustaría aprender y entender es el tema de las clases, ya que realmente estamos dependiendo demasiado de los maestros de este foro, para poder hacer los ajustes y personalizaciones que deseemos, un ejemplo claro que tengo, es que de mi parte desearía poder hacer algunos ajustes al EasyReport, que venimos pidiendo hace años, y no me estoy quejando, solo que me gustaría poder aportar algo a esta comunidad.

Otro ejemplo claro es poder hacer la migración de nuestra aplicación a 64 bits, no tenemos ni idea por donde empezar, en este foro hay demasiada información, pero es realmente frustrante intentar hacer la migración sin siquiera poder generar un simple ejecutable de prueba.

No estoy pidiendo que esto sea gratis, simplemente que se establezca un precio, un temario y una fecha posible de inicio.

Creo que necesitamos de esto de manera urgente, ya que no veo que lleguen nuevos usuarios a la comunidad, si no estoy mal el ultimo novato fui yo, y me ha tocado aprender apunta de ganas y gracias a este maravilloso foro, al inicio por correo electrónico (gracias Armando Estrada); lo menciono por que, si llegan a faltar algunos de los maestros, y no lo digo por nada malo, simplemente un día amanecen sin ganas de hacer nada, con ganas de pensionarse jejejejeje (como también nos puede pasar a nosotros) y vamos a quedar bloqueados con las actualizaciones futuras a nuestras aplicaciones.

Esta es una de las razones principales por las que no hemos querido ahondar en el tema de el desarrollo web usando las herramientas como MOD_HARBOUR y demás, ya que ni si quiera logramos hacer la instalación del apache y el servidor web, imagina en caso que necesitemos algo mas avanzado sobre ese tema, por esto preferimos usar herramientas mas populares que simplemente escribes una duda y tienes miles de respuestas en Google.

Me gustaría que se hiciera este curso y poder subir mi nivel de fw, para ver si podemos continuar con este lenguaje de programación del cual se enamoro mi tío y me animo a usarlo, la idea es que en nuestra empresa se use como herramienta principal y se pueda capacitar a los futuros colaboradores en nuestra empresa.

Otro de los temas del curso que debería ser imprescindible es WEBVIEW e inteligencia artificial.

De antemano gracias.
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1688
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Propuesta para que hagan un curso virtual FW

Postby csincuir » Tue Jul 09, 2024 3:10 pm

Hola Leandro
Apoyo tu idea, por mi lado, me gustaría los temas de migrar a 64 Bits, y Web / WebView

Saludos cordiales.

Carlos.
csincuir
 
Posts: 411
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Propuesta para que hagan un curso virtual FW

Postby carito » Tue Jul 09, 2024 4:23 pm

Me parece muy buena la idea de Leandro,

debemos actualizar nuestros conocimientos , como pasar a 64 bit, entorno web
Me intereza, gracias, saludos a todos
Carito
carito
 
Posts: 86
Joined: Sat Dec 03, 2016 2:49 pm

Re: Propuesta para que hagan un curso virtual FW

Postby Antonio Linares » Tue Jul 09, 2024 4:36 pm

Por nuestra parte, total disponibilidad a hacer un web seminar y tratar todos esos temas :-)

Lo único que hace falta es concretar unas fechas y horas, y los asistentes

Cuando querais!
regards, saludos

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

Re: Propuesta para que hagan un curso virtual FW

Postby Enrrique Vertiz » Wed Jul 10, 2024 2:13 am

Los temas de como implementar webview2 me parecen interesantisimos, migracion a 64 bits, entre otros
+1
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 24.09, BCC74, MySQL 8.0.X, SQLLIB 1.9m
Enrrique Vertiz
 
Posts: 548
Joined: Fri Oct 07, 2005 2:17 pm
Location: Lima - Peru

Re: Propuesta para que hagan un curso virtual FW

Postby leandro » Thu Jul 11, 2024 9:44 am

Que bueno que varios se hayan unido a la iniciativa :D

Antonio será que nos puedes dar una fecha estimada, el precio del curso y un temario, para ver cuantos se unen. No se si sea conveniente crear un formulario en donde los que estemos interesados podamos hacer la inscripción.

De antemano gracias.
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1688
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Propuesta para que hagan un curso virtual FW

Postby Victor Casajuana Mas » Thu Jul 11, 2024 6:14 pm

Curso de udemy?

Enviado desde mi motorola edge 20 mediante Tapatalk
Victor Casajuana Mas
 
Posts: 11
Joined: Thu Jun 06, 2019 1:15 pm

Re: Propuesta para que hagan un curso virtual FW

Postby Rick Lipkin » Thu Jul 11, 2024 9:07 pm

To All

I think it is important to look at SQL ADO and move away from dbf\cdx-ntx ... In it's day .dbf was the premiere backend .. I can tell you if I was given a Corporate\Enterprise app to create and I went to the CIO and told that person I was going to use dbase .dbf for a back-end .. I would get laughed out of the CIO's office .. SQL is the defacto database back end .. You have multiple SQL backends to chose from ..

MS Access for local backend
MS Sql Server for Enterprise backend
Oracle

Several other Sql databases are also very popular ...

Class ADO is VERY powerful and object oriented database code .. and it is very powerful and easy to learn. Lots of code examples in this forum.

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Propuesta para que hagan un curso virtual FW

Postby Otto » Fri Jul 12, 2024 8:44 am

Hello Rick,

I don't think you're correct here.

I believe in the Mod Harbour area or remote server and other multi-user applications are not secure and up-to-date anymore, DBF is a first-class database.

Very simple in design, no overhead. Practically like an Excel table, and the whole world works with Excel.
What databases like SQL, etc. do for you and hide from you, you can easily do yourself. Also, note the extreme performance capability of the operating system.

What data volumes and user numbers are you actually talking about?

It often happens that people fall for marketing tricks, and the SQL and database sellers are cunning and have a strong lobby.

Give me a small example where you have real advantages with SQL.
I mean, one that can be argued 1:1 against a good DBF approach.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: Propuesta para que hagan un curso virtual FW

Postby Rick Lipkin » Fri Jul 12, 2024 12:53 pm

Otto .. here is a sample data entry that I use to determine ownership of the software ... notice there are no record locks, and to save a record all you have to use is the method oRs:Update()


Code: Select all  Expand view  RUN

// ownview.prg
//
//

#INCLUDE "FIVEWIN.CH"

//-------------------------------
FUNC _OwnView( cMode,oWndMain,oFontB )


LOCAL SAYING, oWndChild, oGrps, oRsOwn, cSQL, oERR, oIco
LOCAL cTITLE, oBTN1, oBTN2
Local lOk,lClosed,oBmp

Local oOwner,oAddress1,oAddress2,oCity,oState,oZip,oContact,oPhone,oDivision
Local cOwner,cAddress1,cAddress2,cCity,cState,cZip,cContact,cPhone,cDivision
Local oSay1,oSay2,oSay3,oSay4,oSay5,oSay6,oSay7,oSay8,oSay9,oSay10

Local cLast,oLast,oFein,cFein

lCLOSED := .F.    // trap valid

IF xSUPER = 'Y' .or. xAdmin = "Y"
ELSE
   Saying := "Sorry .. Supervisor Rights needed here"+chr(10)
   Saying += "You have Insufficients Permissions"+chr(10)
   MsgInfo( SAYING )
   RETURN(.F.)
ENDIF

LightGreyGrad()

oRsOwn := TOleAuto():New( "ADODB.Recordset" )
oRsOwn:CursorType     := 1        // opendkeyset
oRsOwn:CursorLocation := 3        // local cache
oRsOwn:LockType       := 3        // lockoportunistic

cSQL := "SELECT * FROM Owner"

TRY
   oRSOwn:Open( cSQL,xCONNECT )
CATCH oErr
   MsgInfo( "ERROR Opening Owner Table " )
   RETURN(.F.)
END TRY


If oRsOwn:Eof
   Saying := "No Owners Information Exists"+chr(10)
   Saying += "Would you like to CREATE a new Owner ?"+chr(10)

   If MsgNoYes( saying )
     cMode := "A"
   Else
      oRsOwn:CLose()
      Return(.f.)
   ENdif
ELse
   cMode := "E"
ENdif

If cMODE = "A"

   cOwner     := space(35)
   cDivision  := space(35)
   cAddress1  := space(25)
   cAddress2  := space(25)
   cCity      := space(25)
   cState     := space(2)
   cZip       := space(10)
   cContact   := space(35)
   cPhone     := space(13)
   cLast      := 1000
   cFein      := space(10)

Else

   cOwner      := if(empty(oRsOwn:FIelds("Owner"):Value),space(35),;
                    substr(oRsOwn:FIelds("Owner"):Value+space(35),1,35))
   cDivision   := if(empty(oRsOwn:FIelds("Division"):Value),space(35),;
                    substr(oRsOwn:FIelds("Division"):Value+space(35),1,35))

   cAddress1   := if(empty(oRsOwn:FIelds("Address1"):Value),space(25),;
                    substr(oRsOwn:FIelds("Address1"):Value+space(25),1,25))
   cAddress2   := if(empty(oRsOwn:FIelds("Address2"):Value),space(25),;
                    substr(oRsOwn:FIelds("Address2"):Value+space(25),1,25))
   cCity       := if(empty(oRsOwn:FIelds("City"):Value),space(25),;
                    substr(oRsOwn:FIelds("City"):Value+space(25),1,25))
   cState      := if(empty(oRsOwn:FIelds("State"):Value),space(2),;
                    substr(oRsOwn:FIelds("State"):Value+space(2),1,2))
   cZip        := if(empty(oRsOwn:FIelds("Zip"):Value),space(10),;
                    substr(oRsOwn:FIelds("Zip"):Value+space(10),1,10))
   cContact    := if(empty(oRsOwn:Fields("Contact"):Value),space(35),;
                    substr(oRsOwn:FIelds("Contact"):Value+space(35),1,35))
   cPhone      := if(empty(oRsOwn:FIelds("Phone"):Value),space(13),;
                    substr(oRsOwn:FIelds("Phone"):Value+space(13),1,13))
   cLast       := if(empty(oRsOwn:FIelds("LastInvoice"):Value),space(10),;
                    substr(oRsOwn:FIelds("LastInvoice"):Value+space(10),1,10))
   cFein       := if(empty(oRsOwn:FIelds("Fein"):Value),space(10),;
                    substr(oRsOwn:FIelds("Fein"):Value+space(10),1,10))


ENDIF

DarkGreyGrad()

cTITLE := "Business or Owner Information "

DO CASE
CASE cMODE = "E"
     cTITLE := "Business or Owner Information   EDIT   "
CASE cMODE = "A"
     cTITLE := "Business or Owner Information    ADD   "
CASE cMODE = "V"
     cTITLE := "Business or Owner Information   VIEW   "
ENDCASE

DEFINE ICON oICO RESOURCE "CONFIG"
DEFINE BITMAP oBmp RESOURCE "OWNVIEW"

DEFINE WINDOW oWndChild              ;
       MDICHILD                      ;
       FROM 0,1 to 30,55             ;
       NOMINIMIZE                    ;
       ICON oIco                     ;
       NOZOOM                        ;
       OF oWndMain                   ;
       TITLE cTITLE

   DEFINE DIALOG oGRPS RESOURCE "OWNVIEW" ;
   of oWndChild

   REDEFINE SAY oSay1  ID 120 of oGrps UPDATE
                oSay1:SetFont( oFontB )
   REDEFINE SAY oSay2  ID 121 of oGrps UPDATE
                oSay2:SetFont( oFontB )
   REDEFINE SAY oSay3  ID 122 of oGrps UPDATE
                oSay3:SetFont( oFontB )
   REDEFINE SAY oSay4  ID 123 of oGrps UPDATE
                oSay4:SetFont( oFontB )
   REDEFINE SAY oSay5  ID 124 of oGrps UPDATE
                oSay5:SetFont( oFontB )
   REDEFINE SAY oSay6  ID 125 of oGrps UPDATE
                oSay6:SetFont( oFontB )
   REDEFINE SAY oSay7  ID 126 of oGrps UPDATE
                oSay7:SetFont( oFontB )
   REDEFINE SAY oSay8  ID 127 of oGrps UPDATE
                oSay8:SetFont( oFontB )
   REDEFINE SAY oSay9  ID 128 of oGrps UPDATE
                oSay9:SetFont( oFontB )
   REDEFINE SAY oSay10  ID 129 of oGrps UPDATE
                oSay10:SetFont( oFontB )


   IF cMODE = "A" .or. cMODE = "E"

      REDEFINE GET oOWNER     VAR cOWNER     ID 220 of oGRPS UPDATE
      REDEFINE GET oDivision  VAR cDivision  ID 225 of oGRPS UPDATE
      REDEFINE GET oADDRESS1  VAR cADDRESS1  ID 230 of oGRPS UPDATE
      REDEFINE GET oADDRESS2  VAR cADDRESS2  ID 240 of oGRPS UPDATE
      REDEFINE GET oCITY      VAR cCITY      ID 250 of oGRPS UPDATE
      REDEFINE GET oSTATE     VAR cSTATE     ID 260 of oGRPS PICTURE "@!" UPDATE
      REDEFINE GET oZIP       VAR cZIP       ID 270 of oGRPS UPDATE
      REDEFINE GET oLast      VAR cLast      ID 271 of oGRPS PICTURE( "9999999999" ) UPDATE

      REDEFINE GET oCONTACT   VAR cCONTACT   ID 280 of oGRPS UPDATE
      REDEFINE GET oPHONE     VAR cPHONE     ID 290 of oGRPS PICTURE "(999)999-9999" UPDATE
      REDEFINE GET oFein      VAR cFein      ID 291 of oGRPS PICTURE  "@!" UPDATE

   ELSE     // view

      REDEFINE GET oOWNER     VAR cOWNER     ID 220 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oDivision  VAR cDivision  ID 225 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oADDRESS1  VAR cADDRESS1  ID 230 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oADDRESS2  VAR cADDRESS2  ID 240 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oCITY      VAR cCITY      ID 250 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oSTATE     VAR cSTATE     ID 260 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oZIP       VAR cZIP       ID 270 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oLast      VAR cLast      ID 271 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oCONTACT   VAR cCONTACT   ID 280 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oPHONE     VAR cPHONE     ID 290 of oGRPS COLOR CLR_BLACK, 16053492 READONLY
      REDEFINE GET oFein      VAR cFein      ID 291 of oGRPS COLOR CLR_BLACK, 16053492 READONLY


   ENDIF

   REDEFINE BTNBMP oBtn1 ID 201 of oGrps   ;
         RESOURCE "OK" ;
         PROMPT "Ok" LEFT 2007;
         ACTION ( IF(cMODE = "V",lOK := .T. , lOK := _busrules(cMode,cOwner,oOwner ) ), ;
                  IF(cMODE = "V",lOK := .T. , if(lOK = .T., _doit( cMODE, oRsOwn,cOwner,cAddress1,cAddress2,;
                                                                   cCity,cState,cZip,cContact,cPhone,cDivision,cLast,cFein ),)),;
                  IF(lOK = .T., oWndChild:END(), ) ,;
                  IF(lOK = .T., _cleanup(), ));
         GRADIENT GreyButtonGrad()

   REDEFINE BTNBMP oBtn2 ID 202 OF oGrps   ;
         RESOURCE "CANCEL" ;
         PROMPT "Cancel" LEFT 2007;
         ACTION ( lOK := .F., oWndChild:END()  );
         GRADIENT GreyButtonGrad()


    ACTIVATE DIALOG oGrps NOWAIT ;  // It has to be NonModal --> NOWAIT clause
           ON INIT oGrps:Move(0,0);
           ON PAINT (PalBmpDraw( hDC, 0, 0, oBmp:hBitmap ));
           VALID (!GETKEYSTATE( 27 ))  // do not allow esc key here

ACTIVATE WINDOW oWndChild ;
   ON INIT (  ;
           oWndChild:bResized := {|| oGrps:SetSize( oWndChild:nWidth, oWndChild:nHeight, .t. ) }, ;
           oGrps:ReFresh());
           VALID ( IIF( !lCLOSED, _ExitPgm(.T.,oRsOwn,@lClosed,oBmp  ) , .F. ))

RETURN( lOK )

//---------------------------------
Static FUNC _Busrules(cMode,cOwner,oOwner)

LOCAL SAYING


IF cOWNER  = "   "
   SAYING := "SORRY ... Business or Owners Name is a REQUIRED field"
   MsgInfo( SAYING )
   oOWNER:SetFocus()
   RETURN(.F.)
ENDIF

RETURN(.T.)

//---------------------------------
Static FUNC _Doit( cMODE, oRsOwn,cOwner,cAddress1,cAddress2,;
                   cCity,cState,cZip,cContact,cPhone,cDivision,cLast,cFein )

Local cEid

IF cMODE = 'V'
   RETURN(.T.)
ENDIF

IF cMODE = 'A'
   cEid := _GenEID()
   If cEid = "BOGUS"
      Saying := "Error Creating Primaty Key"
      Msginfo( Saying )
      Return(.f.)
   ENdif

   oRsOwn:AddNew()
   oRsOwn:Fields("OwnerEid"):Value := cEid
ENDIF

oRsOwn:FIelds("OWNER"):Value       := cOWNER
oRsOwn:FIelds("Division"):Value    := cDivision
oRsOwn:FIelds("ADDRESS1"):Value    := cADDRESS1
oRsOwn:FIelds("ADDRESS2"):Value    := cADDRESS2
oRsOwn:FIelds("CITY"):Value        := cCITY
oRsOwn:FIelds("STATE"):Value       := cSTATE
oRsOwn:FIelds("ZIP"):Value         := cZIP
oRsOwn:Fields("contact"):Value     := cCONTACT
oRsOwn:FIelds("PHONE"):Value       := cPHONE
oRsOwn:Fields("LastInvoice"):Value := cLast
oRsOwn:Fields("FEIN"):Value        := cFein

oRsOwn:Update()

RETURN(NIL)

//----------------------
Static FUNC _Cleanup()

RETURN(.T.)

//---------------------
Static Func _GenEid()

LOCAL nRAND, cRAND, oRs,oErr,cSql

oRs := TOleAuto():New( "ADODB.Recordset" )
oRs:CursorType     := 1        // opendkeyset
oRs:CursorLocation := 3        // local cache
oRs:LockType       := 3        // lockoportunistic

cSQL := "SELECT OwnerEid from Owner"

TRY
   oRs:Open( cSQL,xCONNECT )
CATCH oErr
   MsgInfo( "Error in Opening OWNER table" )
   RETURN(.F.)
END TRY

IF oRs:Eof
   oRs:Close()
   cRAND := "10000000"
   RETURN( cRAND )
ENDIF

cRAND := 'BOGUS'

DO WHILE .T.

   nRAND := nRANDOM(10000000000000000)

   // 1 is reserved and 0 is a null key //

   IF nRAND = 1 .or. nRAND = 0 .or. nRAND = NIL
      LOOP
   ENDIF

   cRAND := alltrim(STR(nRAND,15))

   IF oRs:eof
   ELSE
      oRs:MoveFirst()
      oRs:Find("OwnerEid = '"+cRAND+"'" )
   ENDIF

   IF oRs:eof
      EXIT
   ELSE
      LOOP
   ENDIF

   EXIT

ENDDO

oRs:CLose()
oRs := nil

RETURN( cRAND )

//-----------------------
Static FUNCTION _ExitPgm( lCLEAN,oRsOwn,lClosed,oBmp,oWndMain )

IF lCLEAN = .T.
   lCLOSED := .T.
   oRsOwn:Close()

   LightGreyGrad()

   oRsOwn := NIL
   oBmp:End()

   _cleanup()
ENDIF

RETURN( lCLOSED )

//-- END




 
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Propuesta para que hagan un curso virtual FW

Postby Otto » Fri Jul 12, 2024 2:28 pm

Dear Rick,

You can solve this task just as well with DBF, and I think the source code would be more understandable.

I had the program explained to me by ChatGPT.

Please note that I made my statement under the premise: 'Mod Harbour area or remote server and other multi-user applications are not secure and up-to-date anymore.'

File server applications should really be rejected today, except in the most extreme emergencies or when dealing with very cost-conscious customers.
But for professional use, these are applications that haven't yet been brought up to current standards of technology.

I really don't see any advantage here, except that you need a server and lose the lightness of Harbour.


Best regards,
Otto


This Harbour-based GUI application is designed to manage information about business owners or company proprietors. Here is a detailed overview of what the application does:

Check User Permissions:

The application verifies if the user has supervisor or administrator rights (xSUPER = 'Y' .or. xAdmin = "Y"). If not, it displays an error message and exits.
Connect to Database:

The application opens a DBF file named "Owner" which contains owner information.
Retrieve Data or Create New Record:

If no data is present in the table (EOF()), the application prompts the user to create a new owner record.
If data is present, the application loads the owner's information for editing.
Define User Interface:

The application defines a window and a dialog box with various input fields (SAY and GET) for owner information such as name, address, city, state, zip code, contact, phone number, and FEIN (Federal Employer Identification Number).
Modes: Add, Edit, View:

Depending on the mode (cMode), users can add new owner information, edit existing information, or view information only.
In add or edit mode, the input fields are editable.
In view mode, the fields are read-only.
Buttons and Actions:

The application defines two buttons: "OK" and "Cancel".
Clicking "OK" validates the input (_busrules) and either saves or updates the data (_doit).
Clicking "Cancel" closes the window without saving the data.
Data Validation:

The application performs input validation. For example, the owner's name is a required field (_busrules).
Data Storage:

New records are created with a unique ID (_GenEID) and saved to the DBF file.
Existing records are updated with the changed information.
Cleanup and Exit:

When exiting the application, resources are released and the database connection is closed (_ExitPgm and _cleanup).
In summary, this application is designed to manage owner information with functions for adding, editing, and viewing data. It includes a simple GUI, basic data validation, and database interaction using DBF files.

********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: Propuesta para que hagan un curso virtual FW

Postby Rick Lipkin » Fri Jul 12, 2024 2:35 pm

Otto

This topic is also being discussed in the FW section .....

viewtopic.php?f=3&t=44690

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Propuesta para que hagan un curso virtual FW

Postby Otto » Fri Jul 12, 2024 3:26 pm

Rick, I have thought about it again.

When it comes to 'I would get laughed out of the CIO's office ..' it is best if you offer a web application.

Why don't you do it with mod harbour?
Here is a mod harbour version of your example. Source code is included for testing.
Best regards,
Otto

Image

Image

YOUR BACKEND
Here you can implement and process all the business logic.
The best part about mod_harbour is that you can use pure Harbour here - everything Harbour can do, without a learning curve.

Image

ownership.html

Code: Select all  Expand view  RUN

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Owner Information Form</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style>
        body {
            background-color: #f8f9fa;
        }
        .form-container {
            max-width: 800px;
            margin: auto;
            padding: 20px;
            background-color: #ffffff;
            border: 1px solid #e3e3e3;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        .form-container h2 {
            color: #007bff;
        }
        .form-control {
            background-color: rgba(255, 228, 196, 0.6);
        }
        .form-control:focus {
            border-color: #80bdff;
            box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
        }
        .btn-primary {
            background-color: #007bff;
            border-color: #007bff;
        }
        .btn-primary:hover {
            background-color: #0056b3;
            border-color: #0056b3;
        }
    </style>
</head>
<body>
    <div class="container mt-5">
        <div class="form-container">
            <h2 class="mb-4">Business or Owner Information</h2>
            <form id="ownerForm">
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label for="ownerName" class="form-label"><i class="fas fa-user"></i> Owner Name</label>
                            <input type="text" class="form-control" id="ownerName" maxlength="35" required>
                        </div>
                        <div class="mb-3">
                            <label for="division" class="form-label"><i class="fas fa-building"></i> Division</label>
                            <input type="text" class="form-control" id="division" maxlength="35">
                        </div>
                        <div class="mb-3">
                            <label for="address1" class="form-label"><i class="fas fa-map-marker-alt"></i> Address 1</label>
                            <input type="text" class="form-control" id="address1" maxlength="25">
                        </div>
                        <div class="mb-3">
                            <label for="address2" class="form-label"><i class="fas fa-map-marker-alt"></i> Address 2</label>
                            <input type="text" class="form-control" id="address2" maxlength="25">
                        </div>
                        <div class="mb-3">
                            <label for="city" class="form-label"><i class="fas fa-city"></i> City</label>
                            <input type="text" class="form-control" id="city" maxlength="25">
                        </div>
                        <div class="mb-3">
                            <label for="state" class="form-label"><i class="fas fa-flag"></i> State</label>
                            <input type="text" class="form-control" id="state" maxlength="2">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label for="zip" class="form-label"><i class="fas fa-mail-bulk"></i> Zip Code</label>
                            <input type="text" class="form-control" id="zip" maxlength="10">
                        </div>
                        <div class="mb-3">
                            <label for="contact" class="form-label"><i class="fas fa-user-friends"></i> Contact</label>
                            <input type="text" class="form-control" id="contact" maxlength="35">
                        </div>
                        <div class="mb-3">
                            <label for="phone" class="form-label"><i class="fas fa-phone-alt"></i> Phone</label>
                            <input type="text" class="form-control" id="phone" maxlength="13" placeholder="(999)999-9999">
                        </div>
                        <div class="mb-3">
                            <label for="fein" class="form-label"><i class="fas fa-id-card"></i> FEIN</label>
                            <input type="text" class="form-control" id="fein" maxlength="10">
                        </div>
                    </div>
                </div>
                <button type="submit" class="btn btn-primary"><i class="fas fa-check"></i> Submit</button>
                <button type="reset" class="btn btn-secondary"><i class="fas fa-times"></i> Cancel</button>
            </form>
        </div>
    </div>

    <script>
        $(document).ready(function() {
            $("#ownerForm").on("submit", function(event) {
                event.preventDefault();
               
                let ownerData = {
                    ownerName: $("#ownerName").val(),
                    division: $("#division").val(),
                    address1: $("#address1").val(),
                    address2: $("#address2").val(),
                    city: $("#city").val(),
                    state: $("#state").val(),
                    zip: $("#zip").val(),
                    contact: $("#contact").val(),
                    phone: $("#phone").val(),
                    fein: $("#fein").val()
                };

                // Example of validation (more can be added)
                if (ownerData.ownerName.trim() === "") {
                    alert("Owner name is required.");
                    return;
                }

                // Display form data in console (replace with actual submission logic)
                console.log(ownerData);

                // Optionally, send data to server
                $.ajax({
                    type: "POST",
                    url: "endpoint.prg",
                    data: JSON.stringify(ownerData),
                    contentType: "application/json",
                    success: function(response) {
                        console.log("Data submitted successfully:", response);
                    },
                    error: function(error) {
                        console.error("Error submitting data:", error);
                    }
                });
               
                alert("Form submitted successfully!");
            });

            $(".form-control").on("focus", function() {
                $(this).css("background-color", "rgba(255, 239, 213, 0.8)");
            }).on("blur", function() {
                $(this).css("background-color", "rgba(255, 228, 196, 0.6)");
            });
        });
    </script>
</body>
</html>


 




endpoint.prg

Code: Select all  Expand view  RUN


REQUEST DBFCDX
REQUEST DBFFPT

function main()
    local hdata := {=>} 
    local hPost:= {=>}
    local nIdx := 0
    local aParameters := {}
    local speedtest :=  hb_milliseconds()
    *------------------------------------------------------------------------------
   
    logline( "<H>", time() )
   
    hb_jsondecode( AP_Body(), @hPost )
    logline( "-> hPost", ValToChar( hPost ) )
   
    aParameters :=  hb_HKeys( hPost )
    logline( "hb_HKeys", ValToChar ( aParameters ) )
   
    FOR nIdx := 1 to len( aParameters )
    logline( aParameters[ nIdx ],  ValToChar ( hb_HGetDef( hPost, aParameters[ nIdx ], "---" ) )   )
    next

    /*
    Here you can implement and process all the business logic. The best part about
    mod_harbour is that you can use pure Harbour here - everything Harbour can do,
    without a learning curve.

    */


    logLine("nach do while", "fertig")

    hData[ 'error' ] := 'false'
    hData[ 'posted' ] := 'Data Was Posted Successfully'
    hData[ 'hspeed' ] := str( hb_milliseconds() - speedtest )
    CLOSE
   

    logline( 'speedtest' , hData[ 'hspeed' ] )

    AP_SetContentType( "application/json" )

 

    ?? hb_jsonEncode( hdata, .T. )  // T=pretty
   
return NIL
//----------------------------------------------------------------------------------------//



INIT PROCEDURE PrgInit
   
    SET CENTURY ON
    SET EPOCH TO YEAR(DATE())-98
   
    SET DELETED ON
    SET EXCLUSIVE OFF
   
    REQUEST HB_Lang_DE
   
    HB_LangSelect("DE")
   
    SET DATE TO GERMAN
   
    rddsetdefault( "DBFCDX" )
   
    EXTERN DESCEND
   
RETURN
//----------------------------------------------------------------------------//  

function logline( cText, cWert )
    //Standardfunktion
    local cLog
    local cFile := ""
    local filenoExt := STRTRAN( AP_FileName()  , hb_GetEnv( "PRGPATH" ),"")

    local cLine := "┌────────────────────────────────────────────────────────────────────────┐"
    local nlen := 0


    filenoExt :=  substr( filenoExt,2, ( len( filenoExt ) - 5 ) )
   
    cFile := hb_GetEnv( "PRGPATH" ) + "/" + filenoExt + ".log"

    cLog := memoread( cFile )




    if VALTYPE(cText) = "U"
        cText := ""
    endif
    if VALTYPE(cWert) = "U"
        cWert := ""
    endif

    if cText = "<H>"
       
        cLine += CRLF
        cLine += "│ " + cWert
        FOR nlen := 1 to ( 71 - len( cWert ) )
           cLine += " "
        NEXT
        cLine += "│ "
        cLine += CRLF
        cLine += "└────────────────────────────────────────────────────────────────────────┘"
        cLine += CRLF
        cLog += cLine
                   
    else
    cLog   +=  ALLTRIM( str(procline(1)) ) + "    "  + PadR( cText, 50 ) + ":  " + cWert + CRLF

         

    endif
   
    MEMOWRIT( cFile, cLog, .f. )

return nil
//----------------------------------------------------------------------------//

 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: Propuesta para que hagan un curso virtual FW

Postby leandro » Fri Jul 12, 2024 7:08 pm

Otto buenas tardes como estas?

Deberías, si dispones del tiempo :oops: , crear el formulario de inscripción para el curso y de paso también hacer la integración con la pasarela de pago, para irle dando una formalidad al inicio de las clases. jejejejeje

PDTA. ya compre la libreta de apuntes jajajajajaja

Es una idea :D

De antemano gracias
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1688
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Propuesta para que hagan un curso virtual FW

Postby Otto » Fri Jul 12, 2024 7:39 pm

Hello Leandro,

I support your proposal and am glad that you are taking the initiative.

I hosted the first Fivewin/Harbour meeting here in Sillian back then. The registration form is still online. At that time, we didn't have Mod Harbour yet, so it was a Google form.

https://goo.gl/forms/sxCZqjWdHFnMyr5T2

viewtopic.php?f=3&t=33515&start=45

At the moment, I am a bit biased. I think that the development of Harbour towards SQL is an own goal.

New Harbour users won't be found that way. The club will become more exclusive, and what made Clipper special was that it was a database language.
If I now strive for SQL, then I can use any language I want. We will become interchangeable.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 105 guests