Alpha Video Training
Results 1 to 11 of 11

Thread: Pack script error

  1. #1
    Guest
    Real Name
    Anissa Walker
    Join Date
    Jul 2009
    Posts
    144

    Default Pack script error

    Hello- I received an error message from a script I wrote in Alpha 5 version 9. The script read:

    Script:FinalAppend line:47
    Tbl.pack()
    Table in use by another user or window

    I just installed version 10 full and runtime database locally on my machine for testing before I deploy out to the server and upgrade. When I comment out the pack(), then the program runs, but my table doesn't pack as it should.
    I tested this script out in both runtime and full version and the error still appears and stops processing at this point.

    Is there something different in version 10 that would cause this to happen?

    Neecy

  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: Pack script error

    Might be a timing issue. From the script name can we assume some append processing precedes the pack?

    I would suggest following whatever prior code you have with

    tbl.close()
    a_tbl = table.open("sametablename",FILE_RW_EXCLUSIVE)
    a_tbl.pack()
    a_tbl.close()
    'any other code here
    There can be only one.

  3. #3
    Guest
    Real Name
    Anissa Walker
    Join Date
    Jul 2009
    Posts
    144

    Default Re: Pack script error

    Hi Stan-

    Tried your method and the new error says The process cannot access the file because it is being used by another process. From reviewing the script attached, is there any reason you can see that Alpha 5 version 10 produces this error while it works with no problem in version 9?

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

    Default Re: Pack script error

    That still indicates a timing issue. Try it this way with the append inside a function.

    And no, I don't see a reason it should behave differently.
    There can be only one.

  5. #5
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Pack script error

    Hi Stan,

    I have often seen mention of converting an action script to Xbasic and putting it into a function.

    Is it as simple as just creating the function as you have done
    ? ie. Making it Logical and enclosing within:

    FUNCTION app_code as L()
    app_code = .F.

    Scrpit goes here.....

    app_code = .T.
    END FUNCTION
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

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

    Default Re: Pack script error

    Yup, just that simple. You can add error checking but the basics are in my attachment. If you capture the xbasic of an Alpha generated append you will have the error checking it adds.

    The reason you make the script return a logical type is so that you can say

    if functionname() 'returns true if the script completes, false if it doesn't
    'do this
    else
    'do that
    end if

    Setting the return functionname = .F. means that if the script in the function doesn't finish then the line functionname = .T. never executes and you can test for that.
    There can be only one.

  7. #7
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default Re: Pack script error

    Hi Keith,

    Quote Originally Posted by Keith Hubert View Post
    Hi Stan,

    I have often seen mention of converting an action script to Xbasic and putting it into a function.

    Is it as simple as just creating the function as you have done
    ? ie. Making it Logical and enclosing within:

    FUNCTION app_code as L()
    app_code = .F.

    Scrpit goes here.....

    app_code = .T.
    END FUNCTION
    It is actually easier, but returning a logical just makes it more Script_play() equivalent and has the advantage outlined by Stan.

    However, the benefits are enormous for more reliable operation. See my tips here.
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture



  8. #8
    Guest
    Real Name
    Anissa Walker
    Join Date
    Jul 2009
    Posts
    144

    Default Re: Pack script error

    Hello-

    Since I upgraded to version 10, I have had to make adjustments to my code so that it works. My prior version was 9. I don't receive the pack script error now, however, form doesn't work as before. In version 9, my calculated fields updated when typing values into a non calculated fields. Since I have copied my database into a new folder and started using version 10, the calculated fields do not update automatically when entering values into a non calculated field as i have it setup. How do I go about having this work for version 10? My database have massive calculated and non-calculated field, therefore, I hope I do not have to re-create everything.

    Neecy

  9. #9
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Pack script error

    Neecy, is this latest issue related to the pack script error? If not, consider starting a separate thread to keep the discussions separate.

    Regarding the pack script error you did you get the problem fixed? What did the solution look like?

  10. #10
    Guest
    Real Name
    Anissa Walker
    Join Date
    Jul 2009
    Posts
    144

    Default Re: Pack script error

    Hi Tom-

    This does relate to the pack error. The pack() worked in version 9, but doesn't in version 10. It appears that many of the scripts in version 9 requires me to modify my code for version 10.

    The pack script error didn't disappear at all. The only resolution I could use was packing the table using pack() into another script. Although it appears to be a timing issue from where I originally had it, after going through the suggestions given, the error still said it couldn't pack the table because the table is being used by another process. The table was closed before the script to pack was initiated.

  11. #11
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Pack script error

    Hello, Anissa.

    It seems to me that a question about getting calc fields to update is a very different issue than a question about why a script that packs a table is failing. Suggest you begin a new thread when there's a different issue you have questions about. It will get better exposure and will be easier for others to find when they have similar issues later on.

Similar Threads

  1. Pack Script
    By lkatz1 in forum Alpha Five Version 5
    Replies: 1
    Last Post: 01-09-2005, 12:25 PM
  2. Pack Script
    By djones092 in forum Alpha Five Version 5
    Replies: 7
    Last Post: 03-15-2004, 10:52 AM
  3. Pack Table Script Error
    By Charles Norman in forum Alpha Five Version 4
    Replies: 5
    Last Post: 12-10-2002, 11:35 PM
  4. Pack Action Script
    By John Cunradi in forum Alpha Five Version 4
    Replies: 5
    Last Post: 03-12-2001, 06:58 PM
  5. Pack tables script
    By fairviewcomputing in forum Alpha Five Version 4
    Replies: 12
    Last Post: 02-19-2001, 05:04 AM

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
  •