home *** CD-ROM | disk | FTP | other *** search
- /* $VER: GoFetchRefs.FPL 1.1 (13.2.95)
- *
- * - Enables you to use the FetchRefs program by Anders Melchiorsen.
- *
- * Made by Mogens Isager (2:235/419.9@fidonet)
- *
- */
-
-
- export void FetchRefsPrefs()
- {
- PromptInfo(-1, "FetchRefs preferences", -1, -1,
- "FetchRefs_Path",
- "FetchRefs_Index",
- "FetchRefs_Arexx"
- );
- }
-
- export void FetchRefsLoaded()
- {
- if ( FindPort("FETCHREFS") )
- {
- FetchRefs();
- }
- else
- {
- if ( System( sprintf( "Run <>nil: %sFetchRefs FILES=%s", ReadInfo("FetchRefs_Path"), ReadInfo("FetchRefs_Index") ) ) == 0)
- {
- FetchRefs();
- }
- else
- {
- Request("Sorry, could not load FetchRefs.\nCheck the FetchRefs_Path info variabel", "GoFetchRefs Information", "Damn!");
- }
- }
- }
-
-
- export void FetchRefs()
- {
- int id, result;
- string filename = "T:FetchedReference";
- string word, jones;
-
- word = GetWord();
-
- if ( strcmp( "TagList", substr( word, strlen(word) - 7, 7) ) == 0 )
- word = substr( word, 0, strlen(word) - 7);
-
- if ( strcmp( "Tags", substr( word, strlen(word) - 4, 4) ) == 0 )
- word = substr( word, 0, strlen(word) - 4);
-
- if ( strcmp( "A", substr( word, strlen(word) - 1, 1) ) == 0 )
- word = substr( word, 0, strlen(word) - 1);
-
- result = System( sprintf( "RX %sGoFetchRefs.frexxed %s %s", ReadInfo("FetchRefs_Arexx"), word, filename) );
-
- if ( result == 0 )
- {
- int views = ReadInfo("views");
- int line, result;
- string errstr, resultstring = LoadString( "T:FetchRefsResult" );
-
- interpret( resultstring );
-
- if ( result != 10 )
- {
- while (views > 0)
- {
- string file;
-
- file = ReadInfo("file_name");
-
- if ( Stricmp( file, "FetchedReference", 10) == 0 )
- views = -1;
- else
- {
- views = views - 1;
- id = NextView();
- Activate(id, 0);
- CurrentBuffer(id);
- }
- }
-
- if ( views == 0 )
- {
- id = New();
- Activate(id);
- CurrentBuffer(id);
- }
- Load("T:FetchedReference");
- GotoLine( line );
- }
- System("Delete >nil: T:FetchedReference T:FetchRefsResult");
- }
- else
- {
- Request("Sorry, could not find the Arexx script.\nCheck the FetchRefs_Arexx info variabel.", "GoFetchRefs Information", "Damn!");
- }
- }
-
- AssignKey("FetchRefs();", "control f control f");
- AssignKey("FetchRefsPrefs();", "control f control p");
-
- ConstructInfo("FetchRefs_Path", "", "", "LSW", "", 0, 0, "SYS:Tools/");
- ConstructInfo("FetchRefs_Index", "", "", "LSW", "", 0, 0, "S:FetchRefs.index");
- ConstructInfo("FetchRefs_Arexx", "", "", "LSW", "", 0, 0, "REXX:");
-