locked
Another difficulty with source codes RRS feed

  • Question

  • Greetings to the community!

    And complements of the Easter season!!

    I have two, 2 problems, and hope that someone out there can get me past them

    One is specific and the other, general

    I migrated from q-basic, to v-basic, with minimum difficulties

    I can understand that these are both desktop programs.

    But the migration to basic.net has become a pain

    I have not written any program that works!!!

    Please can someone try to explain the thought pattern that is unique to basic.net, which I still have not picked up?

    Ron Symonds had corrected a script for me previously, and I thought I could pick up from there, but no.

    I need the attached script corrected too.

    Could someone please detect the errors for me?

    This is the error message, from a preview on browser:

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.  Compiler Error Message: BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types. Source Error:

    Line 4:  <script runat="server">

    Line 5:    

    Line 6:  Public Sub Commandf0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Commandf0.Click

    Line 7:       Dim i As Integer = 3

    Line 8:       Dim f0Score As Double

    This is the code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Page Language="VB" %>

    <script runat="server">
       
    Public Sub Commandf0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Commandf0.Click
         Dim i As Integer = 3
         Dim f0Score As Double
         Dim SnScore5 As Double
         Dim SnScore(1 to i) As Double
         Dim dblRb(1 to i) As Double
         Dim dblRx(1 to i) As Double
    For index = 1 To i
    If IsNumeric(ObsRank.Text) Then
    dblRb(i) = CDbl(ObsRank.Text)
    End If
    If IsNumeric(ExpRank.Text) Then
    dblRx(i) = CDbl(ExpRank.Text)
    End If
    Next index
    Dim dblA As Double = 0
    Dim dblG As Double = 0
    Dim dblX As Double = 0
    Dim dblD As Double = 0
    For index = 1 to i '0 To 3
    dblA = 5 - dblRb(index)
    dblG = 5 - dblRx(index)
    If dblG <= dblA Then
    dblX = dblG
    Else
    dblX = dblA
    End If
    dblD = Math.Abs(dblRb(index) - dblRx(index))
    SnScore(index) = dblX - dblD
    SnScore5 = SnScore5 + SnScore(index)
    lblSnScore.Text = Format(SnScore(index), "0.00")
    Next index
    f0Score = SnScore5 / 10
    Labelf0.Text = "f0-Score = " & f0Score
     End Sub

    </script>


    <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>f0Score Demonstration</title>
    <link href="../Demo%20f0Score/StyleSheet%20f0Score.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    .auto-style1 {
    margin-bottom: 2px;
    margin-
    }
    label {
    font-family: "Times New Roman";
    font-size: medium;
    font-weight: bold;
    font-style: normal;
    color: #000000;
    background-color: #CC3300;
    }
    .auto-style2 {
    color: #FFFFFF;
    }
    .auto-style3 {
    border: thin inset #CC3300;
    margin-
    right: 0%;
    width: 75%;

    }
    #left-nav  {
    width: 180px;
    float: left;
    background-color: #000000;
    padding: 20px;
    }
    .newStyle1 {
    float: right;
    }
    .auto-style4 {
    margin-
    }
    </style>
    </head>

    <body>

    <div id="container" class="auto-style3" style="height: 464px">
    <div id="left-nav" class="auto-style4">
    <img alt="Avatar" height="55" longdesc="../../../Recommendations/Pdfs/Agape Consultants on Religion.pdf" src="../Demo%20f0Score/Avatar.jpg" width="138" /> #000000; padding: 20px

    <img alt="Thinking Man" height="266" longdesc="../../../Recommendations/Pdfs/ Thought Systems.pdf" src="../Demo%20f0Score/Thinking%20Man.jpg" width="203" /></div>

    <div id="main-content">

    <form class="auto-style1" method="post" style="height: 412px; width: 729px;margin->
    <fieldset name="Group1" style="height: 455px; width: 350px; border: none" 
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;



            <label for="ObservedRank" class="auto-style2">Observed Rank </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <label for="ExpectedRank" class="auto-style2">Expected Rank </label>&nbsp;&nbsp;&nbsp;&nbsp;
    <label for="SnScore" class="auto-style2">Sn Score </label>
            
            <p>&nbsp;</p>
            
    <p>&nbsp;
    <label for="Number" class="auto-style2">1</label>

    &nbsp;&nbsp;&nbsp;&nbsp;
    <input name="ObservedRank(i)" type="text" size="6" tabindex="1" />&nbsp;&nbsp;
                                                          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input name="ExpectedRank(i)" type="text" size="6" tabindex="2" />&nbsp;&nbsp;&nbsp;
                                                                               
    <label for="SnScore(i)" class="auto-style2">SnScore1 </label></p>

            <p>&nbsp;        
            <label for="Number" class="auto-style2">2</label>

    &nbsp;&nbsp;&nbsp;&nbsp;
            <input name="ObservedRank(i)" type="text" size="6" tabindex="3" />&nbsp;&nbsp;
                                                          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input name="ExpectedRank(i)" type="text" size="6" tabindex="4" />&nbsp;&nbsp;&nbsp;

            <label for="SnScore(i)" class="auto-style2">SnScore2 </label></p>
            
            <p>&nbsp;
            <label for="Number" class="auto-style2">3</label>

    &nbsp;&nbsp;&nbsp;&nbsp;
            <input name="ObservedRank(i)" type="text" size="6" tabindex="5" />&nbsp;&nbsp;
                                                          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input name="ExpectedRank(i)" type="text" size="6" tabindex="6" />&nbsp;&nbsp;&nbsp;

            <label for="SnScore(i)" class="auto-style2">SnScore3 </label></p>
            
            &nbsp;
            <label for="Number" class="auto-style2">4</label>

    &nbsp;&nbsp;&nbsp;&nbsp;
            
            <input name="ObservedRank(i)" type="text" size="6" tabindex="7" />&nbsp;&nbsp;
                                                          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input name="ExpectedRank(i)" type="text" size="6" tabindex="8" />&nbsp;&nbsp;&nbsp;

            <label for="SnScore(i)" class="auto-style2">SnScore4 </label>
            
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
    <img alt="Working Hands" height="130" longdesc="../../../Recommendations/Pdfs/Agape Consultants, Business Continuity via HpRQ Optimisation and Sustained Growth, Tracked with a minimum of Metrics.pdf" src="../Demo%20f0Score/Working%20Hands.jpg" width="103" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <p>&nbsp;<label for="f0Score" class="auto-style2">f0 Score&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/></label></p>
            
    <p>&nbsp;


    <input name="Commandf0" style="width: 112px" type="button" value="Calculate" />&nbsp;&nbsp;&nbsp;

    <input name="Button1" style="width: 80px" type="button" value="Exit" />&nbsp;<br/></p>

    <br/>
    </fieldset></form>


    </div> 
    </div>  
    <br />


    </body>


    </html>

    This is the Equation I have coded:

                   Sn = X – D

                        D = Abs |E – B|

                        X = G: G  A

                        X = A Otherwise

                            G = 5 – E

                            A = 5 – B

    Sn = Score on the Item-n (n = 1 to 4)

    D = Observed Deviance

    X = Expected Deviance

    E = Expected Rank on Item-n

    B = Observed Rank on Item-n    

    I shall appreciate greatly

    Ngbachi

    Friday, April 4, 2014 7:24 AM

