Jump to content

Code Submission Guidelines


CyberSlug
 Share

Recommended Posts

The following text is by Jon, but it ended up getting deleted. I'm putting here so I it won't be lost :whistle:

Code_Submission_Spec Orginally from here

This file contains instructions on submitting code for AutoIt, it helps me if code
is submitted like this due to my lack of free time at the moment.  Code submitted
like this will take precedence over any code that I need to windiff or think about!

Note, try and keep code in the same style as the existing sources, taking note of 
naming, layout and style conventions - even if you disagree with the conventions;)
Consistancy is everything!


1. Create a text file containing all the changes to the source files you have made
   (See Code_Specification_Example.txt for an example by Larry).  Try and use the latest
   version of the sources as a comparision to aid me.

2. Modify/create the relevant html help pages

3. Compile your code into AutoIt3-test.exe

4. Create a test.au3 script that demonstrates the new/changed feature

5. Create a zipfile called "AU3-myname-date.zip" that contains:
    - AutoIt3-test.exe
    - test.au3
    - all modified script files (script.cpp, script_misc.cpp, etc.)
    - Changes.txt (as per the Code_Specification_Example.txt above)
    - Modified/created html files

6. send to support@hiddensoft.com titled "AutoIt Code Submission"


If you don't get a reply with a week then send a reminder.  It's hard keeping track of
all the emails I get and I'm a little busy with RL/Work stuff these days :(

Thanks,
Jon.

Code_Submission_Example Orginally from here

Functionality
--------------
This adds FileFindFirstFile and FileFindNextFile

Based on sources
----------------
v3.0.69


***********************************************************
******************* script.cpp
***********************************************************

in Constructor()
add
// Initialise file handles to NULL
m_hFileHandle = NULL;

in Destructor()
add
// Close any file handles that script writer has not close (naughty!)
if (m_hFileHandle != NULL)
     FindClose(m_hFileHandle);

to functions list
add
"FileFindFirstFile", "FileFindNextFile"

to parameters list 
add
{1,1}, {0,0}

to giant case structure
add
case F_FINDFIRSTFILE:
     return FileFindFirstFile(vParams[0].szValue(), vResult);
case F_FINDNEXTFILE:
     return FileFindNextFile(vResult);

***********************************************************
****************** script.h
***********************************************************

add
F_FINDFIRSTFILE, F_FINDNEXTFILE

add
HANDLE                   m_hFileHandle;           // File Handle for Find File functions

add
AUT_RESULT     FileFindFirstFile(const char *szFile, Variant &vResult);
AUT_RESULT     FileFindNextFile(Variant &vResult);


***********************************************************
***************** script_file.cpp
***********************************************************

///////////////////////////////////////////////////////////////////////////////
// FileFindFirstFile(<file>) 
// Returns the first file found according to <file> search string.
///////////////////////////////////////////////////////////////////////////////

AUT_RESULT     AutoIt_Script::FileFindFirstFile(const char *szFile, Variant &vResult)
{
          WIN32_FIND_DATA          wfd;
          HANDLE                   hFile;

          hFile = FindFirstFile(szFile, &wfd);

          if ( hFile == INVALID_HANDLE_VALUE )
          {
               SetFuncErrorCode(1);
               return AUT_OK;
          }

          m_hFileHandle = hFile;

          vResult = wfd.cFileName;
          return AUT_OK;

} // FileFindFirstFile() 


///////////////////////////////////////////////////////////////////////////////
// FileFindNextFile(<file>) 
// Returns the next file found according to a previous call to FileFindFirstFile.
///////////////////////////////////////////////////////////////////////////////

AUT_RESULT     AutoIt_Script::FileFindNextFile(Variant &vResult)
{
          WIN32_FIND_DATA          wfd;

          if ( m_hFileHandle == NULL )
          {
               SetFuncErrorCode(1);
               return AUT_OK;
          }

          if ( !FindNextFile(m_hFileHandle, &wfd) )
          {
               SetFuncErrorCode(1);
               FindClose(m_hFileHandle);
               m_hFileHandle = NULL;
          }
          else
               vResult = wfd.cFileName;

          return AUT_OK;

} // FileFindNextFile()
Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...