7 Replies Latest reply on Jul 10, 2012 3:49 PM by philmodjunk

    text functions Left and right

    Kirk_1

      Title

      text functions Left and right

      Post

      I am trying to set a varable (zip code) in one table and move the first three digets to another table.

      Im using the script:

      set varable [$originzip; value:left (frontier_Mars_Calulations::originZip; 3 )]

      Go to layout ["all" (frontier_Mars)]

      Enter Find Mode []

      Set field [frontier_Mars;ZB_01;$originZip]

      It does not work, it does move to the layout, but only goes to the first filed not the zb_01 and it does not enter the 3 digets.

      What am i doing wrong?

       

       

       

        • 1. Re: text functions Left and right
          philmodjunk

          Nothing in your script enters any data. Instead, it enters find mode and enters the data as search criteria, then leaves the user with that criteria entered without performing any find to pull up a record.

          I'm guessing you want to use a script like this, but could easily be wrong:

          Set varable [$originzip; value:left (frontier_Mars_Calulations::originZip; 3 )]

          Go to layout ["all" (frontier_Mars)]

          New Record/Request

          Set field [frontier_Mars::ZB_01;$originZip]

          • 2. Re: text functions Left and right
            Kirk_1

            I still may be missing what your saying but;

            i have a memphis zip (38118) in the field: frontier_Mars_Calulations::originZip; from the other table.

            • 3. Re: text functions Left and right
              philmodjunk

              I would assume so. That's why you have this step in your script:

              Set varable [$originzip; value:left (frontier_Mars_Calulations::originZip; 3 )]

              It copies the left three characters of that field into a variable. The script then changes layouts, creates a new record and copies the data from the variable into the ZB_01 field of that table.

              • 4. Re: text functions Left and right
                Kirk_1


                I took the idea you planted, used the debugger. Its taking the info with it. On the look up i need an ** to represent the other 2 digets for the find.

                 

                How do i add that to the script?I tried

                $originZip and "**"

                $originZip; "**"

                 

                • 5. Re: text functions Left and right
                  philmodjunk

                  Please spell out exactly what you need this script to do.

                  You appear to be setting up a find request. Is that what you wnat here? Do you want to find all records that start with the same first three letters of the zip as is found on the original record? (You don't want to use a new record/request step in that case.)

                  • 6. Re: text functions Left and right
                    Kirk_1

                    I am trying to do a found set. I did not use the new record.

                    Im trying to put the following into a field and search for it:

                    381**

                    How do i get the ** behind $originZip in the set field function?

                    • 7. Re: text functions Left and right
                      philmodjunk

                      No, but I did with my example script so I needed to be sure that you weren't.

                      I would think that this script should work for you:

                      set varable [$originzip; value:left (frontier_Mars_Calulations::originZip; 3 )]

                      Go to layout ["all" (frontier_Mars)]

                      Enter Find Mode []

                      Set field [frontier_Mars::ZB_01;$originZip & "*"]

                      Peform find []