Skip to Content

Empty Fields in Array

Hello,

I have a question. I am trying to get just a single field in my array. But I am always getting an empty entry towards my target field. How does that come? And more important, can I remove that somehow?

Thanks for any reply.

Kind regards

Sam

WhileReadingRecords;
global stringvar array art;
global numbervar artcounter = 0;

if ({@le_Artikel_Nummer} = "SA11524") Then
    (artcounter := artcounter + 1;

    (redim art[artcounter];
    art[artcounter] := {@le_Artikel_Nummer}));
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Nov 03, 2019 at 07:19 AM

    Hi Samuel,

    Try:

    WhileReadingRecords;
    global stringvar array art;
    global numbervar artcounter = 0;
    if ({@le_Artikel_Nummer} = "SA11524") Then
        (
         artcounter := artcounter + 1;
         redim preserve art[artcounter];
         art[artcounter] := {@le_Artikel_Nummer};
        );

    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 04, 2019 at 07:32 AM

    Hi Abhilash,

    I have tested your code but I get the same result. I put a picture to show what it looks like (@_Artikel) and the complete Table (AUFDRUP_TXT.ARTNUM). Does a way exist to get just there entry? I made a count on it and get 1 in return...so does the problem maybe lies somewhere else?


    pic.png (2.9 kB)
    pic2.png (3.3 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 04, 2019 at 08:57 AM

    Jeah i put it in the header and a second reference in the detail section. worked out for me. thanks a lot. Bytheway i changed the type to numbervar because i needed an other field but tried to get the articlenumber first.

    whileprintingrecords;
    global numbervar array art1;
    if count(art1) = 0 then "" else cstr(maximum(art1), 0, "")
    
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.