none
getfldstate() and oldval() and curval()

    Question

  • Hi Experts,
    I opened a table in vfp window and issued
    set multilocks on
    cursorsetprop("buffering",5,"mytable") and issued
    getfldstate("stid","mytable") . It returns 1
    and then I opened the same table in another vfp window and changed the field 'stid'
    after came back to first vfp window and issued
    getfldstate("stid","mytable") . It returns 1
    why it always returns 1 while 'stid' field has been changed?

    To check modified record which is better to use getfldstate() or
    oldval() and curval()?

    With regards Tariq Iftikhar

    Friday, December 18, 2009 6:30 PM

Answers

  • GetFldState() operates on the buffered table. It wouldn't see any change on another session (or even in the same session but different alias of the same table). If you want to see if anything has changed on disk version then use Curval().
    • Marked as answer by Tariq Iftikhar Saturday, December 19, 2009 6:00 PM
    Friday, December 18, 2009 8:13 PM
  • if Oldval('fieldname','myAlias') # Curval('fieldname','myAlias') && changed
    • Marked as answer by Tariq Iftikhar Saturday, December 19, 2009 6:00 PM
    Saturday, December 19, 2009 3:26 PM

All replies

  • GetFldState() operates on the buffered table. It wouldn't see any change on another session (or even in the same session but different alias of the same table). If you want to see if anything has changed on disk version then use Curval().
    • Marked as answer by Tariq Iftikhar Saturday, December 19, 2009 6:00 PM
    Friday, December 18, 2009 8:13 PM
  • Hi Cetin,
    Thanking you for your kind attention. I am not much experienced of these commands.
    Please tell me how I use getfldstate() or oldval() and curval() to check modifications.
    My tables are buffered cursorsetprop("buffering",5,"mytable")

    With regards Tariq Iftikhar
    Friday, December 18, 2009 8:46 PM
  • if Oldval('fieldname','myAlias') # Curval('fieldname','myAlias') && changed
    • Marked as answer by Tariq Iftikhar Saturday, December 19, 2009 6:00 PM
    Saturday, December 19, 2009 3:26 PM