CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: Create Array

  1. #1
    Join Date
    Jul 2019

    Create Array


    I want to create an Array while reading the record or before? (Need to find out what is better.)

    Kinda like this

    dim i, cnt as number
    dim p() as number
    cnt = count(field_for_p)
    for i = 1 to cnt
    redim preserve p(i)
    next i
    formula = minimum(p)
    Otherwise I would like to create a counter. Somebody can help, or give me a hint?

    Kind regards

  2. #2
    Join Date
    Jul 2019

    Re: Create Array

    Ok, i got something that seems quite useful.
    But Now I Need to run this BeforeReadingRecords. (X is what i need)
    In my example I have 10 Positions and 4 Must be skipped and the IDs that must be put in the Array are 3, 5, 6, 7, 8 (x must become 3).

            Dim i, j, x as Number
            Dim p() as Number
            For j = 1 To fldCnt
                If Not (fldHID = strHID) And Not (fldRZP = intRZP) Then 
                    Redim Preserve p(j)
                    p(j) = fldCnt
                End If
            Next j   
            x = Minimum(p)
    guess its kinda this in the Header? just with the code above?

    global x as number
    formula = x = 0
    and this in Detail?
    Global x as number
    formula = x = x + 1
    Somebody knows how to design this?

    Kind regards Sam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)