passing objects

Discussion in 'Questions (Windows Mobile)' started by paul j, Nov 10, 2007.

  1. paul j

    paul j Member Licensed User

    Is there a way to pass a object to a sub.


    Sub mnuWESave_Click
    'pre : er is een tabel in het geheugen
    'post : er is opdracht gegeven de tabel fysiek op te slaan

    Sub mnuWESave_Click
    SaveTable(tblWeight, "tblWeight.dat")
    end sub



    Sub SaveTable(aTable, aFileName)
    'pre : a table in memory
    'post : table has been writen to the disk

    If FileExist (aFileName) = true Then
    lvYesNo = Msgbox("bestand " & aFileName & " exists, overwrite?"," ", cMsgboxYesNo, cMsgBoxQuestion)
    If lvYesNo =cYes Then
    gvWE_tbl_Mutaties = false
    aTable.SaveCSV(aFileName, ";", true)
    End If
    End If

    End Sub
     
  2. agraham

    agraham Expert Licensed User

    Try passing the control name as a string and in the Sub use Control(ControlName) to access the control.
     
  3. paul j

    paul j Member Licensed User

    I already tried. It doesn't regonize the string as an object and give's the message "not a know control or object"
     
  4. agraham

    agraham Expert Licensed User

    Look at this.
     

    Attached Files:

  5. paul j

    paul j Member Licensed User

    :signOops: In the first moment I didn't understand your solution, but when i looked better in the help I saw what you ment. And yes it works. Thanks :sign0060:
     
Loading...