fxDreema

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

    How to add values of double variable to string variable

    Questions & Answers
    4
    6
    4269
    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.
    • B
      BlueMoon last edited by

      In my "Buy now" block, please look at the comment.

      I want it to to appear as " Long Trade 1"
      Instead it appears as "Long Trade c::Group"

      Please help

      0_1502826003039_upload-e75d6650-04c2-43a1-a4be-fc6d3cb3c7f6

      1 Reply Last reply Reply Quote 0
      • M
        miro1360 last edited by

        try if this is working:
        0_1502834853396_upload-5ace3f29-876d-4d65-a0c4-85e51db06779

        Between trading and gambling is a very small gap, be careful.

        1 Reply Last reply Reply Quote 0
        • M
          Mantadiver last edited by Mantadiver

          I have been trying to add a string and a variable to a third variable to use in a Log Message.

          The above example looks plausible but I cannot get it to work. It does display the variable value but omits the text element.

          Should this work ?

          As a workaround I have used someone else idea of a custom code block with Output_Variable = "Text " + (string)Input_Variable;

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

            Don't use this c:: prefix, this is something from the EA and I might change this in future. In the blocks write just the name of the Constant, just Group.

            Try this: "" + "Long Trade " + Group + ""

            When you add "" + in the beginning and + "" at the end, this basically "opens" the input field to MQL code, otherwise everything you write is a string. Why that works? To be honest, it was never my intention, long time ago I just found that it works somehow and I think I will never change it, but who knows.

            1 Reply Last reply Reply Quote 0
            • M
              Mantadiver last edited by

              I have tried your suggestion and every other combination I can think of but keep getting error message "Undeclared identifier" with reference to whatever constant I use.

              I am entering the test in the input field of a Log Message block. Am I missing something ? Many thanks.

              1 Reply Last reply Reply Quote 0
              • M
                Mantadiver last edited by

                Please disregard my last post.

                For the avoidance of doubt adding ""+ at the beginning & + "" at the end works a treat.

                Many thanks

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

                Online Users

                E
                A
                G
                Q
                C
                T
                S
                A

                17
                Online

                146.7k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors