Function reader

I need to create  a function in vb to read B1G1 ** or if it is B2G1 how would I get started. right now I have it hard coded.
LVL 9
Seven priceFull StackAsked:
Who is Participating?
 
gwosgoodIT MgrCommented:
How about just a simple if test for N?

If N < 4 then
strNameFull = F & N & U & N & " " & S
end if

Its not as high-level as the solution you proposed, but its straightforward.


0
 
crazymanCommented:
read from where

text file
database
regisistry
thin air
crystal ball?
0
 
gwosgoodIT MgrCommented:
please provide more exacting details, your question is very broad.  Are you simply looking for a function that takes a string parameter and acts differently based on the variable passed to it?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Seven priceFull StackAuthor Commented:
LOL it was to early in the morning.

But what I am trying to do is where dim y as string,  I want to read a selected number,
for instance if b1g2 I would like this to select the 1 and the 2.

 Dim strNameFull As String = "B1G1 **"  ''hardcode

Dim strNameFull As String = S & y & T & y & "&nbsp;" & k & "&nbsp;"
''dynamic




Dim S As String = "B"
    Dim T As String = "G"
    Dim y As String = "[1-5]"
    Dim k As String = "**"
    Dim strNameFull As String = "B1G1 **"  ''hardcode
 
Dim strNameFull As String = S & y & T & y & "&nbsp;" & k & "&nbsp;"
''dynamic
Response.write(strNameFull)

Open in new window

0
 
Seven priceFull StackAuthor Commented:
I tried something like this but I get an error

If Not (exData(rowCt, 5) Like "[!A-Za-Z]*") Or "*[!0-9]*" Or "**" Then
0
 
Seven priceFull StackAuthor Commented:
do you guys have a better understanding of what I need?
0
 
Seven priceFull StackAuthor Commented:
Ok just answer this and I will give credit were credit is due.
How can I make Dim N more dynamic. so in the reader 1 can be 2 or 3

 Dim F As String = "B"
                Dim N As Integer = "1"
                Dim U As String = "G"
                Dim S As String = "**"
                Dim strNameFull As String = (F & N & U & N & " " & S)
0
 
Seven priceFull StackAuthor Commented:
Well I have a reader that is reading from excel sheet. I have certain columns that read
B1G1 or B2G1, so I want to read the numeric number and pass it as a value as you see above Dim N is hard coded, but I want to read it as if 1 is not there but if 2 is the that is the value of N
0
 
Seven priceFull StackAuthor Commented:
And I want to get N from exData(rowCt, 5)
0
 
gwosgoodIT MgrCommented:
Im sorry, I dont think I can offer you the solution you are looking for.  I am not familiar enough with Excel-VB compatibility to troubleshoot with you.
0
 
Seven priceFull StackAuthor Commented:
Well I am not worried about the excel I just want a way to read the numeric number  if its 1 or 2 but no matter thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.