Results 1 to 10 of 10

Thread: Re: A simple operator !

  1. #1
    Guest

    Post

    What is ! operator for? When should I use this? What are the diff. between ! and .?

    Thanx.

    SK

  2. #2

    Post

    heck if i know, i want to know too!

    ------------------
    webmaster@hackvp.com
    http://www.hackvp.com
    <quote>Ask not what you can do for your country, but what can your country do for you</quote>


  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Post

    Could be wrong on this but I think I'm ok on these examples.

    !
    Example: is used in rleation to recordsets...it is a shortcut which eleminates the need to type in the field name when processing a filed in a record

    data1.recordset!help
    is the same as
    data1.recordset.yourfield.help

    ?
    example...You can use it as a character when specifing what chracters are permitted in a MaskedEdit control

    MaskedEdit1.mask = "?#? #?#"
    allows you
    alpha number alpha number alpha number

    ie..postal code..L6Y 7Y5

    Wayne

    Ps...I really don't think they are listed as Operators


  4. #4
    Member
    Join Date
    Jan 1999
    Location
    Garden Grove, CA, Orange
    Posts
    55

    Post

    and somemore....

    It's from MSDN for "!"(for VB)

    The type-declaration character for Single is the exclamation point (!).

    so, dim i as Single = dim i!

    Or

    When using Like Operator

    ? - Any single character.

    "BAT123khg" Like "B?T*" ' Returns True.
    "BAbT123khg" Like "B?T*" ' Returns False.
    "B9T123khg" Like "B?T*" ' Returns False.

    [!charlist] - Any single character not in charlist.

    "aM5b" Like "a[L-P]#[!c-e]" ' Returns True.
    "aM5b" Like "a[L-P]#[!b-e]" ' Returns False.

    Joon

  5. #5
    Guest

    Post

    Please look at the following case.

    If frmAccountDisplay!txtAccountBalance.Text < 0 Then
    frmAccountDisplay!txtAccountBalance.BackColor = 0 frmAccountDisplay!txtAccountBalance.ForeColor = 255
    End If

    I have noticed that I can also reference a field (object) on a form using "!" instead of ".". Is it true? If so, in what cases can or should I use "!" instead of "." to reference a field or object?

    Thanx.

    SK

  6. #6
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    With databases/recordsets, the ! is a replacement for the .Fields("FieldName").value

    SO

    This:
    myRS!CustID

    would equal this:
    myRS.Fields("CustID").Value


    Tom

  7. #7
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    If I put it in the correct words... it's a short way for looking things up in a collection.
    Recordset!FieldName = Recordset.Fields("FieldName")
    (Fields is a collection)
    Form1!Text1 = Form1.Text1

    Look it up in MSDN to get the description in nice words ;-) There is something about speed too.

  8. #8
    Guest

    Post

    I beleive it was once used to access controls
    the ! for acessing controls/collections and the . for accessing property's/methods/etc

    form1!text1.text = "text"

    But then they added collections and stuff to everything and the ! thingie became obsolete.

  9. #9
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    Yes, but since Text1 is part of the controls collection you can use the !. But, since it's basically a property of the form too, you can use the . ....

  10. #10
    Lively Member
    Join Date
    Dec 1999
    Posts
    79

    Post

    I don't know if this has anything to do with it, but in maths, x! means x * x-1 * x-2 * x-3 etc. so if x was 5, x! would be 5 * 4 * 3 * 2 *1 = 120

Posting Permissions

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



Click Here to Expand Forum to Full Width