Page 29 of 40

Posted: Tue Aug 22, 2006 1:36 pm
by ts-soft
Progi1984 wrote:Any news about a release with update for creating gadgets with PB ?
You can use CreateGadget from PBOSL

Posted: Tue Aug 22, 2006 2:20 pm
by Progi1984
And generate a userlib ?

Posted: Tue Aug 22, 2006 2:26 pm
by ts-soft
You can make a UserLib with TailBite and CreateGadget, but the CreateGadget Lib is required

Posted: Tue Aug 29, 2006 11:12 am
by Dr. Dri
i've found a bug in tailbite, it's makes undefined symbol and dulpicates instructions.

i wanted to make a "BigEndian" lib, and this is an example of working function which doesn't compile.

Code: Select all

ProcedureDLL.w PeekBigEndianW(*MemoryBuffer)
  !MOV   eax, dword [p.p_MemoryBuffer]
  !MOV    ax,  word [eax]
  !BSWAP eax
  !SHR   eax, 16
  ProcedureReturn
EndProcedure
if i get the "/comented" purebasic.asm it looks like this

Code: Select all

; ProcedureDLL.w PeekBigEndianW(*MemoryBuffer)
Macro MP0{
_Procedure0:
_PeekBigEndianW:
  PS0=4                                                                                                                                                                                                                                                     
; !MOV   eax, dword [p.p_MemoryBuffer]
p.p_MemoryBuffer equ esp+PS0+0
MOV   eax, dword [p.p_MemoryBuffer]
; !MOV    ax,  word [eax]
MOV    ax,  word [eax]
; !BSWAP eax
BSWAP eax
; !SHR   eax, 16
SHR   eax, 16
; ProcedureReturn
  JMP   _EndProcedure1
; EndProcedure
  XOr    eax,eax
_EndProcedure1:
  RET    4
}
But tailbite output isn't the same, one line is missing and instead i got the following line (which makes the following line twice)

Code: Select all

format MS COFF

Public PB_PeekBigEndianW




section '.text' code readable executable

PB_PeekBigEndianW:
_PeekBigEndianW:
PS0=4
; !MOV   eax, dword [p.p_MemoryBuffer]
MOV   eax, dword [p.p_MemoryBuffer]
MOV   eax, dword [p.p_MemoryBuffer]
; !MOV    ax,  word [eax]
MOV    ax,  word [eax]
; !BSWAP eax
BSWAP eax
; !SHR   eax, 16
SHR   eax, 16
; ProcedureReturn
JMP   _EndProcedure1
; EndProcedure
XOR    eax,eax
_EndProcedure1:
RET    4
fortunately i can fix this manually :)

Dri

Posted: Tue Aug 29, 2006 11:42 am
by El_Choni
Ok, on the list ;)

Posted: Mon Oct 23, 2006 9:17 pm
by Droopy
Any news :cry: ?

Posted: Sun Nov 05, 2006 5:58 pm
by DarkDragon
El_Choni's HP is down and everyone is wondering why... . Can you tell us something?

Posted: Sun Nov 05, 2006 6:02 pm
by Falko
Where are you, EL-Choni? PB4.01 is good but TailBit chrashed :roll:
Regards Falko from germany

Posted: Sun Nov 05, 2006 10:53 pm
by NoahPhense
EL .. I can give you a permanent home on Liquidbuzz .. you can use
it for betas and full releases. Let me know.

- np

Posted: Wed Nov 08, 2006 6:54 pm
by Falko
EL_Chonis HP ist online, but the TailBite-Version ist v1.3 PR 1.8 do have problems.
Following error has shown with tailibite on PB4.01.
---------------------------
PureBasic - Error
---------------------------
Error: The following PureLibrary is missing: :System
---------------------------
OK
---------------------------
Regards Falko

