[AccessD] Brain Fart regarding arrays

Arthur Fuller fuller.artful at gmail.com
Sat Jan 7 22:49:30 CST 2023


Stuart,

Good catch on the Dijkstra name. It happens that earlier today I was
looking at the code from our book on MySQL that implements his algorithm in
MySQL. (www.artfulsoftware.com, if anyone's interested. Look for the Graph
headings.)

On Sat, Jan 7, 2023 at 11:40 PM Stuart McLachlan <stuart at lexacorp.com.pg>
wrote:

> The "int" prefix is a variant of Hungarian Notation adopted by MS .
> Originally developed by
> the Hungarian Chief Architect at Microsoft in the '80s. when he was at
> PARC in the '70s.
> It's fallen out of favour thee days, but I still use it all the time and
> find it very intuitive when
> maintaining old code :)
>
>
> Lots of the supposed origin for the use  of "i" and "j" for loopcounters.
> Among others:
> i-m as variables that default to integer in Fortran,
> i- for iterator
> i has a long history in mathematical notation of indices of summations etc.
>  i,j.k in in the name Dijkstra  :)
> ....
>
>
>
>
>
> On 7 Jan 2023 at 19:27, Rocky Smolin wrote:
>
> > Old guys quiz:
> >
> > I see you are using (like me) intI and intJ for counters in a For Next
> > loop.
> >
> > Who knows the etymology intI and intJ?
> >
> > r
> >
> > On Sat, Jan 7, 2023 at 6:40 PM jack drawbridge
> > <jackandpat.d at gmail.com> wrote:
> >
> > > Arthur,
> > >
> > > Here's a method that may satisfy your requirement. It's been a long
> > > time since I did multi-dimension anything. Hope it's helpful.
> > >
> > > '=====arthur fuller
> > >
> > >
> > > Sub Fill_2DArray()
> > >     Dim intI As Integer, intJ As Integer
> > >     Dim Arr1 As Variant, arr2 As Variant
> > >     Arr1 = Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
> > >     arr2 = Array(0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
> > >     Dim TwoD(0 To 1, 0 To 12) As Integer
> > >
> > >     ' Fill array with values.
> > >     For intI = 0 To 1
> > >         For intJ = 0 To 12
> > >             Select Case intI
> > >                 Case 0
> > >                     TwoD(intI, intJ) = Arr1(intJ)
> > >                 Case 1
> > >                     TwoD(intI, intJ) = arr2(intJ)
> > >             End Select
> > >             Debug.Print "TwoD(" & intI & " , " & intJ & ")  is " &
> > > TwoD(intI, intJ)
> > >         Next intJ
> > >         Debug.Print
> > >     Next intI
> > > End Sub
> > >
> > > On Sat, Jan 7, 2023 at 8:54 PM Arthur Fuller
> > > <fuller.artful at gmail.com> wrote:
> > >
> > > > I can't remember at the moment how to populate a 2D array. I know
> > > > what I want: 13 x 2:
> > > >
> > > > Row 1: (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
> > > > Row 2: (0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
> > > >
> > > > I seem to recall being able to populate it in two steps, passing
> > > > the rows as described above, but I can't recall the syntax. I've
> > > > been spending too much time in C and C++ and have forgotten my
> > > > VBA.
> > > >
> > > > --
> > > > Arthur
> > > > --
> > > > AccessD mailing list
> > > > AccessD at databaseadvisors.com
> > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > Website: http://www.databaseadvisors.com
> > > >
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


-- 
Arthur


More information about the AccessD mailing list