Cardfile Script no Save
  • Vince

    Cardfile Script no Save

    by Vince » Fri Jun 09, 2006 3:51 pm

    Changing the value of various fields (via 'ScrWrite()') that live on the third (possibly any page other than the one with focus) page of a tabbed dialog, while the focus is on another page, does not fire the 'Save' button. If the record is saved at that time (via the message dialog) an error is generated.
    However, if 'Write()' is used instead of 'ScrWrite()' there is no problem whatsoever.
    Admittedly, there is no need to be seeing what is on page 3, or 4, or whatever at the time of writing the data but I find this behaviour disturbing as it suggests that the usage of 'ScrWrite()' is perhaps dependant on screen focus. In other words, ScrWrite here, but Write there etc.
    Is this something you have experienced? The very simplest scripts also reproduce the problem, and it is the same for either logical or Text fields and probably all field types.
    Thanks in advance for any feedback whatsoever,
    Vince
  • COBS Tech Support
    Posts: 664
    Joined: Fri Sep 09, 2005 8:23 am

    by COBS Tech Support » Wed Jun 14, 2006 6:05 pm

    What version of CAPITAL are you running? And what maintenance release?

    Fortunately, or unfortunately, depending on your perspective on this issue, SCRWrite() in CAPITAL 7.41 and above will cause the 'save' button to enable. This will, unfortunately, cause badly written scripts behind user screens to fail to run properly in later releases. At present in earlier versions of CAPITAL, SCRWrite() is suppressed in many instances, particularly if placed inside field formulas.

    SCRWrite() should never be called from a field formula, whatever version of CAPITAL you use. But only from the Screen Script.

    Write() should not be called except inside a 'post save' event, as you would then be altering a database record that either does not yet exist, or you would be overriding the functionality of the 'undo' button among other problems. Doing this may also cause random 'assertion' or 'internal' error messages to appear and is not recommended.

Who is online

Users browsing this forum: No registered users and 0 guests