Posted: Wed Nov 08, 2006 10:35 pm
by Droopy
I have the same problem as Falko :(

Use this code to convert PB4 Optionnal parameters to Tailbite optional parameter format :

Code: Select all

;/ PureBasic 4.0 / Droopy 06/11/06

;{/ Enumerations

Enumeration ;/ Zone Fichier
  #Read
  #Write
  #DebutZone
  #DansZone
  #FinZone
  #HorsZone
EndEnumeration

Enumeration ;/ Zone de Procédure
  #Inconnu
  #Variable
  #Valeur
  #Commentaires
EndEnumeration

;}

Structure DetailProcedure
  Optionnel.l
  NomVariable.s
  Valeur.s
EndStructure

Global NewList Proc.DetailProcedure(), ContenuProcedure.s

Procedure InsertionTBProcedure(Ligne.s)
  
  ClearList(Proc())
  
  ;/ Mise en forme de la ligne
  Ligne=LTrim(RTrim(Ligne))
  
  ;/ Extraction du Nom de la procedure
  NomProcedure.s=StringField(Ligne,2," ")
  NomProcedure=LTrim(RTrim(StringField(NomProcedure,1,"(")))
  
  ;/ Garde juste les paramètres
  Ligne.s=LTrim(RTrim(Right(Ligne,Len(Ligne)-14-Len(NomProcedure))))
  
  Zone=#Inconnu
  For n=1 To Len(Ligne)
    
    c.s=Mid(Ligne,n,1)
    a=Asc(c)
    
    Select Zone
      
      Case #Inconnu
        If (a>64 And a<91) Or (a>96 And a<123) ;/ C'est un nom de variable
          AddElement(Proc())
          Proc()\NomVariable+c
          Zone=#Variable
        ElseIf c=")"
          Zone=#Commentaires
        EndIf
        
      Case #Variable
        Select c
          Case ")"
            Zone=#Commentaires
          Case ","
            Zone=#Inconnu
          Case " "
            
          Case "="
            NbParaOptionnels+1
            Proc()\Optionnel=1
            Zone=#Valeur
            
          Default
            Proc()\NomVariable+c
        EndSelect
        
        
      Case #Valeur
        
        If a=34 ;/ Détermine si je rentre ou sort d'une zone de guillemet
          If ZoneGuillemet=1
            ZoneGuillemet=0
          Else
            ZoneGuillemet=1
          EndIf
        EndIf
        
        If ZoneGuillemet=1
          Proc()\Valeur+c 
        Else
          Select c  
            Case ","
              Zone=#Inconnu
              
            Case ")"
              Zone=#Commentaires
              
            Default
              Proc()\Valeur+c
              
          EndSelect
        EndIf
        
      Case #Commentaires
        Commentaires.s+c
        
    EndSelect
  Next
  
  Commentaires=LTrim(RTrim(Commentaires))
  Commentaires=LTrim(Right(Commentaires,Len(Commentaires)-1))
  
  If NbParaOptionnels 
    ;- Il y a des paramètres optionnels
    
    ; Ecriture de la déclaration
    Temp.s="Declare "+NomProcedure+Str(NbParaOptionnels+1)+"("
    ForEach Proc()
      Temp+Proc()\NomVariable
      
      If ListIndex(Proc())<CountList(Proc())-1
        Temp+"," ; Ajoute une virgule uniquement si necessaire entre chaque variable
      EndIf
    Next
    Temp+")"
    WriteStringN(#Write,Temp)
    
    For n= 0 To NbParaOptionnels
      
      ; Ecrit le nom de la procédure
      Temp.s=#crlf$+"ProcedureDLL "+NomProcedure
      
      ; Ecriture du N° de la procédure
      If n
        Temp+Str(n+1)
      EndIf
      Temp+ "("
      
      ; Ecrit juste les paramètres necessaires
      ForEach Proc()
        
        If ListIndex(Proc())=n
          Break ; Quitte si on atteind le paramètre max requis
        EndIf
        
        Temp+Proc()\NomVariable
        
        If ListIndex(Proc())<n-1 
          Temp+"," ; Ajoute une virgule uniquement si necessaire entre chaque variable
        EndIf
        
      Next
      
      ; Finalise la ligne de ProcedureDLL en y ajoutant les commentaires
      Temp+")"
      If Commentaires<>""
        Temp+" ; "+Commentaires
      EndIf
      
      WriteStringN(#Write,Temp)
      If n=NbParaOptionnels
        ; Ecriture du contenu de la procédure
        WriteStringN(#Write,ContenuProcedure)
      Else
        ; Ecriture de l'appel à la procédure principale
        Temp2.s="  "+NomProcedure+Str(NbParaOptionnels+1)+"("
        ForEach Proc()
          If ListIndex(Proc())>n-1
            Temp2+Proc()\Valeur
          Else
            Temp2+Proc()\NomVariable
          EndIf
          
          If ListIndex(Proc())<CountList(Proc())-1 
            Temp2+"," ; Ajoute une virgule uniquement si necessaire entre chaque variable
          EndIf
        Next
        Temp2+")"
        
        WriteStringN(#Write,Temp2)
        WriteStringN(#Write,"EndProcedure")
      EndIf
      
    Next
    
    
  Else 
    ;- Aucun paramètre optionnels
    Temp.s="ProcedureDLL "+NomProcedure+"("
    ForEach Proc()
      Temp+Proc()\NomVariable
      If ListIndex(Proc())<CountList(Proc())-1
        Temp+"," ; Ajoute une virgule uniquement si necessaire entre chaque variable
      EndIf
    Next
    Temp+")"
    If Commentaires<>""
      Temp+" ; "+Commentaires
    EndIf
    
    WriteStringN(#Write,Temp)
    WriteStringN(#Write,ContenuProcedure)
    
  EndIf
  
EndProcedure

Procedure TBOP(FileIn.s,FileOut.s,TailbitePath.s,Compile)
  
  ;{/ Boucle de lecture du fichier en entrée / Génération du fichier de sortie
  
  CreateFile(#Write,FileOut)
  If ReadFile(#Read,FileIn)=0 
    End 
  EndIf
  
  ZoneFichier=#HorsZone
  
  While Eof(#Read)=0
    
    Ligne.s=ReadString(#Read)
    Temp.s=UCase(LTrim(Ligne))
    
    If Left(Temp,12)="PROCEDUREDLL"
      ZoneFichier=#DebutZone
      LigneProcedure.s=Ligne
    ElseIf Left(Temp,12)="ENDPROCEDURE" And (ZoneFichier=#DebutZone Or ZoneFichier=#DansZone)
      ZoneFichier=#FinZone
    EndIf
    
    Select ZoneFichier
      Case #HorsZone
        WriteStringN(#Write,Ligne)
        
      Case #DebutZone
        ZoneFichier=#DansZone
        ContenuProcedure.s=""
        
      Case #DansZone
        If ContenuProcedure=""
          ContenuProcedure.s+Ligne
        Else
          ContenuProcedure.s+#crlf$+ Ligne
        EndIf
        
      Case #FinZone
        ZoneFichier=#HorsZone
        ContenuProcedure+#crlf$+Ligne
        InsertionTBProcedure(LigneProcedure)
         
    EndSelect
    
  Wend
  ;}
  
  CloseFile(#Read)
  CloseFile(#Write)
  
  If Compile
    RunProgram("TailBite.exe",FileOut,TailbitePath)
  EndIf
  
EndProcedure

; TBOP("d:\affiche.pb","d:\Out.txt","c:\Program Files\PureBasic4\TailBite",#True)

Posted: Thu Nov 09, 2006 9:34 am
by Progi1984
I think that Tailbite must find a new maintainer !

Posted: Fri Nov 10, 2006 1:09 am
by ABBKlaus
@Droopy
Use this code to convert PB4 Optionnal parameters to Tailbite optional parameter format :
don´t work for me :

Tailbite says : Error: Line 233 - Syntax error!

Line 233 :
ProcedureDLL Print_SetUnits(s(Unit.l)

Code: Select all

TBOP("C:\Programme\PureBasic400\Examples\Printer_Lib\Source\Printer_Lib.pb","C:\Programme\PureBasic400\Examples\Printer_Lib\Source\Out.txt","c:\Programme\PureBasic400\TailBite",#True) 
Source code is my PrinterLib

Regards Klaus

Posted: Sat Nov 11, 2006 12:35 am
by ABBKlaus
can this solve the problem with tailbite :?:
feedback please :twisted:

Code: Select all

Procedure SplitFunctions(FileStart, FileEnd, DestFolder$, FinalDestFolder$, mID)
  FileSeeker = FileStart
  AsmHeader$ = "The header must remain intact for Re-Assembly"+WNL$+"; "+WNL$
  FileSeeker = FindNextString(AsmHeader$, FileSeeker, FileEnd)+Len(AsmHeader$)
  HeaderEnd$ = "; "+WNL$+"format MS COFF"
  While PeekS(FileSeeker, Len(HeaderEnd$))<>HeaderEnd$ And FileSeeker<FileEnd
    PBLibName$ = RemoveString(GetNextString(FileSeeker, WNL$), "; ")
    If PBLibName$="ImagePlugin" And IPluginAdded=0
      AddElement(PBLib())
      PBLib() = "ImagePlugin"
      IPluginAdded=1
    ElseIf PBLibName$="Gadget" And GadgetAdded=0
      AddElement(PBLib())
      PBLib() = "Gadget"
      GadgetAdded=1
    Else
      If Left(PBLibName$, Len("TB_Include"))="TB_Include"
        Included$ = Right(PBLibName$, Len(PBLibName$)-Len("TB_Include"))
        AlreadyThere = 0
        ForEach PBLib()
          If PBLib()=Included$
            AlreadyThere = 1
            Break
          EndIf
        Next
        If AlreadyThere=0
          AddElement(PBLib())
          PBLib() = Included$
        EndIf
      Else
        Select PBLibName$
          Case "TB_GadgetExtension"
            AddTB_GadgetExtension = 1
              AddElement(PBLib())
              PBLib() = "Gadget"
              GadgetAdded = 1
          Case "TB_Debugger"
            AddTB_Debugger = 1
          Case "TB_ImagePlugin"
            If IPluginAdded=0
              AddElement(PBLib())
              PBLib() = "ImagePlugin"
              IPluginAdded = 1
            EndIf
            AddTB_ImagePlugin = 1
          Default
            If PBLibName$=":System" ; here we can end the search for PBLibs (ABBKlaus 11.11.2006 00:33)
              Break
            EndIf

Posted: Sat Nov 11, 2006 8:44 am
by gnozal
ABBKlaus wrote:can this solve the problem with tailbite :?:
feedback please :twisted:
What problem please ?