Alpha Video Training
Results 1 to 3 of 3

Thread: Array.Find() HELP ...

  1. #1
    Member
    Real Name
    Kevin R Hunt
    Join Date
    Aug 2007
    Location
    Buffalo, NY
    Posts
    58

    Default Array.Find() HELP ...

    Hi,

    I've created a query that creates an array of dates.

    I then want to loop through a series of records and check if dates in those records are found in the array.


    I'm using the rs.ToPropertyArray feature.

    In the interactive window if I do something like ? aDataArray[1].date I see one of the dates that were returned.

    If I do typeOf(aDataArray[1].date) it indicates "D" because it is a date

    However I can't seem to find a way to search the array for a specific date.

    I've tried aDataArray.Find({01/01/2015}) (I know 01/01/2015 is an entry in the array), but I get a value of 0, indicating that the date isn't found

    Anyone have any ideas on how to search an array for dates?

    Thanks,

    Kevin

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Array.Find() HELP ...

    dim aDataArray[12] as P


    aDataArray[1].name = "BOB"
    aDataArray[1].date = {01/15/2014}
    aDataArray[2].date = {01/16/2014}
    aDataArray[3].date = {01/17/2014}
    ? aDataArray[2].date
    = {01/16/2014}
    ? aDataArray.find({01/16/2014})
    = 0
    ? aDataArray.find({01/16/2014},"date")
    = 2
    There can be only one.

  3. #3
    Member
    Real Name
    Kevin R Hunt
    Join Date
    Aug 2007
    Location
    Buffalo, NY
    Posts
    58

    Default Re: Array.Find() HELP ...

    Perfect, thanks ...

Similar Threads

  1. Sorting One Array Based on Values in another Array
    By G Gabriel in forum Alpha Five Version 11 - Desktop Applications
    Replies: 24
    Last Post: 03-11-2014, 09:40 AM
  2. array.find
    By omagarc in forum Application Server Version 11 - Web/Browser Applications
    Replies: 5
    Last Post: 11-13-2013, 09:08 AM
  3. Find index of property array
    By kkfin in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 12-01-2012, 06:37 AM
  4. how to update one array from another array
    By Steve Wood in forum Alpha Five Version 11 - Desktop Applications
    Replies: 10
    Last Post: 12-05-2011, 02:47 PM
  5. Array Question -will a multi-dimension array solve my problem?
    By djldc in forum Alpha Five Version 10 - Desktop Applications
    Replies: 11
    Last Post: 08-08-2011, 09:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •