Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010

    Question Unanswered: FoxPro cursor problem

    I am troubleshooting a FoxPro app that I did not write. I will use generalized filenames for simplicity's sake. The code in filename "1.prg" stores data in a cursor, then moves on to filename "2.prg", then attempts to recall the previously stored data from the cursor and insert it into a FoxPro Report.

    From my understanding, cursors stay active until the program terminates, right? I am trying to iterate thru that cursor and print all the values onto a FoxPro Report, however it isn't putting any of the data onto the Report. Any ideas on what I should examine to find out why its not working as planned?


  2. #2
    Join Date
    Sep 2009
    Provided Answers: 1
    How do you get from program 1 to program 2?
    Are the variables public?

  3. #3
    Join Date
    Nov 2002
    Provided Answers: 1
    stores data in a cursor

    Cursors are memory 'containers' for data and work like a data table

    But memory objects are subject to program 'scope' and are only available to those functions, programs, etc. which have been called by the part of the application which creates them - unless they are declared PUBLIC or have been added as an Object.

    then moves on to filename "2.prg"

    Whether or not the memory object (the cursor) is available to 2.prg is dependent on how it is called.

    If some other 'main' program called 1.prg which then terminated and returned to 'main'
    and then 'main' called 2.prg, the memory objects created in 1.prg would NOT be available to 2.prg

    But if 1.prg directly called 2.prg, then the memory objects Should be available.

    But other things could also be involved such as:
    * Was the command USE issued on the cursor?
    Example: SELECT ThisCursor
    That would CLOSE the cursor and release it from memory
    * Or was the CLOSE DATABASE ALL command issued?
    Again causing the cursor to CLOSE and release it from memory
    * Or was the RELEASE command issued in such as way that it would Release the memory objects?

    These are all things to take into consideration.

    Good Luck,

Tags for this Thread

Posting Permissions

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