For installsh... Usage suggestions

Source: Internet
Author: User
We strongly recommend that you write your own custom functions as an rul file. You only need to # include them for later use, and you can also accumulate the functions you write at ordinary times, it is also convenient to manage this. Your rul files will become larger and larger over time, and your accumulation will become more and more!
It also saves time to open the previous project when writing code and find it, which is troublesome and difficult to maintain!

Next, I will give my usual method.
Write all the functions you normally write to a coustfunction. URL.
The content of this file is as follows:
/*************************************** ******************
*
* File name: coustfunction. url
* Author :*****
* Completion date:
* Description: User-Defined Function file (This file contains two user-defined functions: 1-traversal directory
* 2-Traverse User-Defined files)
* 3-remove the read-only and hidden attributes of the specified file
* 4-end the system process
* Modification record:
* Data Structure:
* Note:
*
**************************************** *****************/


/*-----------------------------------------------------------------
Name: findcoustfile
Function: gets the size and date of the custom file under the specified directory and outputs it to findcoustfile. Snap.
Input parameter: 1 specifies the directory to be searched
2. Specify the file type to be searched. Wildcards are supported, for example :*.*;

Output parameter: The searched result is written to findcoustfile. Snap in the current directory.
/*---------------------------------------------------------------*/

Export prototype findcoustfile (byref string, byref string );
Function findcoustfile (svdir, svfile)

List listid;
Number nlinenumber;
Number count;
String svresult;
Number nvfilehandle;
Number nvresult;
String svdata;
Number nvitem;
String TMP;
String svtime;
Begin

Listid = listcreate (stringlist );
Listgetfirstitem (listid, nvitem );

While (findallfiles (svdir, svfile, svresult, continue) = 0)

Getfileinfo (svresult, file_size, nvresult, svdata );
Getfileinfo (svresult, file_date, nvresult, svdata );
Getfileinfo (svresult, file_time, nvresult, svtime );
Numtostr (TMP, nvresult );
Svresult = svresult + "" + TMP + "|" + svdata + "//" + svtime;
Listgetnextitem (listid, nvitem );
Listaddstring (listid, svresult, after );

Endwhile;

Listgetfirststring (listid, svresult );

Openfilemode (file_mode_append );
Createfile (nvfilehandle, targetdir, "findcoustfile. Snap ");

Nlinenumber = 0;
If (fileinsertline (targetdir ^ "findcoustfile. Snap", svresult, nlinenumber, after) <0) then
Abort;
Endif;

Count = listcount (listid );

For nlinenumber = 1 to count-1

Listgetnextstring (listid, svresult );
Fileinsertline (targetdir ^ "findcoustfile. Snap", svresult, nlinenumber, after );

Endfor;
Listdestroy (listid );
End;

For your own use, you only need
# Include "coustfunction. url"
Then you can directly call your own functions!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.