Results 1 to 8 of 8

Thread: passing string in method *solved*

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2004
    Posts
    18

    passing string in method *solved*

    guys, i dont know the title is correct or not, but this is my case.
    i have declared a string a and retrieve a data from database to it.say
    a = blue

    then i want to invoke a method, say function(string a)
    and i put function(a)
    it reads a as the input to the function, but i want the value to be blue. what can i do?
    thanks.
    Last edited by Daven81; Sep 4th, 2004 at 05:39 AM.

  2. #2
    Hyperactive Member Mosabama's Avatar
    Join Date
    Aug 2004
    Location
    Mars
    Posts
    306
    I am not Sure that I got it ..

    function hello( a as string)
    msgbox(a)
    end function

    to call the function:

    'get the value from database then
    value = value from database
    call hello(value)
    ???
    is this what you want?
    My software never has bugs. It just develops random features.
    I RATE, YOU RATE!!!

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2004
    Posts
    18

    Re: passing string in method

    yeah that's it, but when i get the data from the database i have to declare a string to store the value.

    something like:
    dim a as string
    a = rs.fields!name

    then i put :
    function (a)

    and it doesnt pass the value from my database to the function, instead it passes a to it..

  4. #4
    Hyperactive Member Mosabama's Avatar
    Join Date
    Aug 2004
    Location
    Mars
    Posts
    306
    Do you mean that in passes ( a ) as a string??

    I mean when you use msgbox(a) .. the result will be "a"??
    I dont understand ???!!!
    My software never has bugs. It just develops random features.
    I RATE, YOU RATE!!!

  5. #5
    Hyperactive Member Mosabama's Avatar
    Join Date
    Aug 2004
    Location
    Mars
    Posts
    306
    can you send the code please?
    My software never has bugs. It just develops random features.
    I RATE, YOU RATE!!!

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Sep 2004
    Posts
    18
    oh i realise the mistake i did...thanks for all your help!

  7. #7
    Hyperactive Member Mosabama's Avatar
    Join Date
    Aug 2004
    Location
    Mars
    Posts
    306
    What was the mistake? let us get some Xperience ...
    My software never has bugs. It just develops random features.
    I RATE, YOU RATE!!!

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Sep 2004
    Posts
    18
    Originally posted by Daven81
    oh i realise the mistake i did...thanks for all your help!
    ahha the file was missing ok...i mean the database retrieve a path for a file. thats why...ok thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width