Results 1 to 2 of 2

Thread: Get/Let/Set

  1. #1
    Join Date
    Jul 2006
    Posts
    157

    Unanswered: Get/Let/Set

    Hi: Can any one please give me a simple example of get/let/set. I want to create three textbox and pass some values thru GET/LET/SET as i think this way is easy for me to understand them

    Thanks.

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    LET is obsolete, and only supported in VB for backwards compatibility. Its use is entirely optional.

    Ref http://msdn.microsoft.com/library/en...l/vastmLet.asp

    Code:
    Text1.Text = "This is a Test"
    ' is equivalent to 
    Let Text1.Text = "This is a Test"
    Set is used in conjunction with objects, at the object level.

    Ref http://msdn.microsoft.com/library/sh.../deeptree.asp?

    For example
    Code:
      Dim txt As TextBox
      
      Set txt = Me.txtText
      
      Me.txtText2.Text = txt.Text

    GET (along with PUT) is used in conjunction with Binary and Random File I/O. Get reads data from an open disk file into a variable.

    ref http://msdn.microsoft.com/library/en...l/vastmGet.asp

    In order to read the first 20 characters from a text file, you could use the GET statement like this...
    Code:
    Dim strFile as String
    
    strFile = Space(20)  ' "size" the input buffer
    
    Open "C:\TestFile.Txt" for Binary as #1
    
    Get #1, 1, strFile  ' read the buffer of data from the file
    
    Close #1  ' Close the file
    
    Me.Text1.Text = strFile
    Last edited by loquin; 01-04-07 at 13:20.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

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