Developpez.com - Rubrique PureBasic

Le Club des Développeurs et IT Pro

PureBasic 5.10 - Version spéciale pour noël

Tous vos voeux sont exaucés.

Le 2012-12-21 15:18:20, par comtois, Responsable Purebasic
C'est une version spéciale qui permet de satisfaire un bon nombre des 3700 suggestions et demandes d'amélioration faites par les utilisateurs depuis quelques années

C'est la première beta, la doc est en cours de rédaction.

Comme d'habitude, cette version est disponible sur votre compte personnel.


Les versions démos ne seront disponibles qu'après la sortie de la version finale.

Remarque : La liste ci-dessous sera traduite en français pour la version finale.

Hi there,

This version is a special one, as we have reviewed the 3700 feature wishes topics to implement them. It tooks quite some time, but as you can see
it will bring enhancements in every domains, including the compiler, libs, 3D and the IDE ! Warning, some changes are breaking backward compatibility,
but most should be easy to migrate (except the new packer commands which will requiers some work). We are really excited with the change log:

  • Added: Form designer is now integrated to the IDE !
  • Added: Fully reworked Packer library with ZIP, BriefLZ, 7z (unpacker only) and LZMA support. JCALG1 support has been dropped. Archives formats for BriefLZ have been changed.
  • Added: IPv6 support to the network library. Updated IPString(), MakeIPAddress(), GetClientIP(), IPAddressField(), ExamineIPAddress() and NextIPAddress().
  • Added #PB_Network_IPv6 flag to OpenConnection and CreateServer(). Added FreeIP() for v6 IP
  • Added: System library: ComputerName(), UserName(), MemoryStatus(), CountCPUs()
  • Added: Line continuation feature, with the following operands: ',' '|' '+' And Or Xor (for now, the IDE hasn't be upgraded to display quickhelp/parenthesis correctly on multiline)
  • Added: Constant string comparisons are now handled at compile time, allowing use in CompilerIf for example.
  • Added: CocoaMessage() for OS X
  • Added: 'Check syntax' to only compile the code without build/running an executable (/CHECK switch or in the IDE compîler menu)
  • Added: Array/List/Map parameter support to Interface methods
  • Added: Support for dynamic array/list/map support in structure/interface in Residents.
  • Added: #PB_Character, #PB_Unicode, #PB_Ascii and #PB_Integer flag support to FillMemory()
  • Added: #PB_RegularExpression_NoCase support to CreateRegularExpression()
  • Added: EncodeImage() with PNG, JPEG and JPEG2000 support
  • Added: #PB_Memory_NoClear support to Re/AllocateMemory()
  • Added: ImageFormat(#Image). If created with CreateImage/GrabImage(), will return 0.
  • Added: #PB_Editor_WordWrap to EditorGadget()
  • Added: Multicharacter comparison in StringField()
  • Added: NbOccurences parameter for ReplaceString()
  • Added: PostEvent(), EventData()
  • Added: return value to SetCurrentDirectory()
  • Added: #PB_String_NoCase mode parameter to FindString()
  • Added: #PB_Preference_NoSpace and #PB_Preference_GroupSeparator flags for OpenPreferences() and CreatePreferences()
  • Added: DatabaseColumnIndex()
  • Added: #PB_Cipher_URL and #PB_Cipher_NoPadding for Base64Encoder(), added URL compatibility to Base64Decoder()
  • Added: SetGadgetItemImage() for all gadget supporting item gadget image
  • Added: #PB_Gadget_ScreenCoordinate and #PB_Gadget_WindowCoordinate flag for GadgetX/Y()
  • Added: #PB_File_SharedRead (no effect on Linux/OSX), #PB_File_SharedWrite (no effect on Linux/OSX), #PB_File_Append and #PB_File_NoBuffering for OpenFile(), ReadFile() and CreateFile()
  • Added: #PB_Event_RightClick, #PB_Event_LeftClick and #PB_Event_LeftDoubleClick events
  • Added: Optional title parameter to OpenConsole()
  • Added: #PB_ScrollArea_ScrollStep added for ScrollAreaGadget()
  • Added: #PB_Ignore for ResizeImage()
  • Added: Bind a specific IP to CreateNetworkServer()
  • Added: Timeout, LocalIP$ and LocalPort parameter to OpenNetworkConnection()
  • Added: #PB_NetworkEvent_Disconnect support for NetworkClientEvent()
  • Added: #PB_Unicode, #PB_Ascii and #PB_UTF8 support to SendNetworkString()
  • Added: #PB_String_MaximumLength attribute for StringGadget()
  • Added: #PB_Event_DeactivateWindow support
  • Added: #PB_EventType_Change support for EditorGadget()
  • Added: #PB_Relative/#PB_Absolute flag for FileSeek()
  • Added: 'Offset' and 'Length' parameters to SHA1/MD5/CRC32FileFingerprint()
  • Added: GetSoundPosition(), SetSoundPosition(), SoundLength(), PauseSound(), ResumeSound(), SoundStatus()
  • Added: #PB_All support for SoundVolume()
  • Added: SetGadgetItemState() support for ExplorerListGadget()
  • Added: #PB_Event_TimeOut
  • Added: InputRequester add close
  • Added: InputRequester() added #PB_InputRequester_Password flag
  • Added: Random() added optional mininmum value
  • Added: SetGadgetItemText() for ListIconGadget(): handling of chr(10) as in AddGadgetItem()
  • Added: made OpenWindowedScreen() stretch parameters optionals
  • Added: ScreenWidth(), ScreenHeight(), ScreenDepth()
  • Added: SMTP AUTH support to mail library
  • Added: optional parameters to RemoveMailRecipient(), ability to remove all recipients
  • Added: ReadString(#File [, Flags [, Length]]) : length and #PB_File_IgnoreEOL support
  • Added: #PB_Window_InnerCoordinate support to WindowX/Y()
  • Added: #PB_Window_FrameCoordinate support to WindowWidth()/Height()
  • Added: #PB_Image_Raised support to ImageGadget()
  • Added: Support for FreeXXX(#PB_All) for all free commands
  • Added: Compiler Constants: #PB_Compiler_LineNumbering, #PB_Compiler_InlineAssembly, #PB_Compiler_EnableExplicit
  • Added: Compiler Constants: #PB_Compiler_ExecutableFormat (with #PB_Compiler_DLL, #PB_Compiler_Console, #PB_Compiler_Executable)
  • Added: Compiler Constant: #PB_Compiler_IsIncludeFile, #PB_Compiler_IsMainFile, #PB_Compiler_Filename (filename without path)
  • Added: Bool() compiler operator. Boolean operations are now forbidden without Bool().
  • Added: MacroExpandedCount internal keyword
  • Added: UndefineMacro
  • Added: Now XIncludeFile also take in account the main file, to avoid double inclusion if the main file is included from another file.
  • Added: TypeOf() for variable, structure and fields
  • Added: Defined(Label, #PB_Label) support
  • Added: CompilerElseIf
  • Added: Local labels
  • Added: Define now behave like Global and accept Dim(), NewMap() and NewList() on the same line
  • Added: 'Align' keyword support for structure, with a special #PB_Structure_AlignC value to mimic C structures padding
  • Added: autocast of numeric values when string are involved, allowing to concatenate string and numeric in constants
  • Added: 'CONSTANTLIST' to Compiler interface
  • Added: editing history recording in the IDE to recover previous code states and for crash recovery (see File -> Session History)
  • Added: AffectedDatabaseRows(), IsDatabaseNull() to database library
  • Added: new Text3D library
  • Added: 'Mode' optional parameter to all ...Yaw/Roll/Pitch() functions
  • Added: 'Type' and 'Mode' optional parameter to CreateMesh()
  • Added: RayCast(), MouseRayCast(), NormalX(), NormalY(), NormalZ()
  • Added: UpdateMesh(), EnableManualEntityBoneControl(), MoveEntityBone(), RotateEntityBone()
  • Added: 'Type' optional parameter to AddSubMesh()
  • Added: 'Type' parameter to FinishMesh()
  • Added: ScaleNode(), GetMaterialColor(), GetMaterialAttribute(), ConvertLocalToWorldPosition(), ConvertWorldToLocalPosition()
  • Added: MaterialCullingMode(), FetchOrientation(), SetOrientation(), GetX(), GetY(), GetZ(), GetW(), GetLightColor()
  • Added: AddEntityObject(): bone name can be empty, so the object is added directly to the entity
  • Changed: renamed AddMeshVertex() to MeshVertexPosition()
  • Changed: renamed LightColor() to SetLightColor()
  • Changed: removed all MaterialXXXXColor() replaced by SetMaterialColor()
  • Changed: removed all XXXXLocate() replaced by #PB_Absolute flag for MoveXXXX() commands
  • Changed: replaced #PB_Sort_<Type> with #PB_<Type> to avoid possible errors
  • Changed: disallow native type for pointers
  • Changed: StrF/D(), trailing zeros are now automatically removed if no decimals are specified
  • Updated: OGRE core has been updated to 1.8.2
  • Removed: SendNetworkFile(), RecieveNetworkFile(), #PB_NetworkEvent_File to avoid possible security hole
  • Removed: DirectX7 and NT4 subsystem on Windows
  • Removed: SDL subsystem on Linux
  • Removed: PowerPC version for OS X
  • Optimized: FindString() is up to twice as fast
  • Bug fix: DatabaseError() is now cleared properly


We are working on the doc, but in the meantime we need you to test all these new feature to have rock-solid 5.10 final !
If some commands aren't obvious to use, feel free to post your question in coding section, we will try to answer them quickly.
There is some new 3D examples in the examples/3d folder to demonstrate the new features.

Grab it while it's hot, we hope you will enjoy the new version and we wish you a merry xmas !

The Fantaisie Software Team.
  Discussion forum
17 commentaires
  • comtois
    Responsable Purebasic
    En attendant la doc, je vais coller ici toutes les infos qui sortiront pour aider à utiliser les nouveautés. N'hésitez pas à ajouter les vôtres

    The whole packer lib has been changed. You need to use:

    UseZipPacker() and/or UseLZMAPacker() and/or UseBriefLZPacker() and then Un/CompressMemory(), or the Pack commands (it handle ZIP archive creation and manipulation and 7z archive unpack (no creation).

    CreatePack() doesn't support LZMA, only OpenPack() does. You need to use ZIP or BriefLZ for CreatePack()

    Les constantes pour la lib Packer
    #PB_Packer_Zip
    #PB_Packer_LZMA
    #PB_Packer_BriefLZ

    Un petit exemple :

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    UseLZMAPacker()
    
    *a = AllocateMemory(10000)
    *b = AllocateMemory(100000)
    
    Debug CompressMemory(*a, 10000, *b, 100000)
    Debug UncompressMemory(*b, 100000, *a, 10000)
    
    If OpenPack(0, "Test.7z")
      Debug "cool !"
     
       
      If ExaminePack(0)
        Debug "ok"
       
        While NextPackEntry(0)
         
          Debug PackEntryName(0)
          Debug PackEntryType(0)
          Debug PackEntrySize(0)
          Debug PackEntrySize(0, 1)
         
        Wend
      EndIf
     
      Debug UncompressPackFile(0, "yo_unicode.pdf", "test.pdf")
     
      ClosePack(0)
     
    EndIf
  • comtois
    Responsable Purebasic
    exemple montrant comment fonctionne UndefineMacro

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    Macro test
      Debug "1"
    EndMacro
    
    test
    
    UndefineMacro test
    
    Macro test
      Debug "2"
    EndMacro
    
    test
  • comtois
    Responsable Purebasic
    TypeOf() renvoie : #PB_Byte, #PB_String, #PB_Structure etc.

    Exemple :

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    Structure Test
      a.a
    EndStructure
    
    a.Test
    If TypeOf(a\a) = #PB_Ascii
      Debug "ok"
    EndIf
  • comtois
    Responsable Purebasic
    Concaténation d'une chaine et d'un nombre

    Code :
    1
    2
    3
    4
    5
    6
    7
    Define Chaine.s ; une chaine de caractères
    Define somme.d ; un nombre flottant
    
    somme = 5.3 + 1.6
    
    Chaine = "x + y = " + somme          
    Debug Chaine
    affiche
    x + y = 6.9
  • comtois
    Responsable Purebasic
    Exemple d'un allemand avec la nouvelle fonction Bool() pour tester une expression booléenne.
    Bool() renvoie 0 ou 1.

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    Procedure Min(A, B)
       ProcedureReturn Bool(A<B)*A + Bool(A>=B)*B
    EndProcedure
    
    Debug Min(1,3)
    Debug Min(-1,-3)
    Debug Min(1,-3)
    Debug Min(-1,3)
  • comtois
    Responsable Purebasic
    Autre exemple :
    compression/décompression d'un zip dans un editorGadGet par un autre allemand

    à noter au passage l'utilisation de la nouvelle constante #PB_Editor_WordWrap

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    UseZipPacker(); Packerplugin bestimmen
    CreatePack(0, GetTemporaryDirectory() + "myzip.zip") ; Archiv erstellen
    AddPackFile(0, #PB_Compiler_Home + "SDK\CompilerInterface.txt", "SubDir1\SubDir2\CompilerInterface.txt") ; Datei hinzufügen
    ClosePack(0) ; Archiv schliessen.
    
    Define *mem, size, name.s
    If OpenPack(0, GetTemporaryDirectory() + "myzip.zip")
      If ExaminePack(0)
        NextPackEntry(0)
        name = PackEntryName(0)
        size = PackEntrySize(0)
      EndIf
    EndIf
    
    *mem = AllocateMemory(size)
    If *mem
      OpenWindow(0, #PB_Ignore, #PB_Ignore, 640, 480, "Unpack Test")
      EditorGadget(0, 0, 0, 640, 480, #PB_Editor_WordWrap | #PB_Editor_ReadOnly)
     
      UncompressPackMemory(0, *mem, size, name)
      SetGadgetText(0, PeekS(*mem, -1, #PB_Ascii))
      FreeMemory(*mem)
      ClosePack(0)
     
      While WaitWindowEvent() <> #PB_Event_CloseWindow : Wend
    EndIf
  • comtois
    Responsable Purebasic
    Une info concernant la nouvelle commande PostEvent().

    Il faut utiliser un nombre supérieur à 65536 pour éviter les conflits avec les événements système.

    Une constante #PB_Event_FirstUserEvent sera mise à disposition pour démarrer une énumération.

    Code :
    1
    2
    3
    4
    5
    Enumeration #PB_Event_FirstUserEvent
      #EventPerso1
      #EventPerso2
      #EventPerso3
    EndEnumeration

    You should use an event number higher than 65536 to be on the safe side. We will provide a #PB_Event_FirstUserEvent constant for that, so you can use it as an enumeration start.
  • comtois
    Responsable Purebasic
    La beta 2 est disponible sur votre compte. Elle corrige pas mal de bogues.

    Hi folks,

    After a bug fix session, here is the second beta of the forthcoming 5.10 release ! It does a bring a full changes as well:

    - New TabBar for the IDE, using the TabBarGadget from STARGÅTE, which brings coloring for project/form tabs
    - #PB_Event_TimeOut has been renamed to #PB_Event_None to avoid confusion
    - UseJCALG1Packer() added on Windows x86 for migration purpose (only UncompressMemory() is available)
    complément d'information de 'Freak' (Timo) concernant le TabBarGadget de STARGATE.

    Le TabBarGadget permet plus de choses que la coloration des onglets, notamment le multi-lignes. Voir la première ligne de options dans préférence->Editeur.

    The new TabBarGadget brings more options (multiline mode for example). You can find the options in Preferences->Editor at the top.
  • comtois
    Responsable Purebasic
    comme il y avait quelques crash, un correctif a été mis en ligne très rapidement.

    C'est toujours la beta 2 et c'est toujours sur votre compte.

    We have just deployed a new beta 2 with some fix about the linux canvas and the save crash on windows. Could you give it a try ?
  • comtois
    Responsable Purebasic
    Comme il est question plus haut du TabBarGadget de STARGÅTE, voici tout d'abord une image qui le montre en action :



    Et ensuite le message d'origine (en allemand, mais le langage c'est PureBasic) dans lequel STARGÅTE présente son code :

    Voir le message d'origine

    [EDIT]
    Je n'avais pas vu qu'il avait aussi fait son annonce sur le forum officiel de PureBasic (anglais).

    Les sources PB peuvent être récupérées à l'adresse indiquée ci-dessus.