Showing results 1 to 7 of 7

Thread: Multiple variables

  1. #1
    Join Date
    29.01.2016
    Posts
    19

    Default Multiple variables

    Hello.

    I would like to use array of integer. So I created multiple variable from 1 to 10 and dimension 1 [0..0]. Straton created me int[1]....int[10]. I created it in global variables. But the problem is, when I want use these variables in some function. Even if I use drag and drop into this function. When I compile code, Straton tell me unknown variables.

    This probem is just with multiple variable(array).

    Thank you

  2. #2
    Join Date
    30.05.2007
    Posts
    105

    Default Re: Multiple variables

    Hi,

    If you named it really 'int[n]' then it is because 'int' is a keyword. Name it 'myInt[n]' instead.

    Markus

  3. #3
    Join Date
    29.01.2016
    Posts
    19

    Default Re: Multiple variables

    Hello. No name is array_readData_robot[1], ...[10]

  4. #4
    Join Date
    30.05.2007
    Posts
    105

    Default Re: Multiple variables

    Quote Originally Posted by DavidMarek View Post
    ...
    So I created multiple variable from 1 to 10 and dimension 1 [0..0]. Straton created me int[1]....int[10].

    Thank you
    Arrays in zenon Logic are created from 0. so if you need an array of ten you will get variables array_readData_robot[0], ...[9]

    Markus

  5. #5
    Join Date
    29.01.2016
    Posts
    19

    Default Re: Multiple variables

    Even if I create from 0 to 9, still the same error: Unknown identifier.

    Dimension is set to 1.

    Thank you

  6. #6

    Default Re: Multiple variables

    Hello,

    You need to create only one variable (MyArray) with dimension 10.

    Then in you program you can access to the element of an array like that:

    MyArray[0] := 20;

    MyArray[9] := 123;

    Jerome

  7. #7
    Join Date
    29.01.2016
    Posts
    19

    Default Re: Multiple variables

    Thank you

Similar Threads

  1. Multiple selected math variables formula editing issue
    By stolyarov_as in forum zenon Supervisor
    Replies: 1
    Last Post: 31st October 2014, 21:43
  2. Multiple copy of variables.
    By mjackson in forum zenon Supervisor
    Replies: 4
    Last Post: 17th September 2014, 14:45
  3. Multiple Variables assignment in Straton
    By shikra in forum straton / zenon Logic
    Replies: 1
    Last Post: 3rd March 2013, 23:36
  4. Multiple Monitors
    By allmendinger in forum zenon Supervisor
    Replies: 6
    Last Post: 16th October 2009, 07:13

Posting Rules

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