|
-
Jan 30th, 2001, 06:42 AM
#1
Thread Starter
Fanatic Member
consider the following:
Code:
frmDrawDlg!txtAspectheight.Visible = false
now consider:
Code:
frmDrawDlg.txtAspectheight.Visible = False
Both of the above statements work, but...
Q. Why use an exclamation mark instead of a dot?
Answers on a postcard please to:
24 Crispin hasn't woken up yet Street
Springfield
90243
Thanks in advance guys.
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Jan 30th, 2001, 07:01 AM
#2
Fanatic Member
Recordsets.
If a field name contains a space (or similar - not that u you would ever do this, right? ), it needs to be protected from big bad world by square brackets or quotes. You can't use a dot woth these
eg
rs![A Test] works
rs.[A test] doesn't.
The it seems you can use exclamations to point to objects, and dots to reference methods and some objects
(that last bit may be a bit spurious!)
-
Jan 30th, 2001, 07:12 AM
#3
Addicted Member
Then...
What is the difference between:
rs("A Test") and rs![A Test]
-
Jan 30th, 2001, 07:15 AM
#4
Thread Starter
Fanatic Member
Gaffer,
Thanks!, i've used the recordset stuff before, I had never seen objects or methods referenced by an exclamation, always a dot (wierd)
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Jan 30th, 2001, 07:19 AM
#5
Addicted Member
Early binding and late binding. Using the fullstop is late bound and therefor slower. That is as far as Recordsets are concerned.
I'm not sure about forms, although I do know that some other objects are slower if you use "." instead of "!"
Shrog
VB6 Ent SP5
Win2000 
-
Jan 30th, 2001, 07:20 AM
#6
_______
<?>
data1.recordset.myField = text1
or
data1!myfield = text1
the ! in this instance is a shortcut
you can omit the reference to the recordset
as the ! implies a recordset follows the control
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jan 30th, 2001, 07:47 AM
#7
Thread Starter
Fanatic Member
I have no problem with the recordset syntax (I don't have a problem with any of it for that matter) I am interested as to why it is used (and for what specific reason (if any)) for referencing objects in forms, like textboxes e.t.c If it's early binding vs late binding then I can appreciate that, but is anybody really sure about this one:
Form.textbox.caption = "I am sure"
Vs
Form!textbox.caption = "Or am I?"
I don't know of anything in the IDispatch interface that qualifies dispID's in different ways, I reckon i might be barking up the wrong tree......
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|