Can't do it!! Help!

Results 1 to 2 of 2

Thread: Can't do it!! Help!

  1. #1
    Stylianou Stelios Guest

    Default Can't do it!! Help!

    Basically Im trying to return a value of a function into a variable after calling the function. Ive always been a Java programmer and this is a little bit strange<BR> Java you use return "variable" to get the return value of a procedure and then by calling it you can store the value into a value = NameofFunction(Arguments)<BR> Can i do that with VBScript?? doesnt work..<BR><BR>moreover..problel 2...trying to count the number of records in a database with a given valuw<BR>i.e number of records with year 1977<BR>Is it possible to use an SQL query with Count(*) and instead of specifying the value that is going to match use it as variable that is going to be inserted as an argument from a procedure..<BR><BR>this is basically what im trying to do..but fails<BR><BR>Sub NameofFunction(YearIn)<BR>..<BR>sqltext= SELECT COUNT(*) FROM Table where year = (yearIn) <BR>...<BR>End Sub <BR> <BR>Doesnt work..and IM stuck

  2. #2
    Join Date
    Dec 1969

    Default RE: Can't do it!! Help!

    funny syntax stuff...<BR><BR>function yearin(inputs)<BR>&#039;do stuff<BR>yearin = output &#039;as opposed to return $output;<BR>end function<BR><BR>variable = yearin(stuff) &#039; now variable equals yearin&#039;s result<BR><BR>Sub NameofFunction(variable) <BR>.. <BR>sqltext= "SELECT COUNT(*) FROM Table where year = "<BR>sqltext= sqltext & variable <BR>&#039;dostuff<BR>End Sub <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts