Results 1 to 4 of 4

Thread: filling an array with a function

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    81

    filling an array with a function

    im making a function that should fill in an array of string
    ive declared it as such:
    Code:
    function func (byref reminders() as string)
    and i used it like this:
    Code:
    dim rem() as string
    func(rem)
    but the compiler says:
    "type mismatch: array or user defined type expected"
    what am i doing wrong here?

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Try either...

    Call func(rem)

    or

    func rem


    And see if it works.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    81
    thanks, calling it :
    func rem
    did the job, but now i got another problem with this function...
    the line
    reminders(0)="text"
    causes it to say subscription out of range...
    any ideas?

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    You are passing in an uninitialized array. You need to ReDim it to have at least one element in order to use it.
    VB Code:
    1. ReDim reminders(1 to 10)
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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