My requirement is to develop an application in power builder, which receives Scanned barcodes and decodes it










0















My requirement is to develop an application in power builder, which receives Scanned barcodes and decodes it



The application should also be able to reveal hidden ASCII codes in the scanned barcodes.
Like:-



ASCII Codes
TAB - 9
BS Backspace - 8
EOT End of Transmission - 4
FF Form Feed - 12



Etc.



When scanned codes arrives at datawindow, rich text input, single line edit it comes as one character at a time
So my logic would be is to take that character before it is written in Datawindow or rich text input and find its ascii value and if it is less the 32 (which means it is a hidden character)
I can give brackets around it and show in display screen. so that hidden characters are not missed out.



Eg Scanned code abcdefgh



Decoded code will be abc[09]def[12]gh



So I tried with EditChanged, itemchanged , KeyDown events but I am unable to get the character before it is written in datawindow. Because once it is been written in datawindow hidden characters will be missed out.



Is there any event in powerbuilder will give me the scannedcode after it has been scanned but before it has been written in data window or rich text control,
Something like PreviewTextInput Event, which will preview the text before writing it into the data window.



Sample barcode Image uploaded



Thanks and regards,










share|improve this question


























    0















    My requirement is to develop an application in power builder, which receives Scanned barcodes and decodes it



    The application should also be able to reveal hidden ASCII codes in the scanned barcodes.
    Like:-



    ASCII Codes
    TAB - 9
    BS Backspace - 8
    EOT End of Transmission - 4
    FF Form Feed - 12



    Etc.



    When scanned codes arrives at datawindow, rich text input, single line edit it comes as one character at a time
    So my logic would be is to take that character before it is written in Datawindow or rich text input and find its ascii value and if it is less the 32 (which means it is a hidden character)
    I can give brackets around it and show in display screen. so that hidden characters are not missed out.



    Eg Scanned code abcdefgh



    Decoded code will be abc[09]def[12]gh



    So I tried with EditChanged, itemchanged , KeyDown events but I am unable to get the character before it is written in datawindow. Because once it is been written in datawindow hidden characters will be missed out.



    Is there any event in powerbuilder will give me the scannedcode after it has been scanned but before it has been written in data window or rich text control,
    Something like PreviewTextInput Event, which will preview the text before writing it into the data window.



    Sample barcode Image uploaded



    Thanks and regards,










    share|improve this question
























      0












      0








      0








      My requirement is to develop an application in power builder, which receives Scanned barcodes and decodes it



      The application should also be able to reveal hidden ASCII codes in the scanned barcodes.
      Like:-



      ASCII Codes
      TAB - 9
      BS Backspace - 8
      EOT End of Transmission - 4
      FF Form Feed - 12



      Etc.



      When scanned codes arrives at datawindow, rich text input, single line edit it comes as one character at a time
      So my logic would be is to take that character before it is written in Datawindow or rich text input and find its ascii value and if it is less the 32 (which means it is a hidden character)
      I can give brackets around it and show in display screen. so that hidden characters are not missed out.



      Eg Scanned code abcdefgh



      Decoded code will be abc[09]def[12]gh



      So I tried with EditChanged, itemchanged , KeyDown events but I am unable to get the character before it is written in datawindow. Because once it is been written in datawindow hidden characters will be missed out.



      Is there any event in powerbuilder will give me the scannedcode after it has been scanned but before it has been written in data window or rich text control,
      Something like PreviewTextInput Event, which will preview the text before writing it into the data window.



      Sample barcode Image uploaded



      Thanks and regards,










      share|improve this question














      My requirement is to develop an application in power builder, which receives Scanned barcodes and decodes it



      The application should also be able to reveal hidden ASCII codes in the scanned barcodes.
      Like:-



      ASCII Codes
      TAB - 9
      BS Backspace - 8
      EOT End of Transmission - 4
      FF Form Feed - 12



      Etc.



      When scanned codes arrives at datawindow, rich text input, single line edit it comes as one character at a time
      So my logic would be is to take that character before it is written in Datawindow or rich text input and find its ascii value and if it is less the 32 (which means it is a hidden character)
      I can give brackets around it and show in display screen. so that hidden characters are not missed out.



      Eg Scanned code abcdefgh



      Decoded code will be abc[09]def[12]gh



      So I tried with EditChanged, itemchanged , KeyDown events but I am unable to get the character before it is written in datawindow. Because once it is been written in datawindow hidden characters will be missed out.



      Is there any event in powerbuilder will give me the scannedcode after it has been scanned but before it has been written in data window or rich text control,
      Something like PreviewTextInput Event, which will preview the text before writing it into the data window.



      Sample barcode Image uploaded



      Thanks and regards,







      barcode-scanner powerbuilder






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 7:22









      XsysysXsysys

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          1














          The Event ID pbm_dwnchanging might work for you. Try creating an event on the DataWindow control that uses pbm_dwnchanging - this appears to capture the characters as they're being entered, but before they're put into the edit control (like you would think pbm_dwnkey should).



          // "prototype" in the window object's datawindow control declaration:
          event onpbmdwnchanging pbm_dwnchanging


          Here is the pbm_dwnchanging event extension's code - basically, it calls a method that builds the "representation" of the data being entered and logs it (i.e.: appends a Multi-line Edit control in the window).



          event onpbmdwnchanging;

          string dataRepresentation
          // get the representation of the data
          dataRepresentation = getDataRepresentation(data)

          // log it to the window's MLE
          addLogMessage("onpbmdwnchanging - row: " + string(row) + " data: '" +
          dataRepresentation + "'")

          return
          end event


          Lastly, the function that builds the "representation" of the data:



          protected function string getDataRepresentation (string as_input);
          string dataRep
          char dataChars
          string currentChar
          long ll_datalength, ll_index

          dataChars = as_input // cast the string into a character array

          ll_datalength = upperbound(dataChars)
          for ll_index = 1 to ll_datalength
          currentChar = dataChars[ll_index]
          if Asc(currentChar) < 32 then
          // "hidden" character
          dataRep += "[" + string(Asc(currentChar)) + "]"
          else
          dataRep += string(currentChar)
          end if
          next

          return dataRep

          end function


          note: tested and works in PB 12.6






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314272%2fmy-requirement-is-to-develop-an-application-in-power-builder-which-receives-sca%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            The Event ID pbm_dwnchanging might work for you. Try creating an event on the DataWindow control that uses pbm_dwnchanging - this appears to capture the characters as they're being entered, but before they're put into the edit control (like you would think pbm_dwnkey should).



            // "prototype" in the window object's datawindow control declaration:
            event onpbmdwnchanging pbm_dwnchanging


            Here is the pbm_dwnchanging event extension's code - basically, it calls a method that builds the "representation" of the data being entered and logs it (i.e.: appends a Multi-line Edit control in the window).



            event onpbmdwnchanging;

            string dataRepresentation
            // get the representation of the data
            dataRepresentation = getDataRepresentation(data)

            // log it to the window's MLE
            addLogMessage("onpbmdwnchanging - row: " + string(row) + " data: '" +
            dataRepresentation + "'")

            return
            end event


            Lastly, the function that builds the "representation" of the data:



            protected function string getDataRepresentation (string as_input);
            string dataRep
            char dataChars
            string currentChar
            long ll_datalength, ll_index

            dataChars = as_input // cast the string into a character array

            ll_datalength = upperbound(dataChars)
            for ll_index = 1 to ll_datalength
            currentChar = dataChars[ll_index]
            if Asc(currentChar) < 32 then
            // "hidden" character
            dataRep += "[" + string(Asc(currentChar)) + "]"
            else
            dataRep += string(currentChar)
            end if
            next

            return dataRep

            end function


            note: tested and works in PB 12.6






            share|improve this answer



























              1














              The Event ID pbm_dwnchanging might work for you. Try creating an event on the DataWindow control that uses pbm_dwnchanging - this appears to capture the characters as they're being entered, but before they're put into the edit control (like you would think pbm_dwnkey should).



              // "prototype" in the window object's datawindow control declaration:
              event onpbmdwnchanging pbm_dwnchanging


              Here is the pbm_dwnchanging event extension's code - basically, it calls a method that builds the "representation" of the data being entered and logs it (i.e.: appends a Multi-line Edit control in the window).



              event onpbmdwnchanging;

              string dataRepresentation
              // get the representation of the data
              dataRepresentation = getDataRepresentation(data)

              // log it to the window's MLE
              addLogMessage("onpbmdwnchanging - row: " + string(row) + " data: '" +
              dataRepresentation + "'")

              return
              end event


              Lastly, the function that builds the "representation" of the data:



              protected function string getDataRepresentation (string as_input);
              string dataRep
              char dataChars
              string currentChar
              long ll_datalength, ll_index

              dataChars = as_input // cast the string into a character array

              ll_datalength = upperbound(dataChars)
              for ll_index = 1 to ll_datalength
              currentChar = dataChars[ll_index]
              if Asc(currentChar) < 32 then
              // "hidden" character
              dataRep += "[" + string(Asc(currentChar)) + "]"
              else
              dataRep += string(currentChar)
              end if
              next

              return dataRep

              end function


              note: tested and works in PB 12.6






              share|improve this answer

























                1












                1








                1







                The Event ID pbm_dwnchanging might work for you. Try creating an event on the DataWindow control that uses pbm_dwnchanging - this appears to capture the characters as they're being entered, but before they're put into the edit control (like you would think pbm_dwnkey should).



                // "prototype" in the window object's datawindow control declaration:
                event onpbmdwnchanging pbm_dwnchanging


                Here is the pbm_dwnchanging event extension's code - basically, it calls a method that builds the "representation" of the data being entered and logs it (i.e.: appends a Multi-line Edit control in the window).



                event onpbmdwnchanging;

                string dataRepresentation
                // get the representation of the data
                dataRepresentation = getDataRepresentation(data)

                // log it to the window's MLE
                addLogMessage("onpbmdwnchanging - row: " + string(row) + " data: '" +
                dataRepresentation + "'")

                return
                end event


                Lastly, the function that builds the "representation" of the data:



                protected function string getDataRepresentation (string as_input);
                string dataRep
                char dataChars
                string currentChar
                long ll_datalength, ll_index

                dataChars = as_input // cast the string into a character array

                ll_datalength = upperbound(dataChars)
                for ll_index = 1 to ll_datalength
                currentChar = dataChars[ll_index]
                if Asc(currentChar) < 32 then
                // "hidden" character
                dataRep += "[" + string(Asc(currentChar)) + "]"
                else
                dataRep += string(currentChar)
                end if
                next

                return dataRep

                end function


                note: tested and works in PB 12.6






                share|improve this answer













                The Event ID pbm_dwnchanging might work for you. Try creating an event on the DataWindow control that uses pbm_dwnchanging - this appears to capture the characters as they're being entered, but before they're put into the edit control (like you would think pbm_dwnkey should).



                // "prototype" in the window object's datawindow control declaration:
                event onpbmdwnchanging pbm_dwnchanging


                Here is the pbm_dwnchanging event extension's code - basically, it calls a method that builds the "representation" of the data being entered and logs it (i.e.: appends a Multi-line Edit control in the window).



                event onpbmdwnchanging;

                string dataRepresentation
                // get the representation of the data
                dataRepresentation = getDataRepresentation(data)

                // log it to the window's MLE
                addLogMessage("onpbmdwnchanging - row: " + string(row) + " data: '" +
                dataRepresentation + "'")

                return
                end event


                Lastly, the function that builds the "representation" of the data:



                protected function string getDataRepresentation (string as_input);
                string dataRep
                char dataChars
                string currentChar
                long ll_datalength, ll_index

                dataChars = as_input // cast the string into a character array

                ll_datalength = upperbound(dataChars)
                for ll_index = 1 to ll_datalength
                currentChar = dataChars[ll_index]
                if Asc(currentChar) < 32 then
                // "hidden" character
                dataRep += "[" + string(Asc(currentChar)) + "]"
                else
                dataRep += string(currentChar)
                end if
                next

                return dataRep

                end function


                note: tested and works in PB 12.6







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 17 '18 at 14:01









                Frank AlvaroFrank Alvaro

                7418




                7418





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314272%2fmy-requirement-is-to-develop-an-application-in-power-builder-which-receives-sca%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    ReactJS Fetched API data displays live - need Data displayed static

                    政党