I just started programming about 1 week ago. i would appreciate if anyone can tell me how to code a function in VB6 that returns a values depending on the string.
For example, if the parameter passed is a string containing the value #yyyy#, i want the function to return the year, eg 2008. And if the value of the parameter is #yyyy##mm# the function should return eg 200810. which is the year and month and so on. Can anyone suggest how am i going to do this?
I know I have to use something like:
Public Function ReadKeyword(ByVal keyword As String) As String If keyword = "#yyyy#" Then sYear = Year(Now) End If End Function
However, it differs. Because if the keyword is #yyyy##mm##dd# it should return eg 20081020 but i also need it to return accordingly if the keyword is #yyyy##dd##mm# it should return eg. 20082010.
Any suggestions? Thanks

New Topic/Question
Reply




MultiQuote





|