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

New to scripting and needing help

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

    New to scripting and needing help

    Hello I am a programmer by training (four years of C++, plus some minor perl and cgi scripts) but I am having trouble getting started with XBasic. The documentation my company has is limited to a 1994 XBasic Reference book for Alpha Five for Windows. I know no Basic commands or XBasic for that matter and none of the screens in the book are accurate with my current version (A5V4.03). Where should I start so that I can learn this scripting language?

    The immediate goal is to be able to check user entered information for inaccurate punctuation and to eliminate it from the string. My current thoughts on the issue is to be able to take a field and search the string for characters that do not fall within the following ASCII code ranges:
    97('a')-122('z')
    65('A')-90('Z')
    48('0' zero)-57('9')
    46('.')
    45('-')
    44(',')
    37('%')
    This seems to be the best way to keep my strings clean, but implementing it into XBasic and interfacing with Alpha 5 are my stumbling blocks. Any hints as to how to address this immediate need would be great too. (I am wondering if a script is even needed to do this.)

    Any help you can provide would be great.

    Jason

    #2
    RE: New to scripting and needing help

    Jason,

    You should be able to use the following to perform your test. I would think in the CanDepart event for the field in question.


    Character = CHR( ASCIIValue)

    LogicalValue = CONTAINS ( CharacterString, CharacterWords)

    Something like
    i=123
    while i
    There can be only one.

    Comment


      #3
      RE: New to scripting and needing help


      search A5 help for Template and Mask information. That may provide much of what you want to do without the need to program.

      For up-to-date reference information for your version of A5, look in the Books folder on the A5 CD. Reference material is provided in both .pdf and .doc format.

      Comment


        #4
        RE: New to scripting and needing help

        I think maybe you are new to Alpha Five, not just the xbasic portions...
        In this case you need to get a feel for the whole application, not just xbasic - a lot of what would be coded in Access is handled by field rules in Alpha Five, and as you create forms (screen shots) and reports you have some other tools to play with formatting and calculation. Alpha Five was developed for the non-programmer, so a lot of coding needs are handled in these ways. This is how development in Alpha Five can be so fast (once you know its toolbox!) It takes a while to develop the experience needed to know the easiest way to do things, and when you need to use xbasic.

        In the case of checking data entry a lot can be done with field rules (data entry masks and templates). But maybe not enough for you?

        Comment


          #5
          RE: New to scripting and needing help

          I am fairly new to Alpha 5 (a little over three weeks), but I am enjoying it greatly (I had previously done some work in Access).

          The mask idea seems to be on the right track, but is there a way to define your own mask (i.e. a custom mask that will only take alphabetic characters and a dash)?

          Jason

          Comment


            #6
            RE: New to scripting and needing help

            From the help file...
            Mask Character
            Description
            L Any upper letter
            l Any letter

            Comment


              #7
              RE: New to scripting and needing help

              Jason,
              For the latest XBasic Help file goto:http://support.alphasoftware.com/alpha5/index.html

              --Bob

              Comment


                #8
                RE: New to scripting and needing help

                Jason,
                For the latest XBasic Help file goto:http://support.alphasoftware.com/alpha5/index.html

                and look for Help401.exe

                --Bob

                Comment


                  #9
                  RE: New to scripting and needing help

                  The masks in the help file (thanks for pointing them out, I had only looked in the online books, but not the online help) do take care of some of my needs nicely. However, some of my fields are a bit more specific than what the built-in masks are providing.

                  Specifically, I need two specialized fields. One is a character field to accept only letters and '-'. The other is a character field to accept any letter, any digit, '-', '%', ',' only. (For the latter, something like the N mask but including '%' would do.) I know I can exclude some characters using a validation, but it seems very brute force to exclude nine or ten characters via a validation. I'm sure there is a more elegant solution.

                  Jason

                  Comment


                    #10
                    RE: New to scripting and needing help

                    I might suggest the use of the remspecial() function.

                    - Steve
                    -Steve
                    sigpic

                    Comment


                      #11
                      RE: New to scripting and needing help

                      One of the earlier posts indicated the necessity of allowing "-" and "%". How do you work around this with remspecial?
                      There can be only one.

                      Comment


                        #12
                        RE: New to scripting and needing help

                        Jason:

                        I wanted to restrict entry in a password field to letters and numbers. After the fact I realized that a mask would have worked just as well, but I wanted to experiment with an OnKey
                        event. You could change the ranges of the select statement to include/exclude the signs you want.

                        '==============
                        Activefield=parentform.active()
                        if ut(Activefield)="PASSWORD"
                        dim keyval as n
                        keyval=Asc(a_user.key.value)
                        select
                        case a_user.key.value="{ESC}"
                        a_user.key.handled=.F.
                        end
                        case a_user.key.value="{SHIFT}"
                        a_user.key.handled=.F.
                        end
                        case a_user.key.value="{BACKSPACE}"
                        a_user.key.handled=.F.
                        end
                        case a_user.key.value="{ENTER}"
                        a_user.key.handled=.F.
                        end
                        case a_user.key.value="{TAB}"
                        a_user.key.handled=.F.
                        end
                        case keyval>47 .and. keyval64 .and. keyval96 .and. keyval
                        Finian

                        Comment


                          #13
                          RE: New to scripting and needing help

                          If remspecial() doesn't do it you could always go back to the beginning of this post, and develop a user defined function...

                          Comment


                            #14
                            RE: New to scripting and needing help

                            A user defined function that checks each key press as being in a string of allowed characters...

                            Comment


                              #15
                              RE: New to scripting and needing help

                              I thought maybe Steve had a method in mind to test the string with remspecial() first, then parse if the length was different. That could work. If we're talking about keyboard entry, then the list of characters that need to be tested for is shortened.

                              You could remspecial(), test the length, return ok if they are the same, test for contains "-" or "%", return ok, test any other allowable characters, return ok, return not ok.

                              Good idea, Steve.
                              There can be only one.

                              Comment

                              Working...
                              X