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

Alltrim in V8

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

    Alltrim in V8

    When I was using V7, I would create an operation to go through a file, with selected record numbers, and insert spaces at the beginning of a field and add a letter to those selected records.

    In the expression part of the query, I would put " " (to indicate the number of spaces I wanted to insert) +alltrim(fieldname).

    I have tried the same thing in V8 and it does not seem to work.

    Am I doing something wrong or has the program changed?

    Thanks.

    #2
    Re: Alltrim in V8

    Hi Marvin

    Hmmm...Seems to be working here. From the interactive window.

    Code:
    dim vtest as c
    vtest="tester"
    ? vtest
    = "tester"
    
    vtest=" "+alltrim(vtest)
    ? vtest
    = " tester"
    But, I think I might be missing something you are trying to do. You don't have to add spaces ahead of time to concatenate a letter in front. You could just do something like varname="AA"+alltrim(fieldname)

    Field name's field type must be a character or you need to convert the field to a string.


    Regards,

    Jeff

    Comment


      #3
      Re: Alltrim in V8

      Hi Marvin

      Have you considered using padl which may well achieve what you need?

      Regards

      Glen
      Glen Schild



      My Blog

      Comment


        #4
        Re: Alltrim in V8

        I think that my problem is that when I use that logic in an operation, and define the set of records, it is not finding the records.

        I have checked the record number and entered it into the operation parameters, but nothing happens. I thought it was the alltrim aspect but I think it is something about the record number.

        Any suggestions?

        Thanks.

        Comment


          #5
          Re: Alltrim in V8

          I think we would need a much more detailed explanation of what you are doing/trying to do to be able to help you.

          Regards,

          Jeff

          Comment


            #6
            Re: Alltrim in V8

            1) I have a database with a character field with numbers and letters in it. It is 8 characters wide but items are in only the first 2 or 3 spaces in the field.
            2) I am trying to insert a letter and a space or a letter and 2 spaces before the first number in the field
            3) I have created a operation and chosen the "update records" option. I have said I wanted to create rather than use the genie.
            4) In the screen to create the operation, I have indicated the name of the field, in the field column. In the column called expression, I have put a quotation mark, a letter, a blank, another quotation mark, and the following text (without the quotation marks) "alltrim(fieldname)".
            5) I have saved the operation.
            6) I have run it, and said I wanted to operate between records x and y. It runs, but nothing happens. I have selected the record sequence from the database, without any indexes on and used the indicator in the lower left corner to tell me what the number of record is.

            I should indicate that this works in my other databases, so I may have done something really strange in this particular database. However, I can not think why this does not work.

            Is this enough detail?

            Comment


              #7
              Re: Alltrim in V8

              Hi Marvin

              Thanks for the info. Attached is a sample update operation I just made. There is a one field table with 8 characters. The field is currently populated with 3 characters for each record. I have a save update operation that you can run that will update the records to have ZZ_ put in front of the current field data. I would avoid trying to put blank spaces in the record.

              If it is just generic text like a part description field or general text then I don't think it matters. Although maybe the field you have is just a generic text field and it doesn't matter. I guess you can decide. In any case, the attached example works but it is doing all records.

              If you are not getting any results with your current for x and y. Then it sounds like that criteria is not producing any valid records to process. I would look at that criteria. If you still don't have any luck, I would be happy to take a look if you can post a sample. Sometimes a fresh pair of eyes does wonders! :)

              Regards,

              Jeff

              Comment


                #8
                Re: Alltrim in V8

                I think the problem is that there is something weird about this database. I tried to change record #18, either as a record number or as a marked item, and it was not picked up.

                Could you look it and see if you can see anything weird about the database.

                It is the first field I am trying to modify. I can explain the reasons as to why I am trying to insert the blanks, but I really think the problem is finding the records.

                Thanks.

                Marv

                Comment


                  #9
                  Re: Alltrim in V8

                  I think I attached the database in this note.

                  Comment


                    #10
                    Re: Alltrim in V8

                    You need to define what it is you really want to do with this field of data...

                    Record #1 = "___1____"
                    Record #7 = "___7____"
                    Record #8 = "__7C____"
                    Record #18 = "14______"
                    Record #819 = "B 1______"
                    Record #883 = "14______"
                    Record #1009 = "14______"
                    (I used the underscore to show spaces because of forum formatting)

                    These are some of the patterns I found.
                    I did not see any index field that would make this field unique.


                    >>>I think the problem is that there is something weird about this database. I tried to change record #18, either as a record number or as a marked item, and it was not picked up. <<<


                    I believe that's why when you asked for "14"... you did not succeed.

                    For now, I would strip out the spaces at the start of the field, this will add some consistancy.

                    I would then add some field rules to force the user to correctly place the data in this field.

                    This will make searching easier as well.


                    HTH,
                    --Bob

                    Comment


                      #11
                      Re: Alltrim in V8

                      I have put a quotation mark, a letter, a blank, another quotation mark, and the following text (without the quotation marks) "alltrim(fieldname)".
                      Marvin,
                      Bob is correct.

                      Also, based upon what you wrote, it translates to this:
                      "A "alltrim(fieldname). Missing in there is a "+" sign => "A " + alltrim(fieldname).
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #12
                        Re: Alltrim in V8

                        I tried to run the change operation on record #18, to change "14 " to " 14". This has worked in other databases with the same structure. I need this structure to create a certain type of structure. It works in other databases.

                        However, the change operation never seemed to find record #18, in order to make the change. I tried two ways to tell the change operation to find the record, either by marking it, or using the record number.

                        How can I tell whether the problem I am having is due to the database itself, the search routine I am applying to the change operation, or the change operation?

                        Thanks for trying to puzzle this out for me.

                        Comment


                          #13
                          Re: Alltrim in V8

                          Mike W,

                          Sorry if I left the "+" out.

                          Here is what I put in the Expression field...

                          " "+alltrim(nameoffield)

                          Which should translate to 2 blank spaces, a plus sign, the alltrim operation, and the name of the field.

                          This has worked in all my databases except 1.

                          Comment


                            #14
                            Re: Alltrim in V8

                            Marvin

                            It seems Bob and Mike confirmed what I wrote earlier about not using spaces in a field like this. Unless you are absolutely tied to this format for some reason, I think it might make sense to change your methodology. Perhaps add a unique id field and do an update operation with serial data so you could 100 percent for sure have a unique identifier for each record? For what it is worth, I did the following in the interactive window. It shows record 18 not with one or two space(s) but 6.

                            Code:
                            dim tbl as p
                            tbl=table.open("argentina")
                            tbl.fetch_goto(18)
                            ? tbl.numarg
                            = "14      "
                            Regards,

                            Jeff

                            Comment


                              #15
                              Re: Alltrim in V8

                              Jeff,

                              I really am tied to the format.

                              I am just curious as to whether the 6 spaces after the number is significant in an operation that uses the alltrim.

                              Basically what I am trying to do, is remove 2 spaces at the end of record and place them at the beginning of the record. It has worked in all my other databases, which are all structured in the same way as this one is.

                              It is strange. If I can not do it this way, then I will go through and manually insert the space. I was just trying to save time and energy.

                              Comment

                              Working...
                              X