Hi all , Im starting to learn visual basic and I have a question if all dont mind to answer me ,
I need to know and identify each individual component for this vb commands ?

This = That.theOther (something)

Much appreciated

Recommended Answers

All 5 Replies

I think you are going to have to ask a more specific question. I really do not know what you are asking. Also, for future reference, daniweb does not use bbcode tags ([B], etc). We use markdown syntax. For details please see here. That page is also available by clicking on the ? in the top right area of the edit toolbar.

I think I know what you mean. I believe you are asking about the different elements that form an expression. I think for this I shall just list them for you.

  • This - Dimension Variable
  • That - Object
  • TheOther - Function
  • Something - Parameter

It is probably going to be beneficial to have a read online about each of these to fully understand them. This is key to programming so make sure you understand it!

Hope this helps

I think you should start with this video tutorial for beginners. As for the explanation by ObSys, his terminology may be confusing.

This is not a "dimension variable". It is just a variable.
TheFunction is not, strictly speaking a function. It is a method.

Reading your example, this = that.theother(something) I would take that to mean variable = <Class or Namespace>.<Function>(Parameters)
where variable is some sort of variable of a type e.g. Integer, Object, Decimal, Boolean etc. The Class or Namespace contains a function that returns a value of the same type as your variable and you are passing parameters into it.

' <'> is a vb comment tag

'Example of a function  that returns an integer:
Public Function CountPersonVisits( ByRef PersonID as Integer) As Integer
' do whatever happens in here, for the sake of the example, 
'I declare a return Variable
dim MyReturn as Integer
'Processing happens here
'Returning our value
Return MyReturn
End Function
'Sub routines, Functions and Properties have acess scopes 
'Private(accessed only in the current class) 
'Public (Can be accessed by any class) 
'Friend (Can be accessed by members in any of the classes in the current assembly). 
'Protected (Can be accessed by methods in the current class 
'or in any class that inherits from this class)

'Declare a variable of type Integer
dim CountOfVisits as Integer
dim MyPersonID as integer = 1 'declared and set a value
'If the function occurs withing the same class 
CountOfVisits = CountPersonVisits(MyPersonID)

'If the Function occurs in a different class ( Function would have to be Public or Friend)
CountOfVisits = MyOtherClass.CountPersonVisits(MyPersonID)

Thank you very much indeed .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.