Options

[ERROR]The length of the text string exceeds the size string

xina_manxina_man Member Posts: 116
Hi there!

I'm using an automation to create 2D barcodes.
Every time that the automation returns a text bigger than 250 char the message below pops up.
"The length of the text string exceeds the size of the string buffer."

The text varible shouldn't be 1024char?
Is there any way to handle big text variables?

Thanks in advance!

Answers

  • Options
    krikikriki Member, Moderator Posts: 9,098
    You should check with the debugger to find the point where it blocks.

    It is possible you have a variable that is defined as Text250.
    Or you want to put it into a field of a table. These are still limited to 250 characters.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    xina_manxina_man Member Posts: 116
    kriki wrote:
    You should check with the debugger to find the point where it blocks.

    It is possible you have a variable that is defined as Text250.
    Or you want to put it into a field of a table. These are still limited to 250 characters.

    Thanks for your reply
    IF NOT ISCLEAR(Barcode) THEN
       CLEAR(Barcode);
    CREATE(Barcode);
    ConvBarcode := Barcode.Encode(Text003);  // error break 
    

    The code is above.
    ConvBarcode it's a text variable with 1024 of length.
    the Encode() Method receives a text variable to convert into PDF417 and returns it as a converted text in hexadecimal chars.
    The returned text is something like:

    00AB8AC7C530E4F770A8780BAD
    00AB857BCB8EE1D7B056780BAD
    00AB8A81D4E0EC779578780BAD
    00ABA820CBB9E7D6750C380BAD
    00AB947DC3A4E643728EF80BAD
    00AB850BC87A6052F0A0980BAD
    00ABAC63CFACECF2F2C4380BAD
    00AB8168C1442814F281080BAD
    00AB9640CDB06F971058B80BAD
    00ABAE7CC76E2309D2E7180BAD
    00AB963DCB17EF70B2C6F80BAD
    00ABAEE1D8672750702E680BAD

    If the returned text is shorter than 250 chars it goes OK, otherwise the error message pops up.
    I dont know how to solve this issue...
  • Options
    ara3nara3n Member Posts: 9,256
    I'm guessing you are using older clients.

    You need to try this with a newest executable 5.0 for example. They have increased the size from 250 to 1024.

    your text length is 324. So that's why you are getting the error.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    krikikriki Member, Moderator Posts: 9,098
    Just a wild guess : "ConvBarcode" is of type code?
    Code is limited to 250 chars.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    xina_manxina_man Member Posts: 116
    kriki wrote:
    Just a wild guess : "ConvBarcode" is of type code?
    Code is limited to 250 chars.

    Hi kriki,

    ConvBarcode is a text variable with 1024 of length, and thats why it is so strange...
  • Options
    xina_manxina_man Member Posts: 116
    ara3n wrote:
    I'm guessing you are using older clients.

    You need to try this with a newest executable 5.0 for example. They have increased the size from 250 to 1024.

    your text length is 324. So that's why you are getting the error.

    I'm using navision 4.0 SP2. Is this the problem???
    Must I upgrade it to 5.0 to solve this issue?
    It's weird that i can give this variable a text over 250 char, and if i do the same thing usuing the automation it returns an error.
    ](*,) ](*,) ](*,)
  • Options
    ara3nara3n Member Posts: 9,256
    Are you sure it's below 1024 characters?

    I can't remember at what version they increased the buffer.

    I would just try and copy the code and run it in 5.0 executables. To see if it works.

    If it doesn't work then the amount that is returned is greater than 1024 characters. In that case there isn't much you can do.

    Even if you get the values through some wrapper, I don't know how you will be able to print the whole barcode if it's greater than 1024 characters.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    krikikriki Member, Moderator Posts: 9,098
    ara3n wrote:
    I can't remember at what version they increased the buffer.
    I think 3.01.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    xina_manxina_man Member Posts: 116
    kriki wrote:
    ara3n wrote:
    I can't remember at what version they increased the buffer.
    I think 3.01.

    Thank you Kriki,

    In oder to solve this issue, I've asked the Barcode software supplier to add a parameter in the dll to "slice" the returned value.
    I think that this can solve the problem...

    Thanks
Sign In or Register to comment.