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

Autoexec and Auto Load Question.

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

    Autoexec and Auto Load Question.

    Hi:

    While reading the board messages, I find that some of you advise the use of the Autoexec and other advise the use of the Auto load or maybe On Load.

    Would you be kind enough to explain the following:
    How to create an Autoexec?
    How to create or call Auto load or on load?

    I'm interested in making sure that the screen of the form always centered, hold some variables and activate the password form and check the user privliges before sending him to a menu.

    It would be great if some already done something like this and don't mind sharing it.

    Thanks

    #2
    RE: Autoexec and Auto Load Question.

    To create an Autoexec script, from the controlpanel click on the Codes tab, select New/Script and name it Autoexec.

    The other apparently refers to a Form which Alpha can automatically load at start up. From the controlpanel click on File/Database properties, select your form and click the "Run on load" check box. You can attach a script to the OnInit event of that form that will then "run on load".
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com


    Comment


      #3
      RE: Autoexec and Auto Load Question.

      Peter's response tells you what the two methods are. You also asked why you would use one or the other.

      If you only need your database to open a specific form when it starts, no reason why you wouldn't use run on load. Totally simple.

      However, if you want to make several things happen and especially control their order, because some things won't work unless other things have already been done, then create an autoexec script. You will be able to control everything from there and make sure they happen the way you want. This includes loading and showing forms.

      Bill
      Bill Hanigsberg

      Comment


        #4
        RE: Autoexec and Auto Load Question.

        Bill, Peter THANK YOU!

        Comment


          #5
          RE: Autoexec and Auto Load Question.

          Dimitri,

          Here is a sample autoexec script that i use:

          :A5.window_title="TCA Quality Data Collection System"
          :controlpanel.hide()

          dim filepntr as p
          dim lastver as c
          dim thisver as c
          dim uptable as p
          dim ansr as n
          constant dbtype="c:isreal.jpb"
          constant flname="shadowdt.txt"

          on error goto update_error

          if file.exists(dbtype) 'a trick to bypass the shadow update
          goto show_menu
          end if

          uptable=table.open("qdcs_update",file_ro_shared)
          lastver=uptable.last_revised
          uptable.close()

          if .not.file.exists(flname)
          filepntr=file.create(flname,file_rw_exclusive)
          filepntr.write_line("20001201.00001")
          filepntr.flush()
          filepntr.close()
          end if

          filepntr=file.open(flname,file_ro_exclusive)
          thisver=filepntr.read_line()
          filepntr.close()
          if thisver=scrnhigh,10,(scrnhigh - menuhigh)/2)
          menupntr.left =if(menuwide>=scrnwide,0,(scrnwide - menuwide)/2)
          menupntr.show()
          on error goto 0
          menupntr:button2.activate()
          END

          update_it:
          ansr=ui_msg_box("UPDATES FOUND","The QDCS needs updating. Please wait while updates are made.",48)
          filepntr=file.open(flname,file_rw_exclusive)
          filepntr.seek(0)
          filepntr.write_line(lastver)
          filepntr.flush()
          filepntr.close()
          refresh_shadow()
          on error goto 0
          ansr=ui_msg_box("UPDATE COMPLETE","A5 will now shut down. You must restart for the updates to work.",48)
          :controlpanel.show()
          :A5.close()
          END

          update_error:
          on error goto 0
          ansr=ui_msg_box("UPDATE ERROR","The update failed. A5 will now shut down. Please try again.",16)
          :controlpanel.show()
          :A5.close()
          END


          Here is a user defined function for loading and centering forms. The only reservation is that i would not use it in an autoexec script:

          function displayfrm as L(formname as C,formindx as C)
          ' 08/31/99 Useage: centers & displays a form and sets the index. Return has no meaning.
          ' use "" for record number index or "none" for no index change
          dim formpntr as p
          dim scrnhigh as n
          dim scrnwide as n
          dim formhigh as n
          dim formwide as n
          scrnhigh = ui_info(1) ' height of screen in pixels
          scrnwide = ui_info(0) ' width of screen in pixels
          formpntr = obj(":"+formname)
          if is_object(formpntr)
          formpntr.restore()
          else
          formpntr = :form.load(formname)
          end if
          formwide = formpntr.width
          formhigh = formpntr.height
          ' if the form is taller or wider than the screen, set to 10,0
          formpntr.top=if(formhigh>=scrnhigh,10,(scrnhigh-formhigh)/2)
          formpntr.left=if(formwide>=scrnwide,0,(scrnwide-formwide)/2)
          if ut(formindx)="NONE"
          goto show_it
          else
          formpntr.index_set(formindx)
          end if
          show_it:
          displayfrm=.t. ' does nothing
          formpntr.show() ' show the form
          formpntr.activate() ' activate it
          end function
          Pat Bremkamp
          MindKicks Consulting

          Comment


            #6
            RE: Autoexec and Auto Load Question.

            WOW!

            Thank you!

            Comment


              #7
              RE: Autoexec and Auto Load Question.

              I suggest you also do a search on "re: security issues" (include the quotes in your search) and note the first sentence in Peter Gruelich's reply (3rd msg). This could be significant if you plan to distribute any applications.

              Comment

              Working...
              X