4 Replies Latest reply on Jun 28, 2012 1:09 PM by steve_ssh

    Error Code 1206 ?

    alagu123

      Hi,

       

      I was added the below code in the Custom function for script. When I run the script, it shows unknown error 1206 from this below function. Anyone can u give me the solution for this error type?

       

      Thanks in advance

       

      Let ( [

      string = Substitute ( Text ; [ """ ; "^^" ] ; [ " ;" ; ";" ] ; [ ";" ; "" ;" ] ; [ "= " ; "=" ] ; ["=" ; " = "" ] ; ["¶" ; "~~" ] ) & """ ;

      eval = Evaluate ( "Let ( [" & string & "] ;" & Name & " )" ) ;

      result = Substitute ( eval ; [ "^^" ; """ ] ; [ "~~" ; "¶" ] )

      ] ;

       

      If ( result ="?" ; "" ; result )

       

      )

       

      1206

      Text constant must end with a quotation mark

        • 1. Re: Error Code 1206 ?
          alagu123

          I could not able to find where the error is, I tried in all ways

          • 2. Re: Error Code 1206 ?
            jbante

            Check the syntax of the string being passed into Evaluate(). The EvaluationError() function might be helpful. What are you trying to accomplish? It looks like you're trying to extract a value within a name-value pair structure; there are many examples of this online you can follow.

            • 3. Re: Error Code 1206 ?
              beverly

              IF you copied this exactly as it is in the calculation, you appear to have a missing ")" to close the Substitute.

               

              Beverly

              • 4. Re: Error Code 1206 ?
                steve_ssh

                Hello Alagu,

                 

                The way this reads, my guess is that the expected input value for Text is probably something like:

                 

                foo1 = hello; foo2 = goodbye; foo3 = ciao pescao;

                 

                 

                And, per the above example, the expected value for Name would be something like:

                 

                foo1  which would yield:  hello

                 

                  - or -

                 

                foo2  which would yield:  goodbye

                 

                etc.

                 

                 

                If you were to change this line:

                 

                string = Substitute ( Text ; [ "\"" ; "^^" ] ; [ " ;" ; ";" ] ; [ ";" ; "\" ;" ] ; [ "= " ; "=" ] ; ["=" ; " = \"" ] ; ["¶" ; "~~" ] ) & "\"" ;

                 

                 

                 

                To instead be:

                 

                string = "x=0;" & Substitute ( Text ; [ "\"" ; "^^" ] ; [ " ;" ; ";" ] ; [ ";" ; "\" ;" ] ; [ "= " ; "=" ] ; ["=" ; " = \"" ] ; ["¶" ; "~~" ] ) & "x=x";

                 

                I believe that your code will mostly perform as expected.

                 

                 

                 

                That said:

                 

                As much as I appreciate the cleverness of this approach (and I do), my gut feeling is that there is probably a more robust methodology for doing this kind of parsing.

                 

                Jbante already kind of alluded to this possibility in his reply to your post.

                 

                Hope this helps & kind regards,

                 

                -steve

                 

                 

                 

                 

                Message was edited by: steve_ssh:  Corrected knucklehead bug whereby my proposed calc would have failed if value of Name = 'x'