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

problem/w character strings:

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

    problem/w character strings:

    Hello again all,

    I know someone out there can do this! I will try and explain as fully as possible.

    I have a field in a db that contains names. (ex: "John Doe - "Betty doe" - "Ralph Doe") As you can see, each name is seperated by "-". In this db I have 178 rcrds with anywhere from 1-3 names at a time in said field. I'm trying to get a list of names from this field, that are not duplicated and contain no blanks. (Use an array or collection - right!) Well, I have attempted both, but cannot get a list/w just a single name not dup'd. I know we can sort A-Z, and that's what I'd like when I get the list? It's just with so many names and remember, the field can contain the same name again and again. That's where the problem is. Is anyone interested?

    Thanks,
    Mac

    #2
    RE: problem/w character strings:

    Mac,

    Did you mean to include double quotes within the the field value (around every name)? Assuming not, the code below at least singles out unique names for the field as a starting point.

    fld = "John Doe - Betty Doe - Ralph Doe"
    ?keywords(strtran(fld,"-",""))
    = "Betty Doe John Ralph"

    Other code using WORD() functions and the like could maybe be used to parse it down further.

    I'm curious as to how this field gets generated. If it's exported from a remote source that's understandable. But if you designed it as such, you should consider using multiple child records rather than concatenating the names together as such.

    Steve

    Comment


      #3
      RE: problem/w character strings:

      Steve,

      Actually I imported from Excel, but anyways, no there is not "" around every name. What I need to do is seperate the names to a list and then sort A-Z. The problem is, each record has the same name repeated again (not always, but)and it's difficult sorting thru each record - pulling out a new name (not one that's already in 'mylist' for ex)and adding it to(mylist). What will eventually happen Steve, is I will print a report for each record that a particular name is linked too. Some have 5-10 and some may only have 1. I hope I explained this a little better? It sure has my mind all twisted. :-)

      Mac

      Comment


        #4
        RE: problem/w character strings:

        Steve,

        I'm sorry, but maybe this will help. The db is an application that keeps track of DVD movies. What I'm trying to do is sort out the actors/actress's and then print a report on what movies they acted in.

        Does that help a little better?

        Thanks,

        Mac

        Comment


          #5
          RE: problem/w character strings:

          Using this field as a base, why not build an indexed table of the names. Stripping them out one by one, using the name as an index. When building the table, don't allow duplicates.

          Preventing duplicate on a name field can be dangerous as there certainly can be multiple "John Smith"s in the world.

          Instead of building the concatenated field from excel, why not just import into a new table cell by cell.

          Tom

          Comment


            #6
            RE: problem/w character strings:

            Mac,

            I see now that by "name" you were referring to full names. If I understand your problem correctly, some code as follows may do:

            dim arr_nam(600)as C
            dim cntr as N
            dim names as C
            dim name1 as C
            cntr = 0
            tbl=table.open("tablename")
            tbl.fetch_first()
            while .NOT. tbl.fetch_eof()
            names=tbl.field_name
            for j=1 to w_count(names)
            name1 = alltrim(word(names,j,"-"))
            if arr_nam.find(name1)=0
            cntr=cntr+1
            arr_nam[cntr]=name1
            end if
            next j
            tbl.fetch_next()
            wend
            arr_nam.sort()
            tbl.close()

            This would add unique names to your array and then sort them.

            Steve

            Comment


              #7
              RE: problem/w character strings:

              Steve,

              That's great - but can I ask probably a stupid question here, but my brain is fried. Is there anyway to get rid of those 358 blank lines in front of the list? I was thinking maybe some way of 'Dimming' the array with the exact number of names in the list? Do you think so?

              Mac

              Comment


                #8
                RE: problem/w character strings:

                Mac,

                Is there anyway to get rid of those 358 blank lines in front of the list?

                I assume by "blank lines" you are referring to array elements? Why would you want to limit the array size? Just dim it with more elements than you would ever need. If the counter variable (cntr) is still in scope, simply use the first cntr elements of the array thereby ignoring these "blank lines". If the counter is no longer available, redetermine it as:

                name_cnt = arr_nam.first_empty() - 1

                Steve

                Comment


                  #9
                  RE: problem/w character strings:

                  Steve,

                  Thanks a bunch for the help! I'm still a learner in the field of programming Steve. Arrays still bogle my mind sometimes. Sure appreciate all that you guys/gals do here on the forum. It's great to have a little help so quick and easy!

                  Thanks Again -

                  Mac

                  Comment


                    #10
                    RE: problem/w character strings:

                    Tom,

                    I only imported once from excel. I was using it to keep track when all-of-sudden, BINGO, I got a brain storm using AlphaFive. Now ain't that peculiar. :-)

                    Actually Tom, I thought about indexing, but man would that be a huge file. At least I think so? What would be your idea on a way to index? It would have to match the movie title/w the actor/actress. Any ideas are truly welcome! I learn more about Alpha off this forum than I think I would learn at a - well you know what I mean.

                    Thanks Bunch Tom
                    Mac

                    Comment


                      #11
                      RE: problem/w character strings:

                      Now you've piqued my interest. (That can be dangerous)

                      What about a simple set? Two tables, Films, and actors.

                      Films could have information about each movie, 1 record per film.

                      Actors will be my name, with an additional field for a movie. There would be multiple records per actor 1 for each film they were in.

                      Now build 2 sets.
                      FILM
                      |==="Actor

                      Linking field is Film title.

                      Actor
                      |==="FILM
                      Linking field is FILM Title

                      Now, if you use set 1, you can find all actors in a film, and using set 2, you can find all films that an actor was in.

                      See what happens when I get interrested??

                      Tom

                      Comment


                        #12
                        RE: problem/w character strings:

                        Tom,

                        Sorry about taking so long to get back at you :-(
                        I was out of town yesterday - but anyways - good idea! I shall ponder on that approach. But I want to try printing these reports by actor first. If it doesn't work - I think you plan is definetely positive!

                        Thanks,

                        Mac

                        Comment

                        Working...
                        X