character-string type variable

  • hi

    Can someone tell me how I can use this: (Character string type variable ARRAY)

    Dim CMOJI(7) ' Define the character-string type variable CMOJI having the seven elements.

    Could you please tell me, for an example

    CMOJI(1)= abc --> is possible to write

    Or how to write this array element.


    Thank you

  • not familiar with Misubishi but in computer programming variable declaration should include type, something like


    Dim cmoji as string

    or

    string cmoji

    or

    dim cmoji() as char

    or

    dim cmoji as char()

    etc.


    KRL uses character arrays instead of string. and in KRL it is


    DECL CHAR CMOJI[7], ABC

    CMOJI[]="Hello"; CMOJI[] now contains "Hello"

    ABC=89 ; ABC now contains "Y" (ASCII value for Y is 89)

    CMOJI[1]=ABC ; CMOJI[] now contains "Yello" since only the first character was replaced (in KRL arrays start at 1)

    CMOJI[]="Hi" ; CMOJI[] now contains "Hillo" since only the first two characters are replaced. if CMOJI[] was a proper string and not a character array, then content would be "Hi"

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now