Consultation on the use of trim function in vb? new hand

End sub ends a process.

Exit sub exits from the process.

Execution to END SUB means the end of the process.

Execution to EXIT SUB means exiting the process, and the following code does not need to be executed. It seems the same. Sometimes we need to quit the process under certain conditions, but don't quit when the conditions are not met.

For example:

i=0

And I> three

i=i+ 1

If w="Admin ",then

Msgbox ("welcome")

Login = 1 unsubscribe

other

W=inputbox ("Please enter the login password")

If ... it will be over.

line

Msgbox ("Password error three times, login failed")

Login =0

End joint

Private means private, relative to public.

For example, it may be easier to understand.

Code in table 1

privete sub PrivateSub()

...

End joint

public sub PublicSub()

...

End joint

Such two processes

I can call it in other modules of the same project.

Form 1. PublicSub()

To complete an operation, and privateSub can only be called in form 1.

Trim(str), remove the spaces at both ends of the str.

Sometimes using trim has the same effect as not using trim. Trim is a habit and a good habit in general, but it is not absolute, such as password=inputbox ("Please enter your password:").