Crazy Strings ! ! !



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

    On 02/12/2003 at 09:32, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.100 
    Platform:   Windows  ;   Mac OSX  ; 
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    Hi Folks

      
    main(doc,op)  
    {  
        var s = "test";  
        println(s[2]);  
    }  
    

    This example expression returns 115 instead of "s"... what's wrong here?

    Thank you very much!

    Take care,
    Janos



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

    On 03/12/2003 at 08:17, xxxxxxxx wrote:

    Isn't a coder out there that knows the answer? I feel that the solution is quite simply...
    I only need the char of a string at a given position. Well, it seemed to me that this had worked with the array-parenthesis - but the code-snippet above prints only 115 instead of the char "s" to the console :(
    is 115 probably an ascii-code or something like that?

    cu
    qwaak



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

    On 03/12/2003 at 08:56, xxxxxxxx wrote:

    Hmm, well, I just saw that the question is quite simply :)

    How can I convert a 16 bit unicode char to a string and vice versa?

    I haven't found something in the SDK yet :/ So I'm looking forward to every hint...

    Best regards from Switzerland
    qwaak



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

    On 03/12/2003 at 09:37, xxxxxxxx wrote:

    To convert a character code to a string you have to insert it into a dummy string:

        
        
        var s = "?";  
        s[0] = 115;  
        println(s);
    


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

    On 03/12/2003 at 10:12, xxxxxxxx wrote:

    Hey Mikael,

    ... thank you! :)


Log in to reply