Solved

Function reader

Posted on 2008-10-15
11
219 Views
Last Modified: 2010-04-23
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.
0
Comment
Question by:sevensnake77
  • 7
  • 3
11 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 22722618
read from where

text file
database
regisistry
thin air
crystal ball?
0
 
LVL 2

Expert Comment

by:gwosgood
ID: 22722693
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
 
LVL 9

Author Comment

by:sevensnake77
ID: 22722712
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 & " " & k & " "
''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 & " " & k & " "

''dynamic

Response.write(strNameFull)

Open in new window

0
 
LVL 9

Author Comment

by:sevensnake77
ID: 22722933
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
 
LVL 9

Author Comment

by:sevensnake77
ID: 22723104
do you guys have a better understanding of what I need?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 9

Author Comment

by:sevensnake77
ID: 22724177
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
 
LVL 2

Accepted Solution

by:
gwosgood earned 500 total points
ID: 22724214
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
 
LVL 9

Author Comment

by:sevensnake77
ID: 22724413
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
 
LVL 9

Author Comment

by:sevensnake77
ID: 22724504
And I want to get N from exData(rowCt, 5)
0
 
LVL 2

Expert Comment

by:gwosgood
ID: 22724819
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
 
LVL 9

Author Comment

by:sevensnake77
ID: 22725027
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending E-mail ASP.Net 3 55
VB.Net How to Exit Sub - Exit Form??? 5 47
scanning dentists xray (the small ones) 3 41
Vb. Net application freezes 9 27
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now