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

Is there an Xbasic command to undelete record

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

    Is there an Xbasic command to undelete record

    I know there is an xbasic command to .delete_record() and .delete() to delete a record. Is there a way to undelete a paritcular record via xbasic similar to that possible within the Control Panel.
    Thanks in advance
    Peter

    #2
    Re: Is there an Xbasic command to undelete record

    There is a way to do that but you have to know the record number since a deleted is not visible and you can't position the record pointer on it otherwise.

    Undeletes record #1 of the chld table.

    Code:
    tbl = table.open("chld")
    tbl.fetch_goto(1)
    fld = tbl.field_get(0)
    tbl.change_begin()
    fld.value_put("")
    tbl.change_end(.t.)
    tbl.close()
    There can be only one.

    Comment


      #3
      Re: Is there an Xbasic command to undelete record

      Hi Peter,

      Originally posted by pk9 View Post
      I know there is an xbasic command to .delete_record() and .delete() to delete a record. Is there a way to undelete a paritcular record via xbasic similar to that possible within the Control Panel.
      Thanks in advance
      Peter
      An old routine I listed in the code archive is 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


      Comment


        #4
        Re: Is there an Xbasic command to undelete record

        Stan/Ira
        Thanks again.
        Both exceptional methods of doing it.

        It begs the question why not in A5?
        Peter

        Comment


          #5
          Re: Is there an Xbasic command to undelete record

          It begs the question why not in A5?
          How would Alpha know what record you wanted to undelete?
          There can be only one.

          Comment


            #6
            Re: Is there an Xbasic command to undelete record

            Stan,
            Alpha 5 could request user input in a similar manor to your script. In reading it the syntax is not at all intuitive but it works well. I assume the pointer can still point to a deleted record.

            Comment


              #7
              Re: Is there an Xbasic command to undelete record

              I assume the pointer can still point to a deleted record.
              Only by record number.
              There can be only one.

              Comment


                #8
                Re: Is there an Xbasic command to undelete record

                Originally posted by pk9 View Post
                It begs the question why not in A5?
                There are a LOT, probably hundreds and maybe thousands, of things that A5 could do internally that would be neat to have. But, they probably don't have time to do everything so some things are left up to the individual developers. That's one reason Ira and I have created some addons. (Speaking only for myself, most of my addons were done originally for my own benefit.)

                Using the same basic routine that Stan presented - and adding a bunch of improvements - I created an undelete routine that allows me to actually view and delete specific records. I don't use it often but it is handy when I do need it. However, it isn't ready for distribution and it would take some time to get it ready so it is only acceptable for my own use. See a quick demo video of one case were it does work without errors. (I chose that option in the video because one of the other options isn't working correctly in v9 at all. Remember - not debugified yet.)

                Another one I always thought would be neat was to have a message box that could show different fonts and backgrounds. So, I created my own ui_msg_box() replacement - see attached screenshots. The only limitation so far is that a singe paragraph cannot exceed 1024 characters.

                By the way, neither of these routines took less than "many hours". I don't keep track of the time partly because they usually develop and improve over a period of weeks or months - and maybe a little bit because I don't really want to know how much time they took.

                Could Alpha do all this internally? Sure, but do they have the time or is their time better spent on other things?
                Attached Files
                Last edited by CALocklin; 03-06-2009, 10:16 PM.

                Comment


                  #9
                  Re: Is there an Xbasic command to undelete record

                  Originally posted by CALocklin View Post
                  There are a LOT, probably hundreds and maybe thousands, of things that A5 could do internally that would be neat to have. But, they probably don't have time to do everything so some things are left up to the individual developers. That's one reason Ira and I have created some addons. (Speaking only for myself, most of my addons were done originally for my own benefit.)
                  That goes for me as well!

                  My CSDA Code Utility was started as a restart program to save me hours of restarting A5 while debugging Active X routines. I've made it a general front end to many other utilities that are part of it that aid in my development. When I release my next version it will have some new cool utilities that will include things like a global code search that takes 1 second versus 30 seconds for Alpha's (on my code library which is large) , Better code jump, background database backups during development, and some really cool library packging utilities.

                  But unfortunately, there is not enough revenue stream to warrant much development for these or similar addons. Yet many or yours and mine have an extremely large return on investment!

                  Originally posted by CALocklin View Post
                  Another one I always thought would be neat was to have a message box that could show different fonts and backgrounds. So, I created my own ui_msg_box() replacement - see attached screenshots. The only limitation so far is that a singe paragraph cannot exceed 1024 characters.
                  I have a similar replacement routine that does what yours does, and adds modeless, timeout, HTML display, sizable, clippable, and other features. The HTML features solves the 1024 limitation and allows pretty much anything.

                  Bill Partec has a simpler one that he's placed in the code archive.

                  Can I count my hours in to that one routine? I'd wild eye guess a man week! While Alpha might spend a couple hours on a function's code, we probably spend days or weeks honing one to perfection.

                  Was it worth it? Probably not, but it makes my life a whole lot easier when coding. Can I sell it? Probably not, as no one would probably pay for it alone.

                  Originally posted by CALocklin View Post
                  Could Alpha do all this internally? Sure, but do they have the time or is their time better spent on other things?
                  I have a workable concept to have a library of compiled routines, that could be extracted amd placed into a user's compiled libary, and thus could make selling a library much more possible. There are so many routines I have, and I'm sure you as well, that would save coders a ton of time, but I don't
                  think they could be sold in the current A5 market. I hope that might change someday.
                  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


                  Comment


                    #10
                    Re: Is there an Xbasic command to undelete record

                    Ira, I downloaded your undelete script since I think it would be really handy in those cases where I accidently or without thought delete a record. I'm using V8. How do I incorporate it into Alpha? I also assume that this will only work if you haven't packed the table. Is this true?

                    Comment


                      #11
                      Re: Is there an Xbasic command to undelete record

                      Hi Robert,
                      Originally posted by robert View Post
                      Ira, I downloaded your undelete script since I think it would be really handy in those cases where I accidently or without thought delete a record. I'm using V8. How do I incorporate it into Alpha?
                      You need to execute it in a button, interactive window or similar, placing the appropriate parameters into the function. So the code for a button might be
                      Code:
                      UndeleteRecords(TableName,"IRF",".t.")
                      You need to fix the code line
                      Code:
                      choice=ui_get_expr("Enter Filter Expression","Filter:",dflt)
                      to this for the F option to work
                      Code:
                      choice=ui_get_filter("Enter Filter Expression","Filter:",dflt,tabnam)
                      Originally posted by robert View Post
                      I also assume that this will only work if you haven't packed the table. Is this true?
                      Once you packed, your data is gone forever! (Unless you remembered to backup! :) )
                      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


                      Comment


                        #12
                        Re: Is there an Xbasic command to undelete record

                        I'm absolutely in the dark with regards to implementing what you said.
                        I can edit the code but I only use the default browse when I'm working in my tables (my preference). Accordingly, how would I insert the code into Alpha so I could execute it whenever I needed to? I looked at the help for interactive windows and scripts etc., but it didn't help.

                        Comment


                          #13
                          Re: Is there an Xbasic command to undelete record

                          no one wants to weigh in on this one?

                          Comment


                            #14
                            Re: Is there an Xbasic command to undelete record

                            Everything in Alpha happens in response to an event. Check the help for Evant and choose a suitable one.
                            There can be only one.

                            Comment


                              #15
                              Re: Is there an Xbasic command to undelete record

                              robert,
                              IOW, you have to determine what events/methods are available when using the limitation of just using the default browse...obviously no buttons. How about the top main menu or a right click menu?? Or what you mentioned even in regards to the interactive window--either by placing the script in manually and running it, creating a script/function and running it.....

                              How would you want it to be??
                              Mike
                              __________________________________________
                              It is only when we forget all our learning that we begin to know.
                              It's not what you look at that matters, it's what you see.
                              Henry David Thoreau
                              __________________________________________



                              Comment

                              Working...
                              X