Results 1 to 3 of 3

Thread: YAML for FPC/Delphi?

  1. #1

    YAML for FPC/Delphi?

    Hey all, I was thinking about using YAML as a configuration language for a project. YAML is simpler than XML, so it should be simple enough to do.

    However, I cannot find if anyone has converted either headers for LibYAML or have made a native parser. It isn't even on Torry, which means it probably hasn't been released yet.

    I'd kind of rather find completed, or even beta, work than try my own hand. :lol:

    Edit: Syck might do well if I could find someone to compile it for me. I haven't got the tools. (C or C++, I dunno which.)

  2. #2

    YAML for FPC/Delphi?

    How about using JSON? It is not as powerfull as YAML but there are two toolkits for Delphi/FPC available.

  3. #3

    YAML for FPC/Delphi?

    Hi Robert,
    I have used Lua (www.lua.org) as a configuration language in the past.
    One example was for an Abalone OpenGL 3d game I was making. See the saved game example text file below:

    Code:
    CreateBoard(
        "    1 1 1 1 1    " ,
        "   1 1 1 1 1 1   " ,
        "  . . 1 1 1 . .  " ,
        " . . . . . . . . " ,
        ". . . . 3 . . . ." ,
        " . . . . . . . . " ,
        "  . . 2 2 2 . .  " ,
        "   2 2 2 2 2 2   " ,
        "    2 2 2 2 2    ")
    
    ClearActivePlayers()
    
    AddActivePlayer(1,180)
    AddActivePlayer(2,0)
    
    SoundManager.LoadSound("Marble-Marble","Marble-Marble.wav")
    SoundManager.LoadSound("Marble-Board" ,"Marble-Board.wav")
    I linked routines in the Delphi program to Lua and called them like so above.

    I have also used Lua for just simple stuff like:

    Code:
    ScreenWidth=320
    ScreenHeight=240
    FullScreen=true
    where I have read in the global Lua variables and used them to configure the program

    You can make it as simple, or as complex as you want really.
    cheers,
    Paul

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •