POV-Ray : Newsgroups : povray.general : CSDL: C-like Simulation Description Language : CSDL Update Server Time
6 Aug 2024 23:28:25 EDT (-0400)
  CSDL Update  
From: Christopher James Huff
Date: 16 Jan 2002 12:00:30
Message: <chrishuff-8E0627.12013716012002@netplex.aussie.org>
I've gotten a rudimentary expression parser, variables, functions, and 
the user output stream working. Objects can be declared, but I haven't 
written the code for deriving objects from others or for accessing 
members, so they aren't very useful yet.
It's not much, but it is enough for a "Hello World" program:

scalar accum = 5;

function run()
{
    string Message = "Hello World!\n";
    
    swrite(userout, Message, "pi = ", pi, newln);
    
    swrite(userout, "Calling aFunc():", newln);
    aFunc();
    swrite(userout, "aFunc() returned.", newln);
};

function aFunc()
{
    scalar Count = 5;
    swrite(userout, "Inside aFunc():\n");
    
    while(Count)
    {
        swrite(userout, "while: ", Count, newln);
        swrite(userout, "accum = ", accum, newln);
        Count = Count - 1;
        accum = accum + 1;
    };
};

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.