Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Visual Basic Assignment. Need help!

Posted on 2013-11-22
6
Medium Priority
?
763 Views
Last Modified: 2013-11-22
Instruction : Woody Real Estate HW5
Outcome : Must be same with HW5 0101-Hellow_World
Visual Basic File : HW5-0101-Jong-Lee

Hi I totally get lost from #11 to #13 (Instruction)
Could you please write down codes for me?
I really need your help as soon as possible!

Thank you!

--From number 11

    Private Funtion SearchFrom(ByVal startIndex As integer,
                    Byval bedroom as Integer,
                    ByVal bathroom As Integer,
                    ByVal proptate As String) As Integer

    Private Sub searchButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles searchButton.Click

    End Sub

    Private Sub searchNextButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles searchNextButton.Click

    End Sub
End Class
Woody-Real-Estate-HW5.docx
HW5-0201-Jong-Lee.vbproj
0
Comment
Question by:John_Lef
  • 3
  • 2
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 39668745
Try to do your own homework and come back with exact questions. If we do it all for you, you will never learn!
0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 2000 total points
ID: 39668819
The instructions are pretty good...what's the problem?

Did you add the function to your code?

Basically you just need to iterate over the arrays until you find a match, or return -1 if no match is found.

If you don't know how to write a For loop, look here or here.

Or you could just use this code instead:
    Private Function SearchFrom(ByVal startIndex As Integer, _
                    ByVal bedroom As Integer, _
                    ByVal bathroom As Integer, _
                    ByVal proptate As String) As Integer

        MessageBox.Show("You can't afford a House!")
        Return -1

    End Function

Open in new window

0
 

Author Comment

by:John_Lef
ID: 39668849
Can you please show me one example?
I know only basic For Loop, so i dont know how to apply it here
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 2000 total points
ID: 39668878
I did give you an example, TWO of them in fact.  Follow the links..,

The first link just shows how to write a generic For loop.
The second link, in Example 2, actually has a For loop that accesses an Array called "rabbits".
0
 

Author Comment

by:John_Lef
ID: 39668953
Oh okay i got it!
I have a final question for #12

    Private Sub searchButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles searchButton.Click
        Dim bedroomSearch As Integer = CInt(bedroomComboBox.SelectedItem)
        Dim bathroomSearch As Integer = CInt(bathroomComboBox.SelectedItem)
        Dim stateSearch As String = CStr(stateComboBox.SelectedItem)
        Dim searchResult As Integer

        searchResult = SearchFrom(0, bedroomSearch, bathroomSearch, stateSearch)

        If searchResult = -1 Then
            MessageBox.Show("Not found!")
        End If
    End Sub

Is there any other way to do #12? I wonder if there is easiler way to do this.
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 39669014
Doesn't get much simpler than that.

If -1 is NOT returned, though, then you should probably display the search result somewhere!  ;)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

972 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