Re: Using MINLOC(array)



Clive Page <junk@xxxxxxxxxxxx> wrote:

scalar = firstarray(MINLOC(secondarray))
....
This compiled and ran successfully. I then thought that I had made a
mistake by failing to use DIM=1, without which MINLOC returns a vector
(of length one). Then I thought about it more carefully and realised
that it was ok, as I was accessing firstarray with a vector subscript
(of length one) which is valid.

Hmm. That part is valid, but then firstarray(vector_subscript) should
likewise be an array, so you have

scalar = array

which isn't ok. Unless I've got something confused, which could happen.
But I'm guessing that maybe you had a compiler than let you get by with
the nonstandard scalar=array.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: Library Design, f0dders nightmare.
    ... first demo mistake but I suggest to you that a sequence of blunders ... The stack is only used temporarily while creating the argv array. ... in the input buffer. ... so you are not wasting memory. ...
    (alt.lang.asm)
  • Re: Poll: SizeOf(variable) vs SizeOf(type), should SizeOf(variable)be banned ?
    ... If the variable version is banned then you can't make that programming mistake. ... OK, so when I try to pass the variable to SizeOf, the compiler will complain and I'll know to fix something. ... But now I decide I should have a dynamic array instead of a static array. ...
    (alt.comp.lang.borland-delphi)
  • Re: allocate memory for pointer
    ... As I mentioned I thought passed-by-pointer is ... Now I know I made a mistake. ... But what I used is the pointer to an array. ...
    (comp.lang.cpp)
  • Re: "Annoyance" with MINLOC,MINVAL, etc.
    ... Dick Hendrickson wrote: ... rank-1 array, these return a rank-0 array which is not the same than a ... minloc and minval are very different. ... the result is an array of rank one; ...
    (comp.lang.fortran)
  • Re: So you want APPROACHABLE oo, REAL oo, INTEGER oo, COUNTABLE oo, HIGHER oo, MEGA oos
    ... "The Ghost In The Machine" wrote ... >> A mistake that was MY MISTAKE when taken IN CONTEXT. ... nobody ever mentioned 'equals'. ... We agree Barb should find one of my particular usages of the array to call an error ...
    (sci.logic)