From: JC on 26 Sep 2006 08:50 Before in 2,6 VO I had these lines... that they functioned... static global mtr as dbServer static global sit as dbServer static global alu as dbServer static global aalt as string static global aasm as string static global tura as string // These variaveis have that to be static to be able to be compiled, if not the compiler of the error... cod:=GeraTMP(GetEnv('TMP'),'\RSCA',mtr:OrderInfo(DBOI_INDEXEXT)) ; AAdd(aTmp,cod+mtr:OrderInfo(DBOI_INDEXEXT)) mtr:SetOrderCondition( "", {||! mtr:DELETED.and.mtr:aaLt+mtr:aaSm+mtr:tura==aalt+aasm+tura.and.sit:SEEK(mtr:sitf).and.sit:sit4},.T.,,,, ,,,,,,,,) mtr:ClearIndex() ; mtr:CreateIndex(cod,"alu:alu2+mtr:alu1", {||alu:SEEK(mtr:alu1),alu:alu2+mtr:alu1}, .T. ) ; mtr:GoTop() //Unique Now with in the 2,7 it does not create unico indice.... Jose Claudio
From: Marc Verkade [Marti IT] on 26 Sep 2006 09:55 Hai, With these kind of problems, it is wise to split al the inline vars into local vars and have them sorted out. I have absolutely no idea what you are trying to do, but this is rather unreadable... Local sEnvironment As String Local sPath As String Local sOrderInfo As String Local sCod As String // Init the Vars sEnvironment:=GetEnv('TMP') sPath :='\RSCA' sOrderInfo:=mtr:OrderInfo(DBOI_INDEXEXT) // Get the sCod sCod := GeraTmp(sEnvironment,sPath,sOrderInfo) // Add to the array Aadd(aTmp,sCod+sOrderInfo) // Set the Ordercondition mtr:SetOrderCondition( "", {|| !mtr:DELETED .AND. ; (mtr:aaLt+mtr:aaSm+mtr:tura==aalt+aasm+tura) ..AND. ; sit:SEEK(mtr:sitf) .AND.; sit:sit4},.T.) This code looks quite suspicious.. Setting an ordercondition on a Seek Value? I do not know if this will work, let's ask the guru's since I do not use SetOrderConditions.. Anybody? Grtz, Marc > cod:=GeraTMP(GetEnv('TMP'),'\RSCA',mtr:OrderInfo(DBOI_INDEXEXT)) ; > AAdd(aTmp,cod+mtr:OrderInfo(DBOI_INDEXEXT)) > mtr:SetOrderCondition( "", {||! > > mtr:DELETED.and.mtr:aaLt+mtr:aaSm+mtr:tura==aalt+aasm+tura.and.sit:SEEK(mtr:sitf).and.sit:sit4},.T.,,,, > ,,,,,,,,) "JC" <jc(a)san.psi.br> schreef in bericht news:1159275045.323551.175360(a)i3g2000cwc.googlegroups.com... > Before in 2,6 VO I had these lines... that they functioned... > > static global mtr as dbServer > static global sit as dbServer > static global alu as dbServer > static global aalt as string > static global aasm as string > static global tura as string > // These variaveis have that to be static to be able to be compiled, if > not the compiler of the error... > > cod:=GeraTMP(GetEnv('TMP'),'\RSCA',mtr:OrderInfo(DBOI_INDEXEXT)) ; > AAdd(aTmp,cod+mtr:OrderInfo(DBOI_INDEXEXT)) > mtr:SetOrderCondition( "", {||! > > mtr:DELETED.and.mtr:aaLt+mtr:aaSm+mtr:tura==aalt+aasm+tura.and.sit:SEEK(mtr:sitf).and.sit:sit4},.T.,,,, > ,,,,,,,,) > > mtr:ClearIndex() ; mtr:CreateIndex(cod,"alu:alu2+mtr:alu1", > {||alu:SEEK(mtr:alu1),alu:alu2+mtr:alu1}, .T. ) ; mtr:GoTop() > //Unique > > Now with in the 2,7 it does not create unico indice.... > > Jose Claudio >
From: Malcolm Gray on 26 Sep 2006 11:04 Marc Verkade [Marti IT] wrote: > Hai, > With these kind of problems, it is wise to split al the inline vars into > local vars and have them sorted out. > I have absolutely no idea what you are trying to do, but this is rather > unreadable... It also requires us to assume the class in DBSERVER (as it happens we don't use that class, so any comments I make have a noticeable element of guesswork) The index expression "alu:alu2+mtr:alu1" also looks rather dodgy as it could never be run time compiled, but hopefully it is never used. (the string rather than the code block), i wonder if 27 is detecting an error that 26 missed. I wonder what the return values of mtr:CreateIndex and mtr:SetOrderCondition 9and whether anything interesting gets put in status)
From: E?!k V!sser on 26 Sep 2006 11:20 Jose, I agree with Marc it is not very readable. Have you tried setting a relation so you do not have to seek inside the indexexpression? But I think it is a scoping problem. As you have changed from globlas to static globals, the vars cannot be seen inside the RDD's Why does this not compile?, any error? Tried in 27440 and it compiles fine/ GLOBAL mtr AS dbServer GLOBAL sit AS dbServer GLOBAL alu AS dbServer GLOBAL aalt AS STRING GLOBAL aasm AS STRING GLOBAL tura AS STRING Erik "JC" <jc(a)san.psi.br> schreef in bericht news:1159275045.323551.175360(a)i3g2000cwc.googlegroups.com... > Before in 2,6 VO I had these lines... that they functioned... > > static global mtr as dbServer > static global sit as dbServer > static global alu as dbServer > static global aalt as string > static global aasm as string > static global tura as string > // These variaveis have that to be static to be able to be compiled, if > not the compiler of the error... > > cod:=GeraTMP(GetEnv('TMP'),'\RSCA',mtr:OrderInfo(DBOI_INDEXEXT)) ; > AAdd(aTmp,cod+mtr:OrderInfo(DBOI_INDEXEXT)) > mtr:SetOrderCondition( "", {||! > > mtr:DELETED.and.mtr:aaLt+mtr:aaSm+mtr:tura==aalt+aasm+tura.and.sit:SEEK(mtr:sitf).and.sit:sit4},.T.,,,, > ,,,,,,,,) > > mtr:ClearIndex() ; mtr:CreateIndex(cod,"alu:alu2+mtr:alu1", > {||alu:SEEK(mtr:alu1),alu:alu2+mtr:alu1}, .T. ) ; mtr:GoTop() > //Unique > > Now with in the 2,7 it does not create unico indice.... > > Jose Claudio >
From: Marcos Nogueira on 26 Sep 2006 12:42
Jose Claudio, > ... > mtr:ClearIndex() ; mtr:CreateIndex(cod,"alu:alu2+mtr:alu1", > {||alu:SEEK(mtr:alu1),alu:alu2+mtr:alu1}, .T. ) ; mtr:GoTop() Try replacing CreateIndex() with CreateOrder(). Abraços, Marcos Nogueira S. Paulo - Brazil |