Alpha Video Training
Results 1 to 20 of 20

Thread: Convert library to filesystem dictionary

  1. #1
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Convert library to filesystem dictionary

    This is an option on the right click menu of the Code Page of the desktop control panel.

    Can someone point me to the documentation for it?

    Thanks.

    -- tom

  2. #2
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    690

    Default Re: Convert library to filesystem dictionary


  3. #3
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,699

    Default Re: Convert library to filesystem dictionary

    Let us know what actually happens when you try this!
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Convert library to filesystem dictionary

    Thanks, Craig.

    I'm a bit confused about this feature. Haven't used it myself. If time permits I'll look into it this week.

  5. #5
    "Certified" Alphaholic DaveM's Avatar
    Real Name
    Dave Mason
    Join Date
    Jul 2000
    Location
    Hudson, FL
    Posts
    6,026

    Default Re: Convert library to filesystem dictionary

    I just tried this on a new db created for the purpose.
    It created a sub folder with 2 folders in it. atester.A5lib with resources and scripts as subs
    I looked at the one for scripts and got this.

    'Date Created: 08-Feb-2015 11:00:05 PM
    'Last Updated: 08-Feb-2015 11:00:05 PM
    'Created By : dave
    'Updated By : dave
    'Date Created: 08-Feb-2015 10:59:06 PM
    'Last Updated: 08-Feb-2015 10:59:06 PM
    'Created By : dave
    'Updated By : dave
    'this does nothing
    'this still does nothing

    resources contained:
    A5BLOBST   0 @  Ò Ý è  „ Ë  L      CA C contents_c contents_m vendor

    I only have one script with the line ' this does nothing
    did the filesystem dictionary
    went back and added line ' Thjis still does nothing
    Both lines then showed up.

    Not real sure why I might need this whole thing for a pure desktop app, but it seems to work as far as I have checked.
    These files were renamed like below:
    ATESTER.old_alb
    ATESTER.old_alm
    ATESTER.old_alx
    adb was not touched
    Dave Mason
    dave@aldausa.com
    Skype is dave.mason46

  6. #6
    "Certified" Alphaholic DaveM's Avatar
    Real Name
    Dave Mason
    Join Date
    Jul 2000
    Location
    Hudson, FL
    Posts
    6,026

    Default Re: Convert library to filesystem dictionary

    another note:
    There does not appear to be an honest way back from this. Make super sure you have a strong backup before you try it. The script comes up empty if the new folder is deleted and the files are renamed back the way they were.

    For me, This is one of those things that is off limits. I don't need it.
    Dave Mason
    dave@aldausa.com
    Skype is dave.mason46

  7. #7
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    690

    Default Re: Convert library to filesystem dictionary

    Tom:

    In short, it seems to be a fast way to export scripts, UDF's, and toolbars to text files for the purpose of updating clients.

    As it removes passwords, and un-encrypts to raw text, I see no value over the traditional method of overwriting the ADB , ALM, ALX, etc.

    While I appreciate the effort Alpha put into this, I see no value in my world for this feature.

    Now, anyone reading this that does not know about Alpha's Encryption and creating an AEX file, that's a big hit with me. Protecting data and scripts is the wave we all need to address.

    Anyone who better understands the reason to convert a library to a filesystem directory, I am open to a change of mindset!

    Either way, I love Alpha Software.

  8. #8
    Member
    Real Name
    Jon Moody
    Join Date
    Sep 2010
    Location
    Brackley, UK
    Posts
    222

    Default Re: Convert library to filesystem dictionary

    Craig,

    According to the wiki (see your link above), Alpha intend this to be used with an external version management system during development and for ongoing fixes and upgrades.

    Dave,

    Return back to embedded code/resources is performed by reversing the original process. You need to have the current components in the *A5lib directory and the *.old_al* files in the root directory of your project. I had to work this out having discovered yesterday that I'd somehow run a conversion on Christmas day!

  9. #9
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    690

    Default Re: Convert library to filesystem dictionary

    Jon:

    Yes, I knew that. I still see no benefits...

    If you know of benefits, please explain.

  10. #10
    Member
    Real Name
    Jon Moody
    Join Date
    Sep 2010
    Location
    Brackley, UK
    Posts
    222

    Default Re: Convert library to filesystem dictionary

    Craig,

    This is the first example I found to list benefits of using a version control system:

    As a single user the main advantages are

    Automatic backups: If you accidentally delete some file (or part of a file) you can undelete it. If you change something and want to undo it, the VCS can do so.
    Sharing on multiple computers: VCSes are designed to help multiple people collaboratively edit text files. This makes sharing between multiple computers (say your desktop and laptop) particularly easy. You do not need to bother if you always copied the newest version; the VCS will do that for you. Even if you are offline and change files on both computers, the VCS will merge the changes intelligently once you are online.
    Version control and branching: Say you published some class notes as a pdf and want to fix some typos in them while simultaneously working on the notes for next year. No problem. And you only need to fix the typos once, the VCS will merge them to the other versions.
    I'm sure there are thousands of other examples and dozens of other reasons.

    IMO one of the main problems when coding in AA is that you can't easily revert to an earlier version of a script or UDF. Forms, reports, letters etc. all have a history, but not scripts and functions. One solution to this issue is to use a VCS to manage your coding changes.

  11. #11
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    690

    Default Re: Convert library to filesystem dictionary

    Jon:

    I understand what a version control system is. I've been writing code since '82 - I'm getting old ;)

    Here's my puzzlement with regard to the topic at hand.

    1) Writing code OUTSIDE Alpha's code editor seems like an open invitation for syntax errors. It would be like writing in Notepad, yes? Since there is no XBasic aware VCS software out there, wouldn't multiple developers be forced to copy and paste as they write in Alpha, then log newer code into the VCS?

    2) All this does is export and import a single copy of the scripts and UDF's. All of them in one shot.

    In other words, a good way for multiple developers to collaborate would better be built WITHIN Alpha.

    Let's look at the Import / Export on the same code tab right click.

    1) If the export was automated to a directory of choice each time a change was made, you would have backups of each script change that could be imported to restore. (This would be similar to restoring a form to an earlier version, already available)

    That would cover your backing up concern, too.

    It would also allow a developer to select the version he wants to write on top of, on the assumption he is working on a freelance copy of the application. He could then export to the same community folder where others can pick up where he left off.

    Keep in mind that two developers can never work on the same script at the same time, so parts are delved out to individuals, then they are merged when the components are completed.

    (An simple example would be one guy writes the script, other guys write the functions used in the script - with both parties determining the arguments and results of the function before it is written.)

    I hope this explains what I, perhaps singularly, see as a better solution. I see no value in the VCS idea, as using a generic one would be little better than writing XBasic in notepad, right?

    If the programmers at Alpha really wanted to offer a solid solution, they could, fairly easily. They just need to allow the user to create a source folder in a place of choice in 'settings', and include the developers name in the name of the TXT file it creates. Also, the time and version number to the name of the file.

    Again, please see import/export.

    At any rate, I have no need, yet, for this functionality, but hope to soon. And I suspect no one is using what is there to any great success. And I doubt there will be any attempt by Alpha to address the shortcomings, so this is pretty much a dead topic.
    Last edited by CraigSchumacker; 02-10-2015 at 07:11 AM.

  12. #12
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,699

    Default Re: Convert library to filesystem dictionary

    As with most of Alpha's genie's there is an Xbasic function that can perform the same action and so it is with the export/ import of scripts and functions. How hard would it be to wrap these functions in your own code to select which scripts/ udfs you want to have back up copies of and where you want them? You could even automate these backups for all the scripts to occur in an event like the Autoexec or OnDatabaseClose while working in the development copy.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  13. #13
    Member
    Real Name
    Jon Moody
    Join Date
    Sep 2010
    Location
    Brackley, UK
    Posts
    222

    Default Re: Convert library to filesystem dictionary

    Craig,

    I wasn't trying to be awkward or funny - I genuinely believed you had got the wrong end of the stick when reading post #7 when you looked at the functionality as being of use for updating client systems. I too have no use for this functionality, but as I had implemented it by mistake(!) I thought I'd add my thoughts to the thread.

    In response to your post #11...

    1) I've no idea why anybody would want to normally code outside of Alpha, but someone must have seen a benefit or the option wouldn't exist.
    2) No, it doesn't do an import/export, it converts all your scripts, UDFs menus and toolbars etc. to text files which can then be edited either within or outside of Alpha (at least I hope that's the case or I've lost 6 weeks work)

    I like Robin's suggestion of using the export_scripts_and_udf() function for creating regular backups of code - I'll be implementing this on my developments in the next couple of days - as this should ensure I have at least a daily backup of any script changes.

    What I'd really like is a combination of the 'convert to filesystem' which creates a separate file for each script and UDF and the 'export_scripts_and_udf()' function which creates a date-stamped single text file with all scripts and UDFs concatenated.

  14. #14
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    690

    Default Re: Convert library to filesystem dictionary

    Jon:

    You sound like you think I'm upset? I am not, rest assured!

    I think what I would prefer over Robin's suggestion of 'export_scripts_and_udf()' would be a on_save event for whenever a script/function is saved.

    Or even better if Alpha Anywhere saved each automatically to it's own labeled txt file.

    Good luck with your backups. I hope it saves the day one day for you (I mean that in a nice way!).

  15. #15
    "Certified" Alphaholic DaveM's Avatar
    Real Name
    Dave Mason
    Join Date
    Jul 2000
    Location
    Hudson, FL
    Posts
    6,026

    Default Re: Convert library to filesystem dictionary

    Once you have used this, any changes in a script are auto saved to the place you had alpha put the older.

    Delete that folder and change the renamed files back and you will have nothing.

    Before you make assumptions:
    create a workspace in a new folder, add 2 tables with some data, then 2 forms with scripts of some kind, then 2 reports with scripts of some sort, then 2 scripts and 2 functions.
    Now run the export and try to figure out how to get everything back to normal(reverse the procedure).
    I went as far as I needed to find out how unimportant this is to me. That does not mean that is could not be useful to someone else.
    Dave Mason
    dave@aldausa.com
    Skype is dave.mason46

  16. #16
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    690

    Default Re: Convert library to filesystem dictionary

    Dave:

    "I went as far as I needed to find out how unimportant this is to me."

    Thanks for the laugh.

    I stumbled on this when I upgraded to version 11. Looked at what it did, tried it, scratched my head, and all but forgot about it.

    One of the reasons I lurk around this board is the hope that a thread will bring new light to some hidden jewel in the Alpha Anywhere gold mine of nuggets. With no "Desktop specific" features being added, it's become a little hum drum. It's not that there a millions of things on my wish list, but there are a few that would be nice.

    I suspect everyone who contributed here was also hoping to find something more than what appears to be there.

  17. #17
    Member
    Real Name
    Jon Moody
    Join Date
    Sep 2010
    Location
    Brackley, UK
    Posts
    222

    Default Re: Convert library to filesystem dictionary

    Well, that didn't take long...

    Code:
    'backup all scripts and UDFs to a date-stamped text file (once per day)
    'check if file exists for today. if not then export
    bkp = file.filename_parse(a5.get_name(),"DPN") + " - " + dtoc(date(),"2-") + " -1.txt"
    if file.exists(bkp) = .f. then
    	export_scripts_and_udfs()
    end if
    I have to agree with the other contributors to this post - I see absolutely no benefit to myself in converting scripts/udfs to filesystem, but I do see several pitfalls as already mentioned.

  18. #18
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,699

    Default Re: Convert library to filesystem dictionary

    What I'd really like is a combination of the 'convert to filesystem' which creates a separate file for each script and UDF and the 'export_scripts_and_udf()' function which creates a date-stamped single text file with all scripts and UDFs concatenated.
    Hi Jon,
    But using the function will still let you select from a backup which script or function you want to import using the right click Import on the code tab.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  19. #19
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Convert library to filesystem dictionary

    That would be fairly easy to create with

    a5.Udf_Enum()
    a5.Script_Enum()
    udf_load()
    script_load()
    save_to_file()

    No bells, certainly no whistles.

    Code:
    udfs = a5.Udf_Enum()
    for each udf_found in udfs
    	udf_name = word(udf_found,1,"@")
    	fil = udf_load(udf_name)
    	save_to_file(fil,"C:\temp\udf_backup_"+udf_name+".txt",.F.)
    next
    scrpts = a5.script_Enum()
    for each scrpt_found in scrpts
    	scrpt_name = word(scrpt_found,1,"@")
    	fil = script_load(scrpt_name)
    	save_to_file(fil,"C:\temp\script_backup_"+scrpt_name+".txt",.F.)
    next
    Last edited by Stan Mathews; 02-19-2015 at 05:05 PM.
    There can be only one.

  20. #20
    Member
    Real Name
    Paul Verboom
    Join Date
    Apr 2006
    Location
    Halifax, Nova Scotia, Canada
    Posts
    142

    Default Re: Convert library to filesystem dictionary

    I often come to the Forums looking for a solution to my Alpha problems. Sometimes I find clues that set me in the right direction, other times I find others trying to do the same thing I am attempting. On a few occasions I dig in and come up with the solution myself and then post the solution to a rather old topic.

    Then there are time like this, when I find the solution has already been written and I just needed to change a few lines.

    Thanks Stan.

Similar Threads

  1. Replies: 1
    Last Post: 05-22-2014, 04:02 PM
  2. Backup Workspace Issue: Saving FileSystem Reports/Code.....
    By dionmccormick in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 12-07-2012, 05:53 PM
  3. Desktop Code tab - convert library to a filesystem directory
    By Steve Workings in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 09-28-2011, 06:48 PM
  4. Dictionary
    By Fletch in forum Alpha Five Version 7
    Replies: 2
    Last Post: 03-28-2006, 06:53 PM
  5. DICTIONARY.OPEN()
    By KONG XIONG in forum Alpha Five Version 4
    Replies: 1
    Last Post: 10-14-2000, 11:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •