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

Create an AEX file and delete all scripts and udf�s

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

    Create an AEX file and delete all scripts and udf�s

    I did a search of the message board looking for an easier way to create an AEX file and then to delete all the scripts and UDF functions. Steve Workings posted a script that he used.

    While it worked for me, I was getting some errors when running the script. I did get a little carried away, but this script works very well now.

    Caution, backup your databse, scripts and functions before running this script.



    Code:
    'Date Created: 30-Nov-2012 10:07:53 PM
    'Last Updated: 07-Jan-2013 03:58:23 PM
    'Created By  : Ron
    'Updated By  : Ron
    
    ''CAUTION, THE USE OF THIS SCRIPT IS AT THE USERS OWN RISK
    ''I HAVE USED THIS IN VERSION 11 AND IT APPEARS TO WORK CORRECTLY
    
    ''this script is designed to create an aex file.  Then after creating the file
    ''it will delete all scripts and udf's from the code tab.  Make a copy of your database before
    ''using this script.  The variable vcName is the name of your database.  You will need to
    ''edit this variable before running the script.
    
    DIM SHARED vcConfirm as C
    DIM SHARED vcConfirm2 as C
    
    'set the name of your database here
    dim vcName as C
    vcName = a5.Get_Path() + "\phone"  
    
    DIM SHARED vDlg_Title as C
    DIM SHARED vMsg as C
    vMsg="This Script Will Delete All Scripts And Functions While Creating An AEX File To Be Used In Place Of The Idividual Scripts And Functions."+crlf(2)+  "It is Imperative to Create An Export From The Code Tab To Backup All Scripts And Functions before continuing."
    DIM SHARED varC_result as C
    DIM XDialogStyle as P
    XDialogStyle.AccentColor = "Off White"
    XDialogStyle.Color = "Blue White"
    vDlg_Title="WARNING"
    dlg_text = <<%dlg%
    {Windowstyle=Gradient Horizontal}
    {font=calibri,15,b}{units=F}{xmargin=4,4}{ysize=.3};
    {color=red on white}
    {text=%H=R%55,7vMsg};;
    
    {color=black on white}
    {region}
    Type "YES" to Confirm:| [.10vcConfirm];
    Type "YES" to Confirm:| [.10vcConfirm2];
    {endregion};
    
    {line=0};;{justify=center,Center}
    <12,1.5OK>{sp=2}
     <*12,1.5Cancel>{sp=2}
    %dlg%
    varC_result=ui_dlg_box(vdlg_title, dlg_text, <<%code%
    %code%)
    
    IF varC_result <> "OK" THEN
    	END
    END IF
    
    
    
    'Show PleaseWait125 Function, msg declared for title
    dim shared msg as C
    dim shared curfile as C = ""
    dim count as n 
    msg = " Creating AEX File"
    count = 11
    
    PleaseWait125(.t.,msg)
    curfile = "Startup"
    pct = round((0/count)*99,0) 
    ui_modeless_dlg_refresh(msg)
    ui_yield()
    
    
    if vcConfirm = "YES" .and. vcConfirm2 = "YES" then
    	
    	'' Make AEX ---------------------------------------------------------------------------------
    	a5_compile_scripts()
    	
    	curfile = "AEX file Created"
    	pct = round((1/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    	
    	' Make new AEX temp file ---------------------------------------------------------------------
    	curfile = "copy file "+vcName+".alb to aex.dbf"
    	pct = round((2/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    	file.copy(vcName+".alb", a5.Get_Path() + "\aex.dbf")
    	
    	curfile = "copy file "+vcName+".alm to aex.fpt"
    	pct = round((3/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    	file.copy(vcName+".alm", a5.Get_Path() + "\aex.fpt")
    	
    	curfile = "copy file "+vcName+".alx to aex.cdx"
    	pct = round((4/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    	file.copy(vcName+".alx", a5.Get_Path() + "\aex.cdx")
    	
    	' add the AEX temp file to the current database -------------------------------------------------
    	curfile = "Adding the AEX table to the database"
    	pct = round((5/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    	file_add_to_db(a5.Get_Path() + "\AEX.dbf")
    	
    	xbasic_wait_for_idle()
    	
    	' Remove scrips and UDFs -------------------------------------------------------------------------
    	curfile = "Remove Scripts and UDF's"
    	pct = round((6/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    
    	t = table.open("AEX")
    	filter = "type = 'scrp' .or. type = 'gudf'"
    	t.delete_range(filter)
    	t.pack()
    	t.close()
    	
    	' Replace al* files with new dictionary -----------------------------------------------------------
    	curfile = "copy aex.dbf to "+ vcName+".alb"
    	pct = round((7/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    	file.copy(a5.Get_Path() + "\aex.dbf", vcName+".alb")
    
    	curfile = "copy aex.fpt to "+ vcName+".alm"
    	pct = round((8/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    	file.copy(a5.Get_Path() + "\aex.fpt", vcName+".alm")
    
    	curfile = "copy aex.cdx to "+ vcName+".alx"
    	pct = round((9/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    	file.copy(a5.Get_Path() + "\aex.cdx", vcName+".alx")
    	
    	' Erase the AEX temp table --------------------------------------------------------------------------
    	curfile = "Erase the temp table AEX"
    	pct = round((10/count)*99,0)
    	ui_modeless_dlg_refresh(msg)
    	ui_yield()
    	
    	dim tbl as p
    	tbl = A5.GET_PATH()+ "\aex.dbf"
    	table.erase(tbl, .t.)
    	
    	
    	PleaseWait125(.f.,msg)
    	
    	ui_msg_box("","Completed")
    	
    end if
    
    END  
    
    FUNCTION PleaseWait125 AS C (Show = .T.,msg="")
    	IF show = .F. THEN
    		IF ui_modeless_dlg_exist(msg) THEN
    			ui_modeless_dlg_close(msg)
    		END IF
    		exit function
    	END IF
    	
    	PleaseWait125 = ""
    	
    	IF msg = "" THEN
    		msg = " Creating AEX File"
    	END IF
    	
    	dim shared pct as N
    	box_code = <<%dlg%
    {background=Dirty White}
    {font=arial,26,i}
      Please Wait!     
    {'};
    {font=arial,12}
    {sp=32}{text=4pct}%;
      {progress=60pct}  {'};
    {'};
    {font=arial,9}
      {text=65curFile};
    %dlg%
    	box_event = <<%code%
    2=2
    %code%
    	ui_modeless_dlg_box(msg,box_code,box_event)
    	ui_modeless_dlg_setfocus(msg)
    	ui_modeless_dlg_refresh(msg)
    END FUNCTION
    Attached Files
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

    #2
    Re: Create an AEX file and delete all scripts and udf�s

    While that's great - and I dream of doing that when apps settle down. But they NEVER seem to, EVER.
    Always need to tweak a script or UDF.
    Sometimes I forget what exactly one does and need to check. So realistically, for me, it will remain a dream.
    I will have to live with a cluttered code tab but its all or nothing no? Can one select what stuff to AEX and what to keep handy?

    Comment


      #3
      Re: Create an AEX file and delete all scripts and udf�s

      Ray,

      Originally posted by Ray in Capetown View Post
      I will have to live with a cluttered code tab but its all or nothing no? Can one select what stuff to AEX and what to keep handy?

      The CSDA Code Utility has a function that is included called LIBMAKE, that will create an AEX with exactly the global code and objects required for specific projects. Very few people use this, but it has extreme abilities for building AEX packages.

      All of my code, for any of my utilities, is kept in exactly 1 code library, even though only a small portion are used by any specific utility to make the AEX for the utility. This is the way I can maintain pieces of code shared by many utilities. For the largest of the utilities, it takes less than a minute to create the AEX with LIBMAKE.

      There are CSDA Code Utility specific comment lines that act as directives that will allow pulling in other code objects that are required for that function/script to work automatically. Password protection on global scripts or Functions doesn't matter for the purposes of LIBMAKE, although it runs a bit faster with no passwords on used code objects

      You can also have it prompt you for it's parameters (such as which code objects) for adhoc usage, but for regular build's, it is better to have a standard piece of code that feeds the needed top-level code objects to it.

      E.g. This is an abstract of the directives from the CSDA Diag Info
      'PACKAGES ScreenCapture,A5desktop,Barcode,DiagInfo
      'DEPENDENCIES
      'INCLUDE Win_Special_FolderX(),CSDA_AEXEnum(),CSDA_Update()
      'INCLUDE ui_msg_boxX(),CSDA_DispHelp(),CSDA_A5XBasicSpeed()
      'INTERNAL win_memory_infox(),win_motherboardX(),GetCPUInfo()
      'EXTERNAL _CSDA_DiagInfo(),CSDA_HelpFlags()
      'EXCLUDE a5desktop()

      Each directive name can be spread across multiple lines if needed (as shown with the INCLUDE).
      • PACKAGES is the top level name for objects to include in the AEX build, and hence is essentially a filter to grab all code objects that should be compiled. Slows down if you have a lot of code objects because it must open every single one to see if it is in the package(s)
      • INCLUDE are code objects to include in the code object at the end of it prior to compiling (so it is NOT available as global code),
      • EXTERNAL forces the object to be external (in other words global code), even if also listed under the INCLUDE directive
      • EXCLUDE does not build that object into the AEX (even if specified under EXTERNAL or INCLUDE) and assumes it is available from some other AEX in the system
      • INTERNAL is currently unused, but basically is a list of all code objects that are internal to the current object that it directly uses
      • DEPENDENCIES is currently unused, but is a list of all code objects (internal or external, that the object requires to operate


      Each project can automatically pull in the needed objects and no unneeded ones. All of my utilities are built with it. By just specifying a package name in the LIBMAKE call, that automatically searches all code for the package name and pulls in the all the code and dependent code, making them internal functions (to a piece of code, and hence inaccessible by other global code) or scripts or functions in the AEX. Other objects (Images, toolbars, Menus) can also be added to the AEX, but they are not all accessible without advanced tools (unless you developed tools like I did to go and extract the code).

      LIBMAKE has been included in the CSDA Code Utility since it's 1st release.
      Last edited by csda1; 01-18-2013, 12:09 PM.
      Regards,

      Ira J. Perlow
      Computer Systems Design


      CSDA A5 Products
      New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
      CSDA Barcode Functions

      CSDA Code Utility
      CSDA Screen Capture


      Comment


        #4
        Re: Create an AEX file and delete all scripts and udf�s

        Thanks Ira
        At first glance right now it looks perfect.

        Comment


          #5
          Re: Create an AEX file and delete all scripts and udf�s

          Oh, and I guess there is always this one here - CompileDB from a few decades ago.

          Comment


            #6
            Re: Create an AEX file and delete all scripts and udf�s

            The one Brett shared some years ago complies to aex and later reverses that if you need to.
            I have not tried the one by Ira yet, so can not compare the 2.

            I will try it later this week.
            Dave Mason
            [email protected]
            Skype is dave.mason46

            Comment

            Working...
            X