Beginner-Problem: Examples don't work!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 21/03/2005 at 07:46, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   9.1 Demo 
    Platform:   Windows  ;   
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    Hello...

    Today, I read something about COFFEE as a possibility to write plugins for C4D. So, I decided to learn it. I've made some tutorials. After a while, the first example works. This very simple one:

      
    main()  
    {  
    println("Hello World!");  
    }  
    

    But when I want to use other examples, I always get COFFEE Errors in the console window.

    F.ex.:

      
    // Opens the above dialog with an exclamation mark icon  
    var result = TextDialog("Hello World!", DLG_OKCANCEL + DLG_ICONEXCLAMATION);  
      
    // Checks the result  
    if (result == DLG_R_OK)  
    {  
    TextDialog("You pressed OK!", DLG_OK);  
    }  
    

    COFFEE ERROR!
    (124) Syntax Error
    File: test2.cof
    Line: 2
    Row: ~25

    I have tested a lot of examples, but I always get such errors like "(118) Variable or function expected". What's wrong?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 25/03/2005 at 06:22, xxxxxxxx wrote:

    Did you put the code within a function block? You can't just have it stand-alone in the file. The simplest function block is the "main" you had in the first sample. A more interesting variant is to use MenuPlugin::Execute().


Log in to reply