AutoHotkey Community

It is currently May 25th, 2012, 2:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: April 22nd, 2007, 1:21 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
ScriptMerge


This script provide interface to 2 functions - Join and Unjoin

Join function will join includes of an ahk source file into the script containing no includes.
File will be saved in the directory of original file with the name OriginalName _J_.ahk

Unjoin will return previously joined script to its previous file system hierarchy



Overview
    This script is to be used with complex projects containing one ore more includes. While developing, its often desired to split projects into modules for organization and maintaince reasons. However, sometimes developer wants to provide single include to users of his module but keep his developing organization.

    This script makes possible to join main script file with its includes thus making single .ahk file with no includes that is ready for distribution. Later anybody can recreate original file system structure from the previously joined file. This allows everybody to use original environment if there is a need for further development of the project or bug fixing with original structure in the place.

Remarks
  • Join function doesn't recognize 3 AHK variables allowed to use in #include (A_ScriptDir, A_AppData, A_AppDataCommon). Generaly, there is no need to use those variables anyway.
  • Unjoining script will recreate original file system structure. If there are already files with the names like those that are to be created, the new contest will be appended as FileAppend is used to create files. In final version, function will probably abort in such situations.
  • Files merged with Join function will have _J_ suffix in its name. Its good to leave this at the place so everybody can know from the scripts name if it can be unjoined. If _J_ is not present, the only way to check if script is joined is to check for its GUID, using Search function of your editor. Search for the unquoted string "B1AD529B-BF4E-477F-8B9F-3080CAC55AE3"
  • ScriptMerger is interface to Join and Unjoin functions that you can find in the script. You can use those functions for your own needs. They are documented in the source code.

This is the output for Favmenu 3 script join operation and BBCodeWriter unjoin operation (using main _J_.ahk file previously created with Join function)


History
0.92
- Bug fix
- Sufix changed to _J_ instead !J!

0.91
- Fixed bugs with comments in include lines

0.9
First version

_________________
Image


Last edited by majkinetor on January 5th, 2008, 3:21 am, edited 36 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2007, 3:47 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
This was previously visible under the name Join (includes)

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2007, 1:33 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
A utility like this has often been asked for. Perhaps I should link to it from the #Include page.

Thanks for creating it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2007, 8:39 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Perhaps.

You should definitely link common dialogs as help now points to outdated scripts.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2007, 2:04 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I've updated the Gui/DllCall/FileSelectFile/Folder pages to point to your common dialogs topic. I've also linked #Include to this topic here via: "Consequently, [#Include] generally cannot merge two isolated scripts together into one functioning script (to achieve that, see http://www.autohotkey.com/forum/topic18545.html)."

Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2007, 2:11 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
You are welcome.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Join... cool !
PostPosted: August 29th, 2007, 11:38 am 
Offline

Joined: October 27th, 2006, 11:35 am
Posts: 5
Location: BELGIUM
majkinetor wrote:
You are welcome.


Bravo for this "JOIN"
Bye from Belgium.

_________________
lucgod1 (LIEGE - BELGIUM)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2007, 12:58 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
This doesn't work if comments follow the #include directive like
Code:
#include MysubScript.ahk ; this include contains some functions to do some stuffs

The tags are present though, but without the code.

Also:
Quote:
Files merged with Join function will have !J! prefix in its name.

shouldn't it be Files merged with Join function will have !J! suffix in its name?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2007, 7:21 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Thx for reporting this.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 5th, 2007, 1:35 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
Quote:
Thx for reporting this.

You're welcome.

I've tried to fix the bug I reported, but I'm not comfortable at all with regexp.
Also, as the fix must be compatible with prior merged scripts, I'm not so sure about where to save the comments (in order to be non destructive)
If I figure something and manage to fix the bug, I'll let you know (but I guess you will be faster than me)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2007, 11:27 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
I've tried to fix the bug I reported, but I'm not comfortable at all with regexp.
Also, as the fix must be compatible with prior merged scripts, I'm not so sure about where to save the comments (in order to be non destructive)
If I figure something and manage to fix the bug, I'll let you know (but I guess you will be faster than me)

Try it now, I think I fixed it.

I don't plan to keep compatibility with older versions, I focus to keep it work correctly. Its bug fix anyway, and it seems ppl didn't use it much so far.

The next thing is that A_ScriptDir should be handled. I don't plan to to support other variables, mainly cuz of security reasons.... I wouldn't like something to write files into places others then local dir.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2007, 3:08 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
I confirm, the bug is fix.
Thank you very much.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2012, 9:13 pm 
Offline

Joined: December 2nd, 2010, 11:14 pm
Posts: 214
Location: Poland
That will probably be a necro post but anyway, if there is an #include *i library.ahk and the library file does not exist, I think the script should skip displaying the 'REMOVED!' message.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot] and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group