TailBite V1.4.2 Windows

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

03/19/08 17:25
Fix #1 : Ok !

[EDIT] 03/19/08 17:59
Fix #2 & #3 :
Replace lines 604 To 619 by these lines.

Code: Select all

BetweenBrackets$  = Mid(function()\HelpLine$, 1, Len(function()\HelpLine$) - Len(StringField(function()\HelpLine$,CountString(function()\HelpLine$, ")")+1,")")))
      StringField(function()\HelpLine$,1,")")
      AfterBrackets$    = Right(function()\HelpLine$, Len(function()\HelpLine$) - Len(BetweenBrackets$))
      count             = CountString(BetweenBrackets$,",")
      If count
        BetweenBrackets$  = Mid(BetweenBrackets$, 2, Len(BetweenBrackets$)-2)
        newHelpLine$      = ""
        For i= 1 To count+1
          temp$ = StringField(BetweenBrackets$,i,",")
          If i = (count+1)
            newHelpLine$ + Trim(temp$)
          Else
            newHelpLine$ + Trim(temp$)+", "
          EndIf
        Next
        function()\HelpLine$="("+BetweenBrackets$+")"+AfterBrackets$
      EndIf
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

Your fix #1 did not work :oops:
Here´s the fix of the fix :

Code: Select all

        QuitBrackers = 0
        While *FileSeeker\b<>')' Or QuitBrackers<>0
          If *FileSeeker\b = '('  : QuitBrackers + 1 : EndIf
          If *FileSeeker\b = ')'  : QuitBrackers - 1 : EndIf
          *FileSeeker+1
          If *FileSeeker>=FileEnd:TBError(Language("TailBite","FileEndErr3"), 1, ""):EndIf
        Wend
Please test it :twisted:
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

Have you an example code which doesn't run with my code ?

And have you tested my second fix ?
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

Progi1984 wrote:Have you an example code which doesn't run with my code ?
I have tested your modifications with my RMChart lib.
Functions that have no Parameters i.e. ProcedureDLL RMC_Init() where read past its endbracket :

Code: Select all

