New FTDN January/Enero 2019 (FWH 19.01)

New FTDN January/Enero 2019 (FWH 19.01)

Postby Antonio Linares » Mon Feb 11, 2019 1:08 pm

JANUARY 2019
============

* Samples:
- New fwfuncs.prg: Lists all functions/classes included in the FWH library
installed, along with source code. Note: The list may include internal,
obsolete and under development functions also.

* Enhancement: function FW_ArrayToDBF( aArray, [fieldlist], [bProgress], [lOverwrite], ;
[lRecallDeleted], [bTrigger] )
2. fieldlist (optional): Comma separated list or array of field names.
Default all fields. Values are written starting from the first field
till all fields or values are written.
If a fieldlist is provided, the values are written to the fields in that
order. The list can contain blanks or invalid field names and such
fields are skipped.
New parameters 4,5 and 6.
4. lOverWrite (optional default .f.)
- If set to .t., records from the current position are overwritten till
eof and remaining rows are appended.
- Current index order, scope and filter are respected while navigating.
- When an index is set, the records are navigated in the order existing
prior to overwriting the new data.
- Readonly fields with types "+", "=", "@", "I:+" are not overwritten.
5. lRecallDeleted (Optional)
Used only when lOverwrite is .t.
Defaults to .t. when SET DELETED IS OFF.
Defaults to .f. when SET DELETED IS ON.
When .t., all deleted records while navigating are recalled and overwritten.
6. bTrigger (Optional)
If specified, the codeblock is executed for every record, after writing
the data. This codeblock can use autoincrment and modify time field values.

* New: samples\elixir.prg and elixir.rc, shows how to use a TreeView to review all
folders and files.

* New: function FW_TIMEZONE( [lNegative] ) --> Timezone in format +/-HH:MM.
If the optional parameter lNegative is .t., the sign is reversed.

* New: function cRelativePath( cFullPath, [cCurrentPath] )
--> cRelativePath
Optional parameter defaults to current path.
eg: if c:\fwh\samples is the current path,
c:\fwh\bitmaps\pngs\2.png is converted as
"..\bitmaps\pngs\2.png"

* New feature: Recycling of deleted records (dbfcdx only)
-------------------------------------------------------
- To avail this feature, new records should be appended using FWH function
DBFAPPEND() --> nRecNo (Newly appended or recycled record. 0 on failure)
Example usage:
if DBFAPPEND() > 0
// assign values to fields
DBUNLOCK()
endif
instead of
DBAPPEND()
if !NetErr()
// assign values ti fields
DBUNLOCK()
endif

- New function FW_SetRecycleDeleted( uSet ) --> Previous setting
Possible values of the param are nil or .f. or .t.

a)If the parameter is NIL or the function is never called.
This is the default behavior.
DBFAPPEND() function first tries to recycled records if and only if it
has atlest one index tag with for condition "FOR DELETED()"
eg: INDEX ON RECNO() TAG RECYCLE FOR DELETED()
This index is used to quickly pick up a deleted record that can be
locked and recycles it by RECALLing and blanking all fields.
If no such record is found, a new record is appended using DBAPPEND().
If such an index tag is not available, no attempt is made to recycle
deleted records and acts like a normal DBAPPEND()

b)If the parameter is set to .F., recycling is not attempted at all even
if a "FOR DELETED()" tag exists.

c)If the parameter is set to .T., recycling is compulsorily attempted.
For pursposes of optimization,
( i) if a "FOR DELTED()" index exists, that index is used.
( ii) If an index tag with expression "DELTED()" exists, that index is used.
eg: CREATE INDEX ON DELETED() TAG DELETED
(iii) If both the indexes are not availalbe, a new index tag is created
"INDEX ON RECNO() TAG RECYCLE FOR DELETED()". If the dbf is opened
exclusively, this tag is added to the compound index and if opened
in shared mode, this tag is created temporarily in memory.

- TDatabase class adopts the same behavior while appending new records.
- TDataRow also adopts the same behaviour. So when a new record is edited
and saved, deleted records are recycled observing the above rules.
(Note this applies to oBrw:EditSource() method)

* Multiple monitor support functions:

- New function FW_GetAllMonitors() --> Array of TMonitor objects
- Fixes and enhancement to FW_GetMonitor( nthMonitor )

* Fix: RichEdit 64 bits method InsertBitmap() is ok now. It was GPFing.
regards, saludos

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

Re: New FTDN January/Enero 2019 (FWH 19.01)

Postby Antonio Linares » Mon Feb 11, 2019 6:37 pm