Answers

  • Thanks Bill

    I appreciate

    • Marked as answer by Ngbachi Wednesday, July 2, 2014 5:55 AM
    Wednesday, July 2, 2014 5:55 AM

All replies

  • The script fails because you do not have a .NET control with ID Commandf0 anywhere on the page. In fact, there are no .Net controls on the page, so why the asp.NET script?

    Also, all .NET controls should be contained within an asp.NET form, which is missing.

    <body>
    <form id="form1" runat="server">

    rest of page

    </form>
    </body>

    There can only be one form on the page.

    See the asp.NET tutorials at www.w3schools.com


    Ron Symonds
    http://www.rxs-enterprises.org/fp/wf-menu.aspx


    Ron Symonds www.rxs-enterprises.org/fp/wf-menu.aspx
    Friday, April 4, 2014 9:24 AM
  • Ron,

    Please accept my appreciation for a second bailout

    But you need to be patient with this green horn!

    From your two, 2 responses, I have gathered that the following four, 4 concepts are unique for .net:

    3. The Frontend or Form

    2. The Syntax

    1. The Layout

    4. The Script

    I think I am becoming comfortable with 1 and 3

    But 2 and 4 are still some trouble

    I got this frontend working

    But the script is still stock

    Please, what have I done wrong this time?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <%@ Page Language="VB" %>

    <script runat="server">

      

    Public Sub Commandf0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Commandf0.Click

         Dim SnScore(3) As Double

         Dim i As Integer = 3

         Dim dblRb(3) As Double

         Dim dblRx(3) As Double

         Dim f0Score As Double

         Dim SnScore5 As Double

         Dim ObsRank As Object

         Dim ExpRank As Object

         Dim lblSnScore As Object

         Dim Lblf0Score As Object

                     For i = 0 To 3

                                     If i = 0 & IsNumeric(ObsRank.Text) Then

                                                            dblRb(i) = CDbl(ObsRank.Text)

                        

                                     ElseIf i = 1 & IsNumeric(ObsRank1.Text) Then

                                                            dblRb(i) = CDbl(ObsRank1.Text)

                        

                                     ElseIf i = 2 & IsNumeric(ObsRank2.Text) Then

                                                            dblRb(i) = CDbl(ObsRank2.Text)

                        

                                     ElseIf i = 3 & IsNumeric(ObsRank3.Text) Then

                                                            dblRb(i) = CDbl(ObsRank3.Text)                                                                                                                 

                                     End If

                                     If i = 0 & IsNumeric(ExpRank.Text) Then

                                                     dblRx(i) = CDbl(ExpRank.Text)

                        

                                     ElseIf i = 1 & IsNumeric(ExpRank1.Text) Then

                                                            dblRb(i) = CDbl(ExpRank1.Text)

                        

                                     ElseIf i = 2 & IsNumeric(ExpRank2.Text) Then

                                                            dblRb(i) = CDbl(ExpRank2.Text)

                        

                                     ElseIf i = 3 & IsNumeric(ExpRank3.Text) Then

                                                            dblRb(i) = CDbl(ExpRank3.Text)                                                                                                                                             

                                     End If

                     Next i

                     Dim dblA As Double = 0

                     Dim dblG As Double = 0

                     Dim dblX As Double = 0

                     Dim dblD As Double = 0

                     For i = 0 To 3

                                     dblA = 5 - dblRb(i)

                                     dblG = 5 - dblRx(i)

                                     If dblG <= dblA Then

                                                     dblX = dblG

                                     Else

                                                     dblX = dblA

                                     End If

                                     dblD = Math.Abs(dblRb(i) - dblRx(i))

                                     SnScore(i) = dblX - dblD

                                     SnScore5 = SnScore5 + SnScore(i)

                                     lblSnScore.Text = Format(SnScore(i), "0.00")

                     Next i

                     f0Score = SnScore5 / 10

                     Lblf0Score.Text = "f0-Score = " & f0Score

     End Sub

    </script>

    <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

    <title>f0Score Demonstration</title>

    <link href="../Demo%20f0Score/StyleSheet%20f0Score.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

    .auto-style1 {

                    margin-bottom: 2px;

                    margin-

    }

    label {

                    font-family: "Times New Roman";

                    font-size: medium;

                    font-weight: bold;

                    font-style: normal;

                    color: #000000;

                    background-color: #CC3300;

    }

    .auto-style2 {

                    color: #FFFFFF;

    }

    .auto-style3 {

                    border: thin inset #CC3300;

                    margin-

                    right: 0%;

                    width: 75%;

                   

    }

    #left-nav  {

                    width: 180px;

                    float: left;

                    background-color: #000000;

                    padding: 20px;

    }

    .newStyle1 {

                    float: right;

    }

    .auto-style4 {

                    margin-

    }

    </style>

    </head>

    <body>

    <div id="container" style="height: 464px">

                    <div id="left-nav">

                    <img alt="Avatar" height="55" longdesc="../../../Recommendations/Pdfs/Agape Consultants on Religion.pdf" src="../Demo%20f0Score/Avatar.jpg" width="138" /> #000000; padding: 20px

                    <img alt="Thinking Man" height="266" longdesc="../../../Recommendations/Pdfs/                              Thought Systems.pdf" src="../Demo%20f0Score/Thinking%20Man.jpg" width="203" /></div>

                   

    <div id="main-content">

                    <form id="form1" runat="server" method="post" style="height: 412px; width: 729px;margin->

                                    <fieldset name="Group1" style="height: 455px; width: 350px; border: none" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

            <label for="ObservedRank">Observed Rank </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    <label for="ExpectedRank">Expected Rank </label>&nbsp;&nbsp;&nbsp;&nbsp;

                                    <label for="SnScore">Sn Score </label><p>&nbsp;</p>

                                    <p>&nbsp;                           

                                    <label for="Number">1</label>&nbsp;&nbsp;&nbsp;&nbsp;

                                    <asp:TextBox ID="ObsRank" runat="server" size="6" tabindex="1"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    <asp:TextBox ID="ExpRank" runat="server" size="6" tabindex="2"></asp:TextBox>&nbsp;&nbsp;&nbsp;

                                    <label for="SnScore(i)">SnScore1 </label></p>

                                    <p>&nbsp;                                   

            <label for="Number">2</label>&nbsp;&nbsp;&nbsp;&nbsp;

                                    <asp:TextBox ID="ObsRank1" runat="server" size="6" tabindex="3"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

            <asp:TextBox ID="ExpRank1" runat="server" size="6" tabindex="4"></asp:TextBox>&nbsp;&nbsp;&nbsp;

                                    <label for="SnScore(i)">SnScore2 </label></p>

            <p>&nbsp;

            <label for="Number">3</label>&nbsp;&nbsp;&nbsp;&nbsp;

                                    <asp:TextBox ID="ObsRank2" runat="server" size="6" tabindex="5"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

            <asp:TextBox ID="ExpRank2" runat="server" size="6" tabindex="6"></asp:TextBox>&nbsp;&nbsp;&nbsp;

                                    <label for="SnScore(i)">SnScore3 </label></p>&nbsp;

            <label for="Number">4</label>&nbsp;&nbsp;&nbsp;&nbsp;

                                    <asp:TextBox ID="ObsRank3" runat="server" size="6" tabindex="7"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

            <asp:TextBox ID="ExpRank3" runat="server" size="6" tabindex="8"></asp:TextBox>&nbsp;&nbsp;&nbsp;

                                    <label for="SnScore(i)">SnScore4 </label>

            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>

                                    <img alt="Working Hands" height="130" longdesc="../../../Recommendations/Pdfs/Agape Consultants, Business Continuity via HpRQ Optimisation and Sustained Growth, Tracked with a minimum of Metrics.pdf" src="../Demo%20f0Score/Working%20Hands.jpg" width="103" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    <br /><br />

                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    <label for="f0Score">f0 Score</label>

            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

             <asp:TextBox ID="lblf0Score" runat="server"></asp:TextBox>

            

                                    <asp:Button ID="Commandf0" runat="server" style="width: 112px" Text="Calculate"></asp:Button>&nbsp;&nbsp;&nbsp;

                                    <asp:Button ID="Button1" runat="server" style="width: 80px" Text="Exit"></asp:Button>&nbsp;<br/></p>

            <br/>

                                    </fieldset></form>

    </div>

    </div> 

                    <br />

    </body>

    </html>

    Ngbachi

    Saturday, April 5, 2014 12:02 AM
  • Most of the problems with the page are HTML problems - NOT asp.NET or scripting errors.
    As for the scripting errors - go through the tutorials at w3schools.com.
     See http://www.rxs-enterprises.org/tests/pages/f0score/default.aspx for a list of errors and corrections.


    Ron Symonds www.rxs-enterprises.org/fp/wf-menu.aspx
    Sunday, April 6, 2014 7:51 AM
  • Ron,

    My avatar

    Thank you so very much for getting me started

    I sincerely appreciate a million

    I am working to upload the demos now

    But have problems with hosting support for aspx files

    Currently hosted on ipage

    Any suggestions?

    Best regards

    Ngbachi

    Tuesday, July 1, 2014 4:28 AM
  • For asp.net, you need Windows servers. I see nothing on ipage that indicates that they offer Windows server hosting. They're just a bare-bones cheap host, like many others on the web. You've probably got a shared Linux server, which won't run asp.net.


    A horse walks into a bar. The bartender asks "Why the long face?" "Because I was born into servitude and when I die my hooves will be used to make glue." It was at this point that the bartender realized he would not be getting a tip.

    Tuesday, July 1, 2014 12:35 PM
  • Bill,

    But that is precisely what the problem is. How do I identify a host with Windows servers? Or do green horns not deserve to turn brown, because the bartender realizes he would not be getting a tip?

    I wish you had suggest a host

    I am still looking to that

    I shall appreciate a million

    Ngbachi

    Tuesday, July 1, 2014 5:04 PM
  • Look at any big hosting company's website. They'll tell you what they offer and the prices.

    I assume your host doesn't offer Windows servers, but that's just because I didn't see any mention of any type of server on their site (so I assume there's only one kind offered, and the most common is Linux). Ask them.

    I can't suggest a host because:

    A. I don't know what you really need besides Windows server for what you plan to do.

    B. I don't even know where you live. Although you can host with anyone, it makes sense to work with someone in your own country or at least your own time zone. And international companies have very different reputations in different regions. One may be good in the US, but bad in Europe (as I know one has been).

    C. I don't know where or when you bought your domain and if there will be a delay in transferring.

    D. This is your responsibility--you have to do the research yourself, as we all did.

    I could suggest any number of hosts, but they might all be wrong for you.


    A horse walks into a bar. The bartender asks "Why the long face?" "Because I was born into servitude and when I die my hooves will be used to make glue." It was at this point that the bartender realized he would not be getting a tip.

    Wednesday, July 2, 2014 1:54 AM
  • Thanks Bill

    I appreciate

    • Marked as answer by Ngbachi Wednesday, July 2, 2014 5:55 AM
    Wednesday, July 2, 2014 5:55 AM