Usar hbsix

Projeto [x]Harbour - Compilador de código aberto compatível com o Clipper.

Moderador: Moderadores

Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Usar hbsix

Mensagem por JoséQuintas »

Estou há cerca de uma hora procurando como seta pra usar a hbsix mas não encontro.
Como usar os índices compatíveis com SIX?
RddSetDefault("????")
RddRegister("?????")

e linqueditar só hblib?
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7929
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Re: Usar hbsix

Mensagem por Itamar M. Lins Jr. »

Creio que seja a mesma sintaxe utilizada no clipper, eu uso CDX.
Esperimente usar CDX e usar os comandos do SIX.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Re: Usar hbsix

Mensagem por JoséQuintas »

Desculpe, talvez eu tenha confundido tudo.
Estou querendo usar índices CDX compatíveis com SIXCDX.
E que, caso crie o índice pelo xharbour, que ele possa ser lido/atualizado pela SIXCDX e pelo ADS, igual a SIXCDX.
Meu interesse inicial é pela compatibilidade.
Quanto ao uso, já costumo usar a SIXCDX, então seriam apenas os detalhes a alterar no fonte/compilação/linquedição.

tipo...
precisa algum #include no fonte
precisa algum RddSetDefault()
precisa algum rddregister()
precisa linqueditar a hbsix e eliminar dbfcdx

Como eu disse, já procurei muito mas apenas encontro a lista de funções.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Re: Usar hbsix

Mensagem por asimoes »

Olá

Testei aqui:

REQUEST SIXCDX
RddSetDefault("SIXCDX")
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Re: Usar hbsix

Mensagem por JoséQuintas »

Baixei a versão mais recente, e testei aqui.
Dá isto:
Error: Unresolved external '_HB_FUN_SIXCDX'
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Re: Usar hbsix

Mensagem por JoséQuintas »

Tá, resolvi aqui.
Nada tem a ver com hbsix, e sim sixcdx.lib.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Maya Fiuza
Usuário Nível 2
Usuário Nível 2
Mensagens: 50
Registrado em: 11 Out 2010 19:38
Localização: Foz do Iguaçu-PR
Contato:

Re: Usar hbsix

Mensagem por Maya Fiuza »

Complementando...
https://pctoledo.org/forum/viewto ... 110#p42343

Uso a SIX a um bom tempo por causa da velocidade e compactação dos índices (bolsas CDX), mas nunca me aprofundei...
A HBsix possui TODAS as funções da SIX 3 e o uso é idêntico? Se possui funções extras a SIX 3, onde posso obter um descrição das funções da HBsix.
Já visualizei o .CH da HBsix no SRC do Harbour, mas pelo tamanho da lista das funções desta, nota-se que faltam algumas que não possuem relação com o .CH (pré-processamento)...
Harbour III, Qt Framework, HMG's, OOHG
2xExplorer, cxIDE, xEdit, EditPad
SQLite, MySQL, DBF
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Re: Usar hbsix

Mensagem por JoséQuintas »

Procuro apenas compatibilidade com a SIX.
Infelizmente a sixcdx.lib ainda não deu a compatibilidade que eu queria.
Índices com filtro não são compatíveis.
index on codigo for datadesaida=ctod(" / / ")

Ao abrir o índice criado pelo xharbour, recebo "BAD INDEX EXPRESSION".
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Maya Fiuza
Usuário Nível 2
Usuário Nível 2
Mensagens: 50
Registrado em: 11 Out 2010 19:38
Localização: Foz do Iguaçu-PR
Contato:

Re: Usar hbsix

Mensagem por Maya Fiuza »

Entendi, vejo que nosso problema é ambíguo de partida (SIX) e diferente no foco...
No meu contexto, encontrei uma referência que pode ajudar quem chegar aqui buscando a mesma coisa...
HBsix Reference
É boa parte do que procuro, mas preciso de mais, por isso, se alguém encontrar algo melhor, por favor, ficarei feliz.
Harbour III, Qt Framework, HMG's, OOHG
2xExplorer, cxIDE, xEdit, EditPad
SQLite, MySQL, DBF
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7929
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Re: Usar hbsix

Mensagem por Itamar M. Lins Jr. »