; ProcedureDLL RMC_Init()
macro MP376{
_Procedure376:
  PS376=16
  XOR    eax,eax
  PUSH   eax
  PUSH   eax
  PUSH   eax                                                                                                                                                                                                      
; Protected *MSGText.s
; Protected Text$
; Protected Version$
; 
; RMC_DLL.l = OpenLibrary(#PB_Any,#RMCDLL)
Remember : the function begins after the first bracket ; ProcedureDLL RMC_Init(
Progi1984 wrote:And have you tested my second fix ?
I did only test with RMChart, i have no userlib that has a linked list inside. Could you provide one :?:

Regards Klaus
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

Yes some code here... : http://www.purebasic.fr/english/viewtop ... 063#157063

For no parameters, I will test my code tomorrow... and i send you the Tailbite.pb fixed.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

Your sample code works fine here.
- All linked list entrys are shown
- Quickhelp looks good
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

Test with this code :

Code: Select all

ProcedureDLL Ma0Fonction()
  Debug truc
  ForEach Param()
    MessageRequester("", Param())
  Next
EndProcedure 
ProcedureDLL Ma1Fonction(Param.s())
  Debug truc
  ForEach Param()
    MessageRequester("", Param())
  Next
EndProcedure 
ProcedureDLL Ma2Fonction(truc.l, Param.s())
  Debug truc
  ForEach Param()
    MessageRequester("", Param())
  Next
EndProcedure 
ProcedureDLL Ma3Fonction(truc.l, Param.s(), Param2.l())
  Debug truc
  ForEach Param()
    MessageRequester("", Param())
  Next
EndProcedure 
ProcedureDLL Ma4Fonction(truc.l, Param.s(), Param2.l()) ; Test
  Debug truc
  ForEach Param()
    MessageRequester("", Param())
  Next
  ForEach Param2()
    MessageRequester("", Str(Param2()))
  Next
EndProcedure 
ProcedureDLL Ma5Fonction(truc.l, Param.s(), Param2.Point()) ; Test Num 5
  Debug truc
  ForEach Param()
    MessageRequester("", Param())
  Next
  ForEach Param2()
    MessageRequester("", "X >"+ Str(Param2()\x)+ " - Y >"+ Str(Param2()\y))
  Next
EndProcedure 
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

works fine, except the Ma0Fonction() :wink:
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

And with your last fix ?
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

I tested with your fix to my fix and my second fix for fast help and that runs well :)
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

Hello,
Can TB return is version ?
( Like Pbcompiler.exe / version )
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

Droopy wrote:Hello,
Can TB return is version ?
( Like Pbcompiler.exe / version )
No.
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

Ok i find a way

Code: Select all

Procedure.s TB_Version()
  
  If OSVersion()>=#PB_OS_Windows_Vista
    subkey.s="PureBasic.exe\DefaultIcon\"
  Else
    subkey.s="Applications\PureBasic.exe\DefaultIcon\"
  EndIf
  
  RegOpenKeyEx_(#HKEY_CLASSES_ROOT,@subkey,0,#KEY_READ,@keyhandle)
  Out.s=Space(255)
  DataSize.l=Len(Out)
  RegQueryValueEx_(keyhandle,@name$,0,@Type,@Out,@DataSize)
  RegCloseKey_(keyhandle)
  
  Out=StringField(Out,1,",")
  Out=GetPathPart(Out)+"TailBite\TailBite.exe"
  
  #Chaine="Version ="
  Size=FileSize(Out)
  *Buffer=AllocateMemory(Size)
  
  TBid=ReadFile(#PB_Any,Out)
  ReadData(TBid,*Buffer,Size)
  CloseFile(TBid)
  
  While Ptr<Size
    
    Chaine.s=PeekS(*Buffer+Ptr,Size)
    
    If FindString(Chaine,#Chaine,1)
      Pos=FindString(Chaine,#Chaine,1)
      Chaine=LTrim(RTrim(Mid(Chaine,Pos+Len(#Chaine),Size)))
      Break
    EndIf
    
    If Len(Chaine)
      Ptr+Len(Chaine)
    Else
      Ptr+1
    EndIf
  Wend
  
  FreeMemory(*Buffer)
  ProcedureReturn Chaine
  
EndProcedure
MessageRequester("TB-Version",TB_Version())
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

Droopy wrote:Ok i find a way
wait a minute, here it is :
TailBite V1.3 PR 1.871
[33] MAR 29th 2008 TailBite v1.3 PR 1.871
- added new parameter /VERSION (requested by Droopy)
- fixed recovery of userlib when compiling in unicode and/or threadsafe mode
- improved writelog procedure
- fixed cleaning of temp directory
- added explanation of subsystems to the helpfile
See first post for more details
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

Thanks a lot ABBKlaus :D

Code: Select all

;/ PureBasic 4.10

Procedure.s TBVersion() ; Lance TB /VERSION
  
  If OSVersion()>=#PB_OS_Windows_Vista
    subkey.s="PureBasic.exe\DefaultIcon\"
  Else
    subkey.s="Applications\PureBasic.exe\DefaultIcon\"
  EndIf
  
  RegOpenKeyEx_(#HKEY_CLASSES_ROOT,@subkey,0,#KEY_READ,@keyhandle)
  Out.s=Space(255)
  DataSize.l=Len(Out)
  RegQueryValueEx_(keyhandle,@name$,0,@Type,@Out,@DataSize)
  RegCloseKey_(keyhandle)
  
  Out=StringField(Out,1,",")
  Out=GetPathPart(Out)+"TailBite\TailBite.exe"
  
  pid=RunProgram(Out,"/version","",#PB_Program_Open|#PB_Program_Read|#PB_Program_Hide)
  If pid 
    While ProgramRunning(pid)
      Sortie.s + ReadProgramString(pid) + #crlf$
    Wend
  EndIf
  Sortie=StringField(Sortie,1,Chr(13))
  
  ProcedureReturn Sortie
  
EndProcedure

Procedure.s PBVersion() ; Lance PB /VERSION
  
  If OSVersion()>=#PB_OS_Windows_Vista
    subkey.s="PureBasic.exe\DefaultIcon\"
  Else
    subkey.s="Applications\PureBasic.exe\DefaultIcon\"
  EndIf
  
  RegOpenKeyEx_(#HKEY_CLASSES_ROOT,@subkey,0,#KEY_READ,@keyhandle)
  Out.s=Space(255)
  DataSize.l=Len(Out)
  RegQueryValueEx_(keyhandle,@name$,0,@Type,@Out,@DataSize)
  RegCloseKey_(keyhandle)
  
  Out=StringField(Out,1,",")
  Out=GetPathPart(Out)+"Compilers\PBCompiler.exe"
  
  pid=RunProgram(Out,"/version","",#PB_Program_Open|#PB_Program_Read|#PB_Program_Hide)
  If pid 
    While ProgramRunning(pid)
      Sortie.s + ReadProgramString(pid) + #crlf$
    Wend
  EndIf
  Sortie=StringField(Sortie,1,Chr(13))
  
  ProcedureReturn Sortie
EndProcedure

MessageRequester("Version","PureBasic : "+PBVersion()+#crlf$+"Tailbite     : "+TBVersion())
Post Reply