Advertisement

07.21.2008 at 04:22PM PDT, ID: 23583739
[x]
Attachment Details

Problem with function return datatype

Asked by deNZity in .NET, Programming for ASP.NET, Microsoft Visual Basic.Net

Tags: microsoft, vb.net, as.net2, 2005

Hi, I have this function that basically assigns a different value if the input value is a specific value.



 this function works and assigns the correct value

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
Public Function Convert_barcode(ByVal s2 As String) As String
        Dim bcode As Integer
        If (s2.Length > 0) Then
            If s2.ToUpper Like "CA" Then
                bcode = -10
                Response.Write(bcode)
            End If
            If s2.ToUpper Like "PU" Then
                bcode = -15
                Response.Write(bcode)
            End If
            If Not ((s2.ToUpper Like "CA") Or (s2.ToUpper Like "PU")) Then
                bcode = CInt(s2)
            End If
        End If
        Return "bcode"
    End Function
 
"when returned to the calling sub procedure the bcode value is empty"
 
 
Protected Sub txtBarcode0_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtBarcode0.TextChanged
        Convert_barcode(txtBarcode0.Text)
        txtBarcode0.Text = CStr(CInt(Session("bcode")))
        If (txtBarcode0.Text) = "-10" Then
            Exit Sub
        End If
        If (txtBarcode0.Text) = "-15" Then
            Exit Sub
        End If
        check_availability(txtBarcode0.Text)
        If CInt(Session("rtrnvalue")) = 0 Then
            lblbcodeerror.Visible = True
            txtBarcode0.Text = ""
        End If
    End Sub
[+][-]07.21.2008 at 04:45PM PDT, ID: 22055421

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 05:23PM PDT, ID: 22055583

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 05:25PM PDT, ID: 22055590

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 05:30PM PDT, ID: 22055607

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 05:32PM PDT, ID: 22055616

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 05:35PM PDT, ID: 22055632

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, Programming for ASP.NET, Microsoft Visual Basic.Net
Tags: microsoft, vb.net, as.net2, 2005
Sign Up Now!
Solution Provided By: MijaeDjinn
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628