News:

  • September 29, 2026, 03:12:39 PM

Login with username, password and session length

Author Topic: Strings  (Read 8583 times)

jwbaker3

  • Hero Member
  • *****
  • Posts: 144
Strings
« on: February 05, 2024, 12:01:39 PM »
I am using a reader to stream in the data sometimes there are leading zeros, the stream in has them from the reader but when I do a string copy it drops the leading zero's. Is there any way to keep the leading zero's on a copy?

Thanks,
JW

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Strings
« Reply #1 on: February 05, 2024, 12:30:37 PM »
REMOVED
« Last Edit: February 05, 2024, 12:32:20 PM by franji1 »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Strings
« Reply #2 on: February 05, 2024, 12:35:35 PM »
Sorry, I misread your request.

So in the original String element it is something like "0001234"?

Then you do a STRCOPY (no conversions, no parsing, nothing)
and in the destination you are getting (as a string "1234"?

If not, please provide details exactly what you get in the STREAMIN instruction, and what code you are processing the string with, and what you get in the final STRING.

jwbaker3

  • Hero Member
  • *****
  • Posts: 144
Re: Strings
« Reply #3 on: February 05, 2024, 02:02:16 PM »
I went back and looked at the QR codes they were scanning in and some of them did not have the leading zero's, so I think it is a non automation problem. I have noticed when I convert a string to a integer if there is a leading zero it drops the zero from the number. I have a work around for this, so not a big deal.

Thanks,
JW

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Strings
« Reply #4 on: February 05, 2024, 02:16:16 PM »
I have noticed when I convert a string to a integer if there is a leading zero it drops the zero from the number. I have a work around for this, so not a big deal.

That's what I would expect.  When converting a string "123" to its integer value, it's 123 - that's whether the source string is "123" or "0123" or "00000123"