Alpha Video Training
Results 1 to 9 of 9

Thread: Copy will not run.....

  1. #1
    Jeff Klages
    Guest

    Default Copy will not run.....

    I created a Copy operation.... using the genie..... inserted "Copy.run("blank")" into an onpush for a button on my form. Shutdown A5... opened application... go to form with the button... push button... tells me "No such table".... so what part of working with the genie did I get wrong?

  2. #2
    Jeff Klages
    Guest

    Default RE: Copy will not run.....

    Oh... if I go to the operations tab in control panel... it runs just fine.

  3. #3
    Jeff Klages
    Guest

    Default RE: Copy will not run.....

    Argh! On second thought... nevermind... I dont need a backup. Problem solved.

  4. #4
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Copy will not run.....

    Jeff,

    I just experienced this problem. What was the solution?

    Thanks,
    Bill

  5. #5
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Copy will not run.....

    Well here is *one* solution. The problem was the same. The export.run() command would work in a script run from the control panel or interactive window but would fail when run from a button.

    I understand the issue and I understand the solution. Still, I am going to demonstrate action scripting to a group in a couple of weeks and I would like to be able to show a simpler way to run an operation from a button as the solution detailed below could stick some people as exotic. Shouldn't action scripting be able to handle this?

    Moreover, I thought a script created a new session. If so, having the button run a script which runs the operation should solve the problem but it doesn't. So I must be misunderstanding something.

    All help gratefully received.

    Bill



    Msg ID: 7945
    Subject: RE: export error
    Author: Selwyn Rabins
    Date: 10-17-2002 1:47 PM
    File:


    replace the line:

    :export.run("expsubinvoices")

    with this


    cmd = cvendno"
    export.field2 = "poheadertemp1->cinvno"
    export.field3 = "poheadertemp1->cinvdate"
    export.field4 = "poheadertemp1->desc"
    export.field5 = "poheadertemp1->amtreleased"
    export.field6 = "poheadertemp1->glacct"


    but, the export was defined as:


    export.field1 = "poheadertemp->cvendno"
    export.field2 = "poheadertemp->cinvno"
    export.field3 = "poheadertemp->cinvdate"
    export.field4 = "poheadertemp->desc"
    export.field5 = "poheadertemp->amtreleased"
    export.field6 = "poheadertemp->glacct"

    so you get an error.


  6. #6
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Copy will not run.....

    could *strike* some people as exotic. (I'll take care of sticking it to them.)

  7. #7
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Copy will not run.....

    Continuing this little conversation with myself, I found another way.

    If you capture the xbasic for the operation (copy in my experiment) and substitute table.get() for table.open() in the line
    a_table = table.open("your source table's name")

    you eliminate the error because you are using the current session of the table. Hence, no 2nd session with a different alias.

    You also have to eliminate the a_table.close() line at the end as you would be trying to close the primary table of the current session and would (I think) create another error.

    Still, I wonder if action scripting shouldn't be able to cope with the context issue.

    Bill

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

    Default RE: Copy will not run.....

    Bill, good morning.

    Your second approach is how I've always done it in Version 4. Capture the script the saved operation is using, and then modify it to run against the same instance of the tables used by the current form. Depending on the level of experience of your audience, it occurs to me that this might be a good way to show them the script recorder.

    -- tom

  9. #9
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Copy will not run.....

    Hi Tom,

    Agreed on both points. And the "recorder" utility is better in 5 as you don't have to run a saved operation to see its code as you can peek at the xbasic and copy it to the clipboard.

    Of course, the script recorder is nice too.

    But the environment I was working in last night is carried over from version 4 and the button to run the saved operation worked from 4.3 to 4.5. I don't remember when I wrote it but it was a while back.

    So this is a difference between 4 and 5 which needs to be managed. The question I raise is how best to do so and avoid confusing users of action scripting.

    This "application" is so simple that I never captured the operation's low level xbasic. I just made a button to run it.

    For the record, it is a simple copy operation which copies certain records in the current table (on which the application's sole form is based) to an empty second table of identical structure.

    All the best,
    Bill

Similar Threads

  1. copy
    By bmann3 in forum Alpha Five Version 6
    Replies: 7
    Last Post: 08-17-2005, 12:36 PM
  2. Copy to CD
    By Michael Humby in forum Alpha Five Version 4
    Replies: 8
    Last Post: 05-25-2005, 08:23 AM
  3. How do I copy only the db
    By David Gilbert in forum Alpha Four Version 6 and Prior
    Replies: 10
    Last Post: 02-26-2004, 04:38 PM
  4. Copy Appearance/Copy Format
    By dik_coleman in forum Alpha Five Version 5
    Replies: 6
    Last Post: 10-12-2003, 06:35 AM
  5. Where is <tbl>.copy()?
    By Gary Kissinger in forum Alpha Five Version 4
    Replies: 4
    Last Post: 10-14-2001, 02:36 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
  •