What is ! operator for? When should I use this? What are the diff. between ! and .?
Thanx.
SK
Printable View
What is ! operator for? When should I use this? What are the diff. between ! and .?
Thanx.
SK
heck if i know, i want to know too!
------------------
[email protected]
http://www.hackvp.com
<quote>Ask not what you can do for your country, but what can your country do for you</quote>
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
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
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
With databases/recordsets, the ! is a replacement for the .Fields("FieldName").value
SO
This:
myRS!CustID
would equal this:
myRS.Fields("CustID").Value
Tom
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.
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.
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 . ....
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