View Single Post
Old 08-09-2003, 05:20 PM   #3 (permalink)
rdove
Masked Moderator
 
rdove's Avatar
 
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
rdove is on a distinguished road
[quote]Originally posted by joe_bruin
now waitaminute,
is this intended as a demostration of the language, or of the api?
your function just calls another function. it doesn't really demonstrate that you are capable of finding the number of times a character appears in a string.
how about we see a reimplementation of instr() in vb instead of just calling it?


Yes it does.....the instr function is a keyword function in vb. Just like the dateadd one I posted earlier. You can use the instr function outside of another function, just take off the function:

Code:
dim strChar as String = "Johnny Boy"
dim intNum as Integer

intNum = instr(strChar, "y")

'intNum = 2
This is why I like vb so much because I don't need to write 4 or 5 lines of code to do things like this. Why re-invent the wheel.....
__________________
~Ryan

rdove is offline   Reply With Quote