Ola!
Nada tem a ver com hbsix, e sim sixcdx.lib.
No Harbour é hbsix, no xHarbour é sixcdx que é o nome antigo ainda.
* Harbour Project source code:
* SIX compatible functions:
* sxChar()
* sxNum()
* sxDate()
* sxLog()
* Sx_Compress()
* Sx_Decompress()
* Sx_TagInfo()
* Sx_TagCount()
* Sx_Tags()
* Sx_SetTag()
* Sx_KillTag()
* Sx_FileOrder()
* Sx_SetFileOrd()
* RDD_Count()
* RDD_Name()
* RDD_Info()
* Sx_IsDBT()
* Sx_AutoOpen()
* Sx_AutoShare()
* Sx_BLOB2File()
* Sx_File2BLOB()
* Sx_dbCreate()
* Sx_VSigLen()
* Sx_MemoExt()
* Sx_MemoBlk()
* Sx_SetMemoBlock()
* Sx_StrxCheck()
* Sx_LockRetry()
* Sx_IsLocked()
* Sx_SetTrigger()
* Sx_VFGet()
Creio que apenas essas sejam as funções portadas.
Tem mais outras...
* Harbour Project source code:
* SIX compatible functions:
* Sx_DefTrigger()

* Harbour Project source code:
* SIX compatible functions:
* _sx_INIinit()
* Sx_INIheader()
*
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Re: Usar hbsix

Mensagem por JoséQuintas »

No Harbour é hbsix, no xHarbour é sixcdx que é o nome antigo ainda.
Aqui tenho instalado apenas xHarbour.
Na pasta de LIBs tem lá sixcdx.lib e hbsix.lib.
Apenas criei o índice pelo xHarbour, e tentei abrir pela SIX, e dá "Bad Index Expression".
Já criando pela SIX, funciona no xHarbour.
Sei lá... vai ver que ter compatibilidade não significa ser compatível.
Deve ser compatível só nos nomes de comandos internos.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
sygecom
Administrador
Administrador
Mensagens: 7131
Registrado em: 21 Jul 2006 10:12
Localização: Alvorada-RS
Contato:

Re: Usar hbsix

Mensagem por sygecom »

Já tentou setar algum parametro de:
SET DBFLOCKSCHEME TO
Com o CDX do Clipper a compatibilidade funciona bem.
Leonardo Machado
xHarbour.org + Hwgui + PostgreSql
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Re: Usar hbsix

Mensagem por JoséQuintas »

Acho que não entendeu...
Crio o índice pelo xharbour e já fecho o programa.
Ao abrir o arquivo pelo Clipper+SIXCDX, sem acesso simultâneo, dá erro.
Alterar o esquema de fazer bloqueio de registro não interfere nisso.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7929
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Re: Usar hbsix

Mensagem por Itamar M. Lins Jr. »

Aqui, não é um forum frequentado pelos desenvolvedores do [x]Harbour.
Se é um bug o melhor a fazer é reportar o problema para eles.
Pesquisei algo na antiga lista e encontrei alguns emails relatando um problema similar.

O titulo é esse:
Przemek Q: SIX "FOR" clause Clipper/Harbour difference
The senior Clipper programmer here wanted me to ask someone this question. I couldn't think of a better person to ask than you! :)

Question:
-------------

When a table's index file is re-opened (it was previously created), does it have to evaluate the FOR clause, or can it wait to do that only when a value in the table row changes?

In SIX, it does not check the FOR expression when it opens an index file. In Harbour, when you open the index file it will evaluate the FOR expression, and if any variables or functions in that expression are not visible, the system will crash (undefined variable/function).

eg. Index on iif(x=3,"a","b") tag "temp" of test.cdx
When the index is opened (set index to...) if X is not visible, Harbour will crash. In Clipper, it will only crash if a row in the table changes value and the index needs to be updated.

Unfortunately, my code has lots of specialized temporary indexes that are created and then used within a specific function. This does not present a problem until a timer event fires, which needs to close files to do "something". Upon reopening those file before RETURNing back the original function, the system crashes because the FOR in the index has variables out of scope.

I can rewrite these but I will probably have to use Private variables and non-Static functions.

Many thanks in advance

--
smu johnson <smujohnson@gmail.com>
E a resposta:
On Tue, 02 Feb 2010, smu johnson wrote:

Hi,

> > When a table's index file is re-opened (it was previously created), does it
> > have to evaluate the FOR clause, or can it wait to do that only when a value
> > in the table row changes?
It does not need to be evaluated and can wait but it has to be valid
expression which can be compiled by macrocompiler.
Anyhow few times people asked to make such test evaluation to detect
some potential problems like missing functions, incompatible aliases
or not logical results as fast as possible and report RTE before
executed code will start some operations which cannot be finished.
Just like someone asked to delay all such tests as long as possible
because he only wanted to skip using the index created by foreign
application with unknown UDFs in KEY and FOR expressions.
In clipper this behavior depends on used RDD and different RDDs
evaluates KEY and FOR expressions first time in different places.
Similar situation is in xHarbour.

