Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Controlpanel script error in Copy To...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Controlpanel script error in Copy To...

    I realize that no more updates are scheduled for ver 7, so I am looking for a work around for this error: 1503 = "missing right parentheses" (reported in Trace window), which occurs when trying to use the Copy To from the right click menu in Controlpanel. Specifically in regards to copying a toolbar. I am upgrading my app to ver 8 and if it is possible to copy the toolbars to another app - how might I do this?

    I tried adding the .alb file from the old app to the new app, but am unable to copy over the toolbars. Is there a way to do this using Xbasic? I am working on a Win98 machine at home so do not have access to the ver 8 program here and thought I could do this in ver 7.

    Access to the Copy To script contents would be good... then I could add the missing parentheses!
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

    #2
    Re: Controlpanel script error in Copy To...

    Robin

    Here is the X_basic equivalent of the copy a toolbar

    Code:
    A5_CP_Object_Clone(ControlPanel.Active(), "toolbar")
    I really don't know that much about it but it brings up the genie that allows you to copy.

    Found more about it - if you want to copy a toolbar name "newtools" then
    you create a script using the above code and name the script "newtools" - save the script and then run it from the control panel code section. It will open the genie with the toolbar "newtools" in the name section and all you have to is to enter the path and the adb that you want to copy to in the bottom section.

    I tried it from v7 with a toolbar I named "newtools" and copied it to a V8 app

    Edit2: Now that you have a script named after a toolbar in your code section, then you can use that same script to copy the other toolbars to another version in another directory - just by changing the name of the file you want copied.

    I used the same "newtools" script to copy several toolbars from a test app in V7 to another test app in V8 in different directories by changing the name of the toolbar to copy.

    It is not in the help file but it is the code that the alpha xbasic genie writes when you create a script using the xbasic genie - menus - control panel - toolbars - copy to.



    Not a lot of help but some I hope.
    FWIW

    Tom Baker
    Last edited by Tbaker; 06-03-2008, 01:52 PM. Reason: Have more info - again more testing more info

    Comment


      #3
      Re: Controlpanel script error in Copy To...

      You are the man Tom! Thank you I will try it out.

      How did you find this command btw?
      Robin

      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

      Comment


        #4
        Re: Controlpanel script error in Copy To...

        I like to play around with the x_basic genie to see how it writes code.

        I just went to the code section, create a new script using x_basic. Called up the x_basic script genie - went to menu, then select action from control panel menu, then selected toolbars (you could also select menu), and had it write it code. The I looked at the code written by Alpha and played around with it to fing out how they work. Sometimes you can come up with some hidden gem that is not in the help file - I think this is one of them.

        As long as the script is named after an already existing toolbar, you can use it copy all the toolbars just by changing the name in top field.

        You can also us a5_CP_clone(controlpanel.active(),"menu") to copy menus the same way. Just make sure that the name of your script is the same as one of the existing menus you want copy. Then go to town copying over.

        I just like to tinker.

        Tom

        Comment


          #5
          Re: Controlpanel script error in Copy To...

          Tom,
          I am working on a udf that could run this script. Btw - did you notice that the genie also forgot to put in the right parentheses for that command?

          I can make an Xdialog to prompt for the CLASS of the object to copy and provide a list, but would prefer that the script find this out instead. I am not finding how to get this info on an object that is selected in the cp but not yet open. Any ideas? The class() method is supposed to return a character value when the object name is passed to it [ myformname.class() ], but it errs with "argument is incorrect data type" which is no doubt because the selected object is not running.

          So far this is what I have:
          Code:
          FUNCTION copy_cp_obj AS C (objname AS C)
          	dim objname as c
          	dim shared classnme as c
          	DIM SHARED varC_result as C
          	DELETE a_classnme
          	DIM a_classnme[11] as c
          	dim temp_list as c
          	temp_list = <<%list%
          BROWSE
          CODE
          FORM
          LABEL
          LETTER
          MENU
          OPERATION
          REPORT
          SET
          TABLE
          TOOLBAR
          
          %list%
          	Dim format as p
          	Format.tab_stops=""
          	Format.odd_row_color="White"
          	Format.even_row_color="Blue White"
          	Format.odd_selected_color="Pale Yellow"
          	Format.even_selected_color="Pale Yellow"
          	Format.font="Arial,8"
          	Format.font_color_unselected="Black"
          	Format.font_color_selected="Black"
          	Format.lastbutton="OK"
          	Format.group_size=1
          	Format.number_rows=.f.
          	Format.alternating_bands=.t.
          	temp_list = a5_owner_draw_list_fmt(temp_list,Format)
          	a_classnme.initialize(temp_list)
          	ok_button_label = "&OK"
          	cancel_button_label = "&Cancel"
          	varC_result = ui_dlg_box("Select the Object's Class",<<%dlg%
          {region}
          {Region}
          ;
          {Endregion};
          {Region}
          {xmargin=2}
          Classes:;
          [%d;O={@@}%.30,12classnme^#a_classnme];
          {Endregion}; 
          {Region}
          ;
          {Endregion};
          {line=1,0};
          {lf};
          {justify=center};
          <*12=ok_button_label!OK> <12=cancel_button_label!CANCEL>;
          {endregion};
          %dlg%)
          	IF varC_result = "" THEN
          		'user cancelled
          		end
          	END IF
          	copy_cp_obj=classnme
          	controlpanel.SetFocus(objname,classnme)
          	a5_cp_object_clone(controlpanel.active(),classnme)
          END FUNCTION
          To use the SetFocus() method the controlpanel must have an active object, though it needn't be the one you want to copy or even on the same page - specified in the help.
          Last edited by MoGrace; 06-03-2008, 03:52 PM.
          Robin

          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

          Comment


            #6
            Re: Controlpanel script error in Copy To...

            Robin

            Just a cursory look at your code

            First controlpanel.setfocus(objname,classnme) setfocus is expecting something in quotes "newtool","toolbar".

            Same as A5_CP_clone(controlpanel.active(),"toolbar")

            Your current code does not put them in quotation marks so you would have to use something like s_quote(objname), s_quote(classnme) or spell it out with chr(34)'s

            and then you would have to have a5 evaluate that for the a5_cp_clone function.

            Haven't had time to do it but just thought I pass that on so if you agree with that quick assumption you would have a headstart on me.

            Tom

            Comment


              #7
              Re: Controlpanel script error in Copy To...

              Robin

              Just got home from work and tested your UDF in my test app. Works perfectly. No problems either in Version 7 or Version 8.

              In interactive I copied two menu and two toolbars and one letter from Version 7 to a Version 8 Test app. And then copied the same number from the version 8 app to another version 8 app. Everything worked.

              Good Coding

              And you can forget my previous post - I was in work in a hurry and just read through you code and made some assumptions based on what you had said in your post - I really didn't read it very well and gave you bad information.

              Mea culpa.

              But again your code works fine. Nice work.

              Tom Baker

              Comment


                #8
                Re: Controlpanel script error in Copy To...

                Tom,
                Any ideas on how to get the class of the object to be selected? The fatal flaw in my script is that the class, if selected by the user (me!) could be wrong when passed to the genie.

                Since you have the test app already - tell me what happens if you try to clone a toolbar object as a form class!
                Robin

                Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                Comment


                  #9
                  Re: Controlpanel script error in Copy To...

                  Originally posted by MoGrace View Post
                  Tom,
                  Since you have the test app already - tell me what happens if you try to clone a toolbar object as a form class!
                  When you try to clone say a toolbar as a form you get an error message that states "the object is not in the dictionary" meaning if it was a form it would show in the dictionary as a form but its a toolbar.

                  Now as far as I know, there is no way to tell if something in the controlpanel code tab is a function, script, menu or toolbar - not that I know.

                  Also there is no way that I know to trap an error from an Alpha Genie which is what comes up when A5_CP_CLONE(controlpanel.active(),"toolbar") is executed.

                  The ony way to check would be to use a naming convention say xxxxfrm for a form, xxxrpt for a report, xxxltr for a letter, xxxxmnu for a menu, xxxtb for a toolbar etc. and trap for that, which in a real sense probably would not be a bad idea. However for a form, report, table, browse, letters, labels you can use controlpanel.active_page() to return the class (controlpanel tab) of the objname. For Operations and Code you can get the active_page but it would only tell you that were in operations or code not whether it was a query or toolbar.

                  I'm really at a loss on this one - but like I said I like to tinker - maybe I'll find that gem. I'll keep at it.

                  Your code is good and when you think about it, who is going to be copying toolbars and menus - not an end user but the developer. So at that stage if you see a name different from your objname in the name field of the genie, then you can abort the genie and correct the class. If you try to clone a toolbar with the name newtools and you give it a class of menu, form whatever but not toolbar, the name of the function will be inserted into the name field of the genie. So you will know right away that the class is wrong.

                  As I said I will keep on looking.

                  Tom Baker

                  Comment


                    #10
                    Re: Controlpanel script error in Copy To...

                    Robin

                    I did some tinkering, found the following

                    First you setfocus to an object newtools

                    Code:
                    controlpanel.setfocus("newtools","toolbar")
                    then you can find out if it is a valid class with the following code

                    Code:
                     
                    if controlpanel.active()="" then
                         Msgbox("Object Class Error", "You entered the wrong class for this
                         object")
                         goto tryagain
                    end if
                    If you set the class for a toolbar as a form, the result of controlpanel.active() will be "". So you can test for that.

                    I have attached your function script with the changes above.

                    Tom

                    Edit: I don't know what I did, but when I went back to the code to test it further, it broke. The function is remembering the last entry in the controlpanel.active() so there won't be a null value. Robin - maybe you can tweek the code - I think we are in the right direction.

                    Tom
                    Last edited by Tbaker; 06-04-2008, 01:14 PM. Reason: Not working right

                    Comment


                      #11
                      Re: Controlpanel script error in Copy To...

                      Very cool Tom - now can you tell why it works? What sets controlpanel.active() to blank if the class is wrong?

                      Edit:
                      Oh ohoh - I get it. The set_focus() will not activate the object if it is incorrectly specified and so controlpanel.active() returns a blank value instead of the objects full name!

                      Ain't the interactive window great? Which if I had read your post a little more closely I could have seen that was what you said...
                      Last edited by MoGrace; 06-04-2008, 01:32 PM.
                      Robin

                      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                      Comment


                        #12
                        Re: Controlpanel script error in Copy To...

                        Robin

                        I guess you didn't see my edit to my response - I tested the app and controlpanel.active() remembered the previous entry and therefore would not be null.


                        What sets controlpanel.active() to blank if the class is wrong?
                        That very question is what broke the code. I am working on that right now.

                        Still working on it.

                        Tom

                        Comment


                          #13
                          Re: Controlpanel script error in Copy To...

                          The help does mention that set_focus() will only work if some object in the controlpanel has already been selected - therefore not blank. So I think your code is correct in that if the object called by our function is incorrect then the controlpanel.active() becomes blank which is what we need to test for. The initial selection ought to be correct until the class name is changed to a wrong selection. So what did you try that seems to have broken it? Yet it seems that an incorrect object name would have the same effect.

                          If a wrong object name is entered, then the original selected object is returned. In which case the error message recurses in an endless loop - easy to fix that.
                          Last edited by MoGrace; 06-04-2008, 01:56 PM.
                          Robin

                          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                          Comment


                            #14
                            Re: Controlpanel script error in Copy To...

                            Robin

                            Try this one

                            Look at the code

                            It seems to work

                            Tom

                            Comment


                              #15
                              Re: Controlpanel script error in Copy To...

                              The $ operator is one I don't think too quickly of, but it is put to good use here. Thanks for all your help - it is fun to work together!
                              Robin

                              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                              Comment

                              Working...
                              X