Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. too many arguments on Boolean funtion

too many arguments on Boolean funtion

Scheduled Pinned Locked Moved ASP.NET
questiondatabasehelplounge
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LovelyHelp
    wrote on last edited by
    #1

    I am trying to create my exam paper which question will random display... I got an run time error " Too many arguments to 'Private Function checkNumber(intQNbr As Integer) As Boolean'." what to solve? -----------------------------------------------------------------------:(( 'create random exam question, generate from database Private Sub makeExam() Dim intQueNumber As Integer Dim intCount As Integer Dim bolfound As Boolean 'seed for random number Randomize(Timer) 'loop to generate 10 question Do While mintActCount <= 9 intQueNumber = CInt(Int((10 * Rnd()) + 1)) bolfound = False Call checkNumber(intQueNumber, bolfound) If Not bolfound Then Call writeQuestion(intQueNumber) End If Loop Dim prapara As LiteralControl = New LiteralControl("

    ") plhPlaceHolder.Controls.Add(prapara) 'generate and add a button to submit exam Dim bttnExamSubmit As New Button() bttnExamSubmit.Text = "Grade Exam" bttnExamSubmit.ToolTip = "Submit Exam" bttnExamSubmit.ID = "bttnExamSubmit" plhPlaceHolder.Controls.Add(bttnExamSubmit) End Sub Private Function checkNumber(ByVal intQNbr As Integer) As Boolean 'check wehther question arlady included Dim intCount As Integer 'Dim intCheck As Integer For intCount = 0 To mintActCount - 1 If mintComplete(intCount) = intQNbr Then 'if request found, function return true Return True Exit For End If Next End Function

    A H 2 Replies Last reply
    0
    • L LovelyHelp

      I am trying to create my exam paper which question will random display... I got an run time error " Too many arguments to 'Private Function checkNumber(intQNbr As Integer) As Boolean'." what to solve? -----------------------------------------------------------------------:(( 'create random exam question, generate from database Private Sub makeExam() Dim intQueNumber As Integer Dim intCount As Integer Dim bolfound As Boolean 'seed for random number Randomize(Timer) 'loop to generate 10 question Do While mintActCount <= 9 intQueNumber = CInt(Int((10 * Rnd()) + 1)) bolfound = False Call checkNumber(intQueNumber, bolfound) If Not bolfound Then Call writeQuestion(intQueNumber) End If Loop Dim prapara As LiteralControl = New LiteralControl("

      ") plhPlaceHolder.Controls.Add(prapara) 'generate and add a button to submit exam Dim bttnExamSubmit As New Button() bttnExamSubmit.Text = "Grade Exam" bttnExamSubmit.ToolTip = "Submit Exam" bttnExamSubmit.ID = "bttnExamSubmit" plhPlaceHolder.Controls.Add(bttnExamSubmit) End Sub Private Function checkNumber(ByVal intQNbr As Integer) As Boolean 'check wehther question arlady included Dim intCount As Integer 'Dim intCheck As Integer For intCount = 0 To mintActCount - 1 If mintComplete(intCount) = intQNbr Then 'if request found, function return true Return True Exit For End If Next End Function

      A Offline
      A Offline
      Anish Gopi
      wrote on last edited by
      #2

      Hai, The error is self explanatory Your function declaration contain only one argument Private Function checkNumber(ByVal intQNbr As Integer) As Boolean but you are trying to call this function with two arguments Call checkNumber(intQueNumber, **bolfound**) The call must be like this bolfound = checkNumber(intQueNumber)

      1 Reply Last reply
      0
      • L LovelyHelp

        I am trying to create my exam paper which question will random display... I got an run time error " Too many arguments to 'Private Function checkNumber(intQNbr As Integer) As Boolean'." what to solve? -----------------------------------------------------------------------:(( 'create random exam question, generate from database Private Sub makeExam() Dim intQueNumber As Integer Dim intCount As Integer Dim bolfound As Boolean 'seed for random number Randomize(Timer) 'loop to generate 10 question Do While mintActCount <= 9 intQueNumber = CInt(Int((10 * Rnd()) + 1)) bolfound = False Call checkNumber(intQueNumber, bolfound) If Not bolfound Then Call writeQuestion(intQueNumber) End If Loop Dim prapara As LiteralControl = New LiteralControl("

        ") plhPlaceHolder.Controls.Add(prapara) 'generate and add a button to submit exam Dim bttnExamSubmit As New Button() bttnExamSubmit.Text = "Grade Exam" bttnExamSubmit.ToolTip = "Submit Exam" bttnExamSubmit.ID = "bttnExamSubmit" plhPlaceHolder.Controls.Add(bttnExamSubmit) End Sub Private Function checkNumber(ByVal intQNbr As Integer) As Boolean 'check wehther question arlady included Dim intCount As Integer 'Dim intCheck As Integer For intCount = 0 To mintActCount - 1 If mintComplete(intCount) = intQNbr Then 'if request found, function return true Return True Exit For End If Next End Function

        H Offline
        H Offline
        HimaBindu Vejella
        wrote on last edited by
        #3

        Your function creation has only one argument Private Function checkNumber(ByVal intQNbr As Integer) As Boolean but you are calling this function with two arguments Call checkNumber(intQueNumber, bolfound) Then how can A complier understands ... Change the declaration as Private Function checkNumber(ByVal intQNbr As Integer,ByVal blnFlag as Boolean) As Boolean "Every morning I check Forbes 40 richest Indians list , if i'm not there I go to work."

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups