Re: Max/Min Functions
- From: "Greg Maxey" <gmaxey@xxxxxxxxxxxxxxxxxxx>
- Date: Sun, 4 Dec 2005 00:12:22 -0500
Ok, got that. Thanks
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
Jezebel wrote:
> It's not the redim vs. array that affects the risk, but using an
> array of variants where you really want an array of numbers
>
> Dim myArray() as double
>
>>
> redim myArray(1 to 3)
> myArray(1) = 1
> myArray(2) = 99.99
> myArray(3) = -34.3
>
>>
> pMax = MaxOfArray(myArray)
>
> -------
>
> Function MaxOfArray(vArray() as double) as double
>
>>
>
>
>
>
>
>
>
>
> "Greg Maxey" <gmaxey@xxxxxxxxxxxxxxxxxxx> wrote in message
> news:%236Zv$dH%23FHA.2320@xxxxxxxxxxxxxxxxxxxxxxx
>> Jezebel,
>>
>> OK, I understand that. Would you this one time just give this
>> village idiot the fish? Can you show me using my example how you
>> would change it using the Redim method to make it less risky. Thank
>> you ever so much. --
>> Greg Maxey/Word MVP
>> See:
>> http://gregmaxey.mvps.org/word_tips.htm
>> For some helpful tips using Word.
>>
>> Jezebel wrote:
>>>> I didn't use a Redim() statement. So is myArray = Array(1, 99.99,
>>>> -34.3, 50)
>>>> the same as Redim?
>>>
>>> Yes. What you've now got is an array of variants. You code works in
>>> the example you give, but it's risky because a variant array can
>>> contain *anything* -- while your MaxOfArray function assumes that
>>> the array
>>> elements can be evaluated numerically.
>>>
>>> MyArray = Array(1, ThisDocument, "XXX")
>>>
>>> etc
.
- References:
- Max/Min Functions
- From: Greg Maxey
- Re: Max/Min Functions
- From: Jonathan West
- Re: Max/Min Functions
- From: Greg Maxey
- Re: Max/Min Functions
- From: Jezebel
- Re: Max/Min Functions
- From: Greg Maxey
- Re: Max/Min Functions
- From: Jezebel
- Re: Max/Min Functions
- From: Greg Maxey
- Re: Max/Min Functions
- From: Jezebel
- Max/Min Functions
- Prev by Date: Re: Max/Min Functions
- Next by Date: Re: delete contents between repeted words
- Previous by thread: Re: Max/Min Functions
- Next by thread: Re: Max/Min Functions
- Index(es):
Relevant Pages
|