Quantcast
Channel: Microsoft Dynamics SL Forum - Recent Threads
Viewing all articles
Browse latest Browse all 2378

Deleting Record from Memory Array

$
0
0

I'm trying to compare records in a memory array for a grid to a specific criteria.  If they don't match, I use the MDelete function to remove the record from the memory  array.  When I have looped through all the records, I use MFirst to move to the first record, and then MDisplay to refresh the contents of the memory array on the grid.  However, while it does correctly identify the records that need to be removed, and does not give an error when using the MDelete function, when I use the MDisplay to show the records, all the records are still present, including the ones that should have been removed.  Here is the code I"m using:

Private Sub cmdRefresh_Click()
mem_Detail = GetGridHandle("SafGrid1")
If Trim(CreditSite) <> "" Then
Dim User8 As String
Dim OrdNbr As String
  serr1 = MFirst(mem_Detail, MemMaintFlg)
      
     While (serr1 = 0)
       
        'check value of User8
        Call GetBufferValue("bsoheader.User8", User8)
       If Trim(User8) = Trim(CreditSite) Then
       'go on to the next record      
               serr1 = MNext(mem_Detail, MemMaintFlg)
        Else
              'delete this record from memory array

              RecFetch = MDelete(mem_Detail, MemMaintFlg)
        End If

      Wend
      serr1 = MFirst(mem_Detail, MemMaintFlg)

      Call MDisplay(mem_Detail)
      
 End If
 
End Sub

Any thoughts or suggestions on what I'm doing wrong?  Thanks in advance.


Viewing all articles
Browse latest Browse all 2378

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>