fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Re: Variables not read ! [solved (but with a workaround)]

    Questions & Answers
    2
    7
    1005
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Tailung last edited by

      I'm in the process of building a menu out of textobjects.

      To align te text I use a variable.
      In this example de variable Topstart has the value 50

      When I use it to orient text objects onto the map
      they all should be on the same line/height but they don't. Only the first object respects the variable al the others don't!! I don't get is when I put 50 in it works just fine.

      This is what I have so far:

      https://fxdreema.com/shared/IW5MvgoU

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        I don't understand what is the problem exactly, but I think that you need to be aware of the first two options in "Draw... " blocks. Notice the names of the objects, they have "1" appended to their name: http://prntscr.com/866lbv
        Those 2 options control the way objects are created and then modified by the block. 2 options with 2 states each = 4 possible configurations. But I will better create some example for this, because now I am working on the examples anyway...

        1 Reply Last reply Reply Quote 0
        • T
          Tailung last edited by

          Its simple
          I have some text objects. I place them on the map with x y coords.
          When I fill i the xy coords with regular numbers it works fine. When i replace the numbers for y with a variable, only the first respects the variable and the rest just of the objects don't anymore, no matter what I do. I think its a bug. Yesterday I experimented with variables and text-object placement it is repeated over and over again.
          I want to use variables for easy adjustments etc.
          The example still counts. Put it one the chart.
          In oninit the objects are created the variable "TopStart=50" should place the 3 objects at 50 pixels from the top. (All on the same line but that doesn't matter for now.) But it doesn't. When I do use integer numbers for Y it works just fine. But I don't want to use numbers I want to use variables
          Place it on the chart and you see some text object on the chart. first on accepts the variable for y the next one doesn't. it places the text on the top of the screen. the third also.
          the fourth object should be discarded.

          1 Reply Last reply Reply Quote 0
          • fxDreema
            fxDreema last edited by

            Something wrong happens when the original value of that parameter where the variable is used contains the name of that variable

            1 Reply Last reply Reply Quote 0
            • fxDreema
              fxDreema last edited by

              I think it's ok now

              1 Reply Last reply Reply Quote 0
              • T
                Tailung last edited by

                It is solved: I declared the variables as int and that doesn't work
                When I declare the variables as a doubles it works fine.

                Strange that I have to use a double for an integer value. Since doubles uses more memory than integers. That might be a bug

                For now I will use doubles all over the place to avoid this problem.

                1 Reply Last reply Reply Quote 0
                • fxDreema
                  fxDreema last edited by

                  More memory... this is not a microcontroller with 64k of memory. Even if you define 1000 more variables, there will be no difference for today's memory sizes. And each generated EA contains many more functions and variables compared to some that is manually programmed.

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post

                  Online Users

                  S
                  S
                  A
                  N
                  F
                  Z

                  14
                  Online

                  146.8k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors