Visual Basic Programming lesson 10 - Write your own function

preview_player
Показать описание
In this tutorial we write a simple function that can count how many words are in a string. We also teach how to call a function.
Рекомендации по теме
Комментарии
Автор

Interesting for VB6 programming and VBA programming too.

avbprogramminguser
Автор

Adding 1 to the Wordcount is a rough/quick fix. A better solution is to add this line after the...

If Text.Length > 0 then
Wordcount = 1
For i = etc

And in the For loop add to the line...
If Letter = " " AND Text.Char(i-1) <> " " Then
The bit of code after the AND accounts for a double space.

I'm a new programmer so I hope I'm not way off with my solution.

VikingOz

Viking