> > In SIX, it does not check the FOR expression when it opens an index file.
> > In Harbour, when you open the index file it will evaluate the FOR
> > expression, and if any variables or functions in that expression are not
> > visible, the system will crash (undefined variable/function).
Not crash but generates RTE. You can catch RT errors using BEGIN SEQUENCE
statement.You are right about FOR expression. Harbour DBFCDX evaluates
index KEY and FOR expressions to test their results just after opening
index file. It's CL5.3 DBFCDX / COMIX behavior but CL5.2 DBFCDX / SIXCDX
evaluates only KEY expression when index is open and FOR is evaluated only
when index is updated.

> > eg. Index on iif(x=3,"a","b") tag "temp" of test.cdx
> > When the index is opened (set index to...) if X is not visible, Harbour will
> > crash. In Clipper, it will only crash if a row in the table changes value
> > and the index needs to be updated.
Yes but please use more precise description. RTE is not a crash but
exception which can be fully controlled by programmer. Some important
Clipper features are implemented using RTE, i.e. NETERR() or division
by 0.

> > Unfortunately, my code has lots of specialized temporary indexes that are
> > created and then used within a specific function. This does not present a
> > problem until a timer event fires, which needs to close files to do
> > "something". Upon reopening those file before RETURNing back the original
> > function, the system crashes because the FOR in the index has variables out
> > of scope.
> > I can rewrite these but I will probably have to use Private variables and
> > non-Static functions.
I'll change early expression evaluation in Harbour SIXCDX driver only
so Harbour SIXCDX will work like CL52 DBFCDX / SIX3 SIXCDX and
Harbour DBFCDX will work like CL53 DBFCDX / COMIX verifying both KEY
and FOR expressions when index is opening.

I'll commit it in a while. You should take current Harbour SVN and
rebuild the compiler binaries.

best regards,
Przemek
Continuando...
On Wed, 03 Feb 2010, smu johnson wrote:

Hi,

> > Thanks Przemek.
> > Could you post back here when I should get the SVN etc?
It's already ready in SVN.
I committed it few minutes after I sent you the message.
Look at the ChangeLog:

2010-02-03 11:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rdd/dbfcdx/dbfcdx1.c
! do not verify FOR expression just after loading new index file
in SIXCDX RDD. It's CL52 DBFCDX / SIX3 SIXCDX compatible behavior
but Harbour DBFCDX and CL53 DBFCDX / COMIX verifies both KEY and
FOR expressions when index is loaded.
! fixed RTE numbers to be CL53 compatible when index with wrong
(returning wrong results) KEY or FOR expression is loaded.

also the problem with FILEATTR() is already fixed:
2010-02-02 17:58 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

anyhow you may want to look at:

HB_FGETATTR( <cFileName>, @<nAttr> ) -> <lSuccess>
HB_FSETATTR( <cFileName>, <nAttr> ) -> <lSuccess>

and maybe:

HB_FSETDATETIME( <cFileName>, [<dDate>], [<cTime HH:MM:SS>] ) -> <lSuccess>
HB_FSETDATETIME( <cFileName>, [<tTimeStamp>] ) -> <lSuccess>

HB_FGETDATETIME( <cFileName>, @<tTimeStamp> ) -> <lSuccess>
HB_FGETDATETIME( <cFileName>, @<dDate>, @<cTime> ) -> <lSuccess>

Harbour support timestamp values. You can find more information about
timestamp and other Harbour extensions in doc/xhb-diff.txt

best regards,
Przemek
Com boa vontade, é só criar um arquivo (pequeno) que simule o problema, duvido que não tenha uma resposta.
Enviar para o grupo de desenvolvedores, "harbour-devel@googlegroups.com".

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7929
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Re: Usar hbsix

Mensagem por Itamar M. Lins Jr. »

Ola!
Só complentando...
Não sei se estas correções e acrescimos de funções estão todas no xHarbour porque o xHarbour está praticamente abandonado.
Muitas delas não são compativeis com o xHarbour. A pessoa que copiava "atualizava" o RDD do xHarbour era o Miguel Angel Marchuet, só que pelo acompanhamento que faço dos grupos de desenvolvedores esse elemento é o maior 171.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Responder