probably simple question

I'm looking at some VB code at work that contains (among others) this piece:

With oRS
 If Not (.EOF And .BOF) Then
   Do While Not .EOF
   lTaskID = !TaskID
... etc.

My question: what in the world do the "!" mean in there?
LVL 1
gsnAsked:
Who is Participating?
 
TimCotteeHead of Software ServicesCommented:
The ! syntax refers to the fields collection of the recordset, this could equally be represented as:

ITaskID = .Fields("TaskID").Value

It is recommended to use the full syntax as the ! syntax forces the code to evaluate the line then convert it internally as above and then get the result. However in reality the time taken to do this is very small and has little to no impact.
0
 
bobbit31Commented:
!TaskID means that TaskID is a field in the recordset (oRS)
0
 
bobbit31Commented:
so basically ITaskID = the value of TaskID field
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
gsnAuthor Commented:
yeah, I understand that... sorry, should have made myself clear: what's the difference between "." and "!" in that regard.
0
 
BahnassCommented:
TaskID is a field in oRS Recordset

With oRS makes    !TaskID translated into
oRS!TaskID

Hope it is clear
0
 
Éric MoreauSenior .Net ConsultantCommented:
the ! in this case is called the Bang operator.

you could have wrote:
lTaskID = .fields("TaskID").value
0
 
BahnassCommented:
Hi Tim again

No I'm abad typist !!!!
0
 
gsnAuthor Commented:
thanks for the prompt answer!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.