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

Script to find and replace in field rule

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

    Script to find and replace in field rule

    I have defined an index with 10 plus characters, consequently everytime I compact the database it truncates the index to 8 characters.

    The index resides in numerous field rules and I am wondering if anyone has knowledge of a script or something that can be initiated to find and replace the index name within the field rules? The field rules are located in the tables.

    Thanks in advance...John

    #2
    Re: Script to find and replace in field rule

    I'd say there's something else going on. I've never heard anyone complain that "everytime I compact the database it truncates the index to 8 characters." That simply shouldn't be happening. First, if they are truncated, they should only be truncated to 10 characters. Second, truncation is very rare and, as far as I know, only happens if the developer goofs when moving files.

    You might post one of the tables that has this problem and maybe someone here can see why it's doing that. If you do post something, you can remove most or even all the data but be sure to include all the related files - .dbf, .cdx, .ddd, .ddm, .ddx, .and. .fpt if there's a memo field. And, before you actually post it, test it yourself to make sure it's still a problem after being separated from the main database.

    Comment


      #3
      Re: Script to find and replace in field rule

      Cal,
      only happens if the developer goofs when moving files
      Although this is perhaps the most prevalent way in which truncation occurs, I have found also that I can make it consistently happen when a Passive linked table refresh goes awry--until I figured out the problem with one such refresh, I simply copied all my indices to a text file and then would have to copy/paste them back into the index dialog creation box each and every time the refresh failed. The failure would either truncate to 10 characters and many times even completely erase one or more indices. Truncation can also occur when Alpha comes across certain "bad" coding which it cannot resolve....I have mainly found this to be an issue when code is placed within an event that is not appropriate such as the OnInit event of a form which has caused Alpha to crash.

      My point to John would be whether or not Passive (or maybe Active?) linked tables are being used as this can be part of the problem. Or has Alpha crashed or had script/code not completely finish prior to any trucation?

      ...but then as you stated, compacting the database should not do as he stated.

      Just wanted to state a few other ways I have seen truncation occur.

      Cal, I go along with getting a sample as the only way to try to figure out the issue.
      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


        #4
        Re: Script to find and replace in field rule

        Did you have a space in the name of the index?
        Or more likely, do you, or did you have an underscore in the name?

        Comment


          #5
          Re: Script to find and replace in field rule

          Mike, I learned something new. I didn't know about the issue with Passive Linked tables (I don't use them a lot) or the code issue. I've never had an index issue caused by code - I'm not saying it doesn't happen; just that I haven't seen it yet myself. Hmmm, maybe that just means I'm better than you are.:D (Sorry, I've just been in 'one of those modes' today.)

          Comment


            #6
            Re: Script to find and replace in field rule

            Hmmm, maybe that just means I'm better than you are.
            Having spent a lot of time in the U.P. of Michigan, I can understand your errant reasons for thinking such "Trollish" thoughts!!---too much time spent "under the bridge" I think! :D
            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


              #7
              Re: Script to find and replace in field rule

              Thanks for all the replys. My mistake it is truncating to 10 characters and it does have underscores. I read somewhere on the message board that this has been a problem for others and Alpha cannot duplicate it. I'll see if I can send part of database.

              The fieldrule that seems to be causing the problem is part of a case statement. Any chance or experience with this?

              Comment


                #8
                Re: Script to find and replace in field rule

                The underscore is the problem..
                Get rid of it and you could have a long name.

                But..

                Why the long name (and as a consequence, the long face)?

                How is Jameson better than Jim? or Jimbo?

                Yes.. I know, so you could have a meaningful name..
                Better document the meaning of short dumb names than having long one.

                Comment


                  #9
                  Re: Script to find and replace in field rule

                  Thanks -- I understand the need for short names now; however, I have the "bad" index name embedded in numerous field rules. Is there a way to do a search and replace or something like that?

                  Comment


                    #10
                    Re: Script to find and replace in field rule

                    Two choices that I know of:

                    - My AIMS App Analyzer was specifically designed for searching apps for text in code, expressions, events, etc. It also does 'automated' searches for layout names, operation names, index names, and, if you want to take a bit of extra time, it can search all layouts to find field objects for specific field names.

                    - The A5 Documenter available on the Alpha site also has search capabilities now but, for some strange reason, I haven't used them in a long time.

                    I know my App Analyzer will not do a "replace" and I don't think the Documenter will either. My reason for not including a "replace" option was that there was just too much possibility of replacing the wrong text (BTDT - more than once). So, I figured that just knowing what needed to be changed was saving enough time and I could make the actual changes myself.

                    Here's an example built on one of my more infamous search attempts: I had to search an app for all occurrences of a form named "rep". This resulted in something like 3 pages of hits. However, most of them were words like "report", "prepare", etc. and only about 1 or 2 were actual references to the form. A global search and replace on that would have been a disaster. I've seen many other situations where I was sure a global search and replace would be perfectly safe but found out during my manual editing that it wouldn't have been. As a result, I seldom use any global search and replace. On occasion I'll do it within one script but that's my limit - even then it's rare. When I do use a global search and replace in code it's probably because I've already done a "Replace Next" from beginning to end and know that the text I'm replacing really is unique.
                    Last edited by CALocklin; 11-14-2009, 12:35 AM.

                    Comment


                      #11
                      Re: Script to find and replace in field rule

                      Originally posted by John Fringer View Post
                      Thanks -- I understand the need for short names now; however, I have the "bad" index name embedded in numerous field rules. Is there a way to do a search and replace or something like that?
                      If alpha truncated one..it truncated all.
                      Why don't you just right click the table from the CP and edit the indices. How many could you possibly have?

                      Comment


                        #12
                        Re: Script to find and replace in field rule

                        Originally posted by G Gabriel View Post
                        If alpha truncated one..it truncated all.
                        Why don't you just right click the table from the CP and edit the indices. How many could you possibly have?
                        But that won't fix all the references to those indexes in his code.

                        Comment


                          #13
                          Re: Script to find and replace in field rule

                          True.. he didn't say anything about code though. He is talking about field rules, unless those field rules have events.

                          Comment

                          Working...
                          X