Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Pamela Baker   on Mar 02 In MS Office Category.

  
Question Answered By: Perdita Lopez   on Mar 02

PMFJI & FWIW... If I understand what you are saying, I actually do
this fairly regularly though I don't think it's regarded as "kosher"
programing.

If I need to get a variable  out of a sub call and I don't want to use
a global, I include the variable in the call and update it. This
sometimes means I include a dummy variable in the call.

say I want a sub that "returns" an array from a string... which I have
done and know works. I call the sub so

subReturnArray slString,slArray

The sub splits the string with SPLIT say and then massages the result,
redims the given array slArray, fills it and closes down.

The array slArray is "passed back" to the calling  routine.

It's all to do with what Greg said but the default is ByVal which
should be what you want.

If you want some specific code  I can send you some.

Share: 

 

This Question has 10 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Fundamental Q: passing/returning variables Or get search suggestion and latest updates.