Enero 2019
==========
* Ejemplos:
- Nuevo ejemplo fwfuncs.prg: Lista todas las funciones/clases incluidas en las
librerías de FWH instaladas, con el código fuente. Tenga en cuenta que la lista también
puede incluir funciones internas, obsoletas y en desarrollo.

* Mejora: function FW_ArrayToDBF( aArray, [fieldlist], [bProgress], [lOverwrite], ;
[lRecallDeleted], [bTrigger] )
2. fieldlist (opcional): Lista separada por comas o matriz de nombres de campo.
Por defecto todos los campos. Los valores se escriben desde el primer campo hasta
que se escriben todos los campos o valores.
Si se proporciona una lista de campos, los valores se escriben en los campos en
ese orden. La lista puede contener espacios en blanco o nombres de campo no válidos,
en ese caso dichos campos se omiten.
Nuevos parámetros 4, 5 y 6.
4. lOverWrite (opcional, por defecto .F.)
- Si es puesto a .T., los registros desde la posición actual son sobrescritos hasta
alcanzar EOF y que las filas restantes sean añadidas.
- El orden del índice actual, alcance y filtros son respetados mientras se naviega.
- Cuando un índice es puesto, los registros se navegan en el orden existente anterior
a la sobreescritura de los nuevos datos.
- Los campos de sólo lectura con tipos +", "=", "@", "I:+" no son sobrescritos.
5. lRecallDeleted (Opcional)
- Usado sólo cuando lOverWrite es .T.
Se pone por defecto a .T. cuando usamos SET DELETED IS OFF.
Se pone por defecto a .F. cuando usamos SET DELETED IS ON.
Cuando está puesto a .T., todos los registros borrados mientras navegamos, son
recuperados y sobrescritos.
6. bTrigger (Opcional)
- Si se especifica, el bloque de código se ejecuta para cada registro, después de
escribir los datos. Este bloque de código puede usar autoincrementales y modificar
los valores de los campos de tiempo.
* Nuevo ejemplo: elixir.prg y elixir.rc, muestra como usar un control TreeView para
recuperar todas las carpetas (directorios) y ficheros de una determinada carpeta.
* Nueva función: function FW_TIMEZONE( [lNegative] ) --> Timezone en formato +/-HH:MM.
Si el parámeto opcional lNegative es puesto a .T., se cambia de signo.

* Nueva función: function cRelativePath( cFullPath, [cCurrentPath] ) --> cRelativePath
Parámetro opcional por defecto, el camino actual.
Por ejempo: Si c:\fwh\samples es el camino actual, c:\fwh\bitmaps\pngs\2.png se convierte
en "..\bitmaps\pngs\2.png"
* Nueva característica: Reciclaje de registros eliminados (solo rdd dbfcdx)
-------------------------------------------------------------------------
- Para aprovechar esta nueva característica, los nuevos registros deben ser añadidos usando
la dunción de FWH DBFAPPEND() --> nRecNo. (Registro recién agregado o reciclado, 0 en caso
de error) .
Ejemplo de uso:
if DBFAPPEND() > 0
// assign values to fields
DBUNLOCK()
endif

en lugar de

DBAPPEND()
if !NetErr()
// assign values ti fields
DBUNLOCK()
endif
- Nueva función: FW_SetRecycleDeleted( uSet ) --> Configuración anterior
Valores posibles del parámetro: NIL, .F. o .T.

a) Si el parámetro es NIL o la función no es llamada nunca.
Este es el comportamiento por defecto.
La función DBFAPPEND() primero lo intenta con los registros reciclados si y sólo
si tiene al menos una etiqueta de índice para la condición "FOR DELETED()"
Por ejemplo: INDEX ON RECNO() TAG RECYCLE FOR DELETED()
Este índice se usa para recoger rápidamente un registro eliminado que se puede bloquear
y reciclar RECUPERANDO todos los campos.
Si no se encuentra dicho registro, se agrega un nuevo registro usando DBAPPEND().
Si dicha etiqueta de índice no está disponible, no se intentan reciclar los registros
eliminados y actúa como un DBAPPEND() normal.

b) Si el parámetro es puesto a .F., no se intenta el reciclaje de registros incluso
si existe la etiqueta "FOR DELETED()".
c) Si el parámetro es puesto a .T., el reciclaje de registros se intenta obligatoriamente.
( i) Si existe un índice con la etiqueta "FOR DELETED()", se usa ese índice.
( ii) Si existe un índice con la etiqueta "DELETED()", se usa ese índice.
Por ejemplo: CREATE INDEX ON DELETED() TAG DELETED
(iii) Si ambos índices no están disponibles, se crea una nueva etiqueta de índice
"INDEX ON RECNO() TAG RECYCLE FOR DELETED()".
Si el dbf se abre en modo exclusivo, esta etiqueta se agrega al índice compuesto
y si se abre en modo compartido, esta etiqueta se crea temporalmente en la memoria.
- La clase TDatabase adopta el mismo comportamiento mientras se añaden nuevos registros.
- La clase TDataRow también adopta el mismo comportamiento.
Así que cuando un nuevo registro se edita y guarda, los registros eliminados se reciclan
cumpliendo las reglas anteriores.
(Tenga en cuenta que esto se aplica al método oBrw:EditSource())
* Funciones para el soporte de monitores múltiples:
- Nueva función: FW_GetAllMonitors() --> Array of TMonitor objects
Devuelve una matriz con la lista de monitores instalados.
- Correcciones y mejoras en la función FW_GetMonitor( nthMonitor )
* Corrección: En la versión de RichEdit de 64 bits en el método InsertBitmap(). Estaba dando errores GPF.
Ahora está correcta.
regards, saludos

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

Re: New FTDN January/Enero 2019 (FWH 19.01)

Postby Silvio.Falconi » Tue Feb 12, 2019 10:42 am

Antonio,
cRelativePath
If I have an image to "c:\work\prg\bikini\images\2.png"
and I wish save only .\images\2.png because the root of my app is c:\work\prg\bikini

I tried with the function

cFullPath:="c:\work\prg\bikini\images\2.png"
cCurrentPath:= "c:\work\prg\bikini\"

? cRelativePath( cFullPath,cCurrentPath)

it return only images\2.png instead of ..\images\2.png

just an Idea I tried this function

Function UrlImage(curl)
Local aTmp
local nLevel := 1
local x
local cCad :=""

If !empty(cUrl)
aTmp := Hb_ATokens( curl, "\" )

For x = Len( aTmp ) - nLevel + 1 To Len( aTmp )
cCad += AllTrim( aTmp[ x ] )
if x < Len( aTmp )
cCad += "\"
endif
Next x

Endif

return cCad
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: New FTDN January/Enero 2019 (FWH 19.01)

Postby Antonio Linares » Tue Feb 19, 2019 12:18 pm

January 2019 (Revd Build 2)
=========================

* TDatabase:

- Fix in method CreateIndex(): Memory/temporaty indexes are being created
as regular indexes. Fixed.

- Method Create(): Avoids runtime error when the create operation fails for
any reason, eg: dbf exists is already open, etc. In such cases oDbf:Used()
returns .f.

- Improved interface with DataRow: When Datarow object saves changes or
appends new record, the changes automatically made directly by RDD like
fields "+", "=" and triggers are immediately communicated back to datarow
object.

* Fix: Runtime error in function GetRecycledRec() when the dbf contains
field of type "=".

* MariaDB:
- Fix: RowSet is not reading correctly BIGINT values where the number of
digits are 10. Fixed.
- ListIndexes( table ) now shows fulltext indexes also.
regards, saludos

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

Re: New FTDN January/Enero 2019 (FWH 19.01)

Postby Antonio Linares » Wed Feb 20, 2019 4:50 am

Enero 2019 (Construcción revisada - 2)
======================================
* TDatabase:
- Corrección en el método CreateIndex(): Los índices temporales en memoria
estaban siendo creados como índices normales. Corregido.

- Método Create(): Evita el error en tiempo de ejecución cuando la operación
de creación falla por cualquier razón, por ejemplo: el fichero dbf existe o
está abierto, etc... . En tales casos oDbf:Used() devuelve .F.
- Se ha mejorado la interfaz con DataRow: Cuando el objeto Datarow guarda los
cambios o agrega un nuevo registro, los cambios realizados automáticamente
por el RDD como los campos "+", "=" y los disparadores se comunican inmediatamente
al objeto datarow.
* Corrección: Error en tiempo de ejecución en la función GetRecycledRec() cuando el
fichero dbf contiene campos de tipo "=".

* MariaDB:
- Corrección: RowSet no lee correctamente los valores BIGINT donde el número de
dígitos son 10. Corregido.

- ListIndexes( table ) ahora muestra también índices de texto completo.
regards, saludos

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


Return to WhatsNew / Novedades

Who is online

Users browsing this forum: No registered users and 31 guests