home *** CD-ROM | disk | FTP | other *** search
- /* $VER: PB_GetSyntax.ced ENG 1.2 (24-Oct-2000) by A.Greve */
-
- sourcepath = 'PureBasic:Projects'
- cedname = 'CED:Ed'
- temp_s = 'T:pb_srch.txt'
- temp_l = 'T:pb_link.txt'
- fkey1 = 1
- fkey2 = 2
-
- /**********************************************************/
- /** Don't change the code below these lines, unless **/
- /** You know what You're doin'... **/
- /**********************************************************/
-
- cedscript1 = 'PureBasic:Extras/CygnusEd/PB_GetSyntax.ced'
- cedscript2 = 'PureBasic:Extras/CygnusEd/PB_SaveCompile.ced'
- indexfile = 'PureBasic:Help/IndexAll.guide'
- lf = '0a'x; qu = '22'x
- link = '@{'qu
- msg1b = 'Could''t open <'
- msg1c = 'Could''t create <'
- msg1d = 'Could''t find and install <'
-
- IF sourcepath == 'SOURCEPATH' THEN sourcepath = 'PureBasic:'
- IF cedname == 'CEDNAME' THEN cedname = 'ed'
- IF temp_s == 'TEMP_S' THEN temp_s = 'T:pb_srch.txt'
- IF temp_l == 'TEMP_L' THEN temp_l = 'T:pb_link.txt'
- IF (fkey1 < 1) | (fkey1 > 10) | (fkey1 == 'FKEY1') THEN fkey1 = 1
- IF (fkey2 < 1) | (fkey2 > 10) | (fkey2 == 'FKEY2') THEN fkey2 = 2
-
- OPTIONS RESULTS
- PARSE ARG srcfile
-
- IF ADDRESS() = 'REXX' THEN DO
- IF SHOW(p,'CYGNUSED') THEN DO
- ADDRESS 'CYGNUSED'
- CEDTOFRONT
- IF srcfile ~= '' THEN DO
- OPEN NEW
- IF ~RESULT THEN OKAY1 "Couldn't open a new View!"
- ELSE OPEN qu''srcfile''qu
- END
- InstScript()
- END
- ELSE DO
- IF ~SHOW('L','rexxsupport.library') THEN DO
- IF ~ADDLIB('rexxsupport.library',10,-30,0) THEN DO
- SAY msg1b'rexxsupport.library> !'
- EXIT(0)
- END
- END
- IF ~SHOW('L','rexxtricks.library') THEN DO
- IF ~ADDLIB('rexxtricks.library',10,-30,0) THEN DO
- SAY msg1b'rexxtricks.library> !'
- EXIT(0)
- END
- END
- IF ~SHOW('L','rexxreqtools.library') THEN DO
- IF ~ADDLIB('rexxreqtools.library',10,-30,0) THEN DO
- SAY msg1b'rexxreqtools.library> !'
- EXIT(0)
- END
- END
- IF ~SHOW('L','amigaguide.library') THEN DO
- IF ~ADDLIB('amigaguide.library',10,-30,0) THEN DO
- SAY msg1b'amigaguide.library> !'
- EXIT(0)
- END
- END
-
- IF srcfile = '' THEN DO
- filename = RTFILEREQUEST(sourcepath,,'Please select a PureBasic script...',,,
- 'rtfi_matchpat=#?.pb rtfi_flags=freqf_patgad')
- IF filename ~= '' THEN ADDRESS COMMAND cedname' 'qu''filename''qu
- ELSE ADDRESS COMMAND cedname
- END
- ELSE ADDRESS COMMAND cedname' 'qu''srcfile''qu
-
- ADDRESS 'CYGNUSED'
- CEDTOFRONT
- InstScript()
-
- IF READFILE(indexfile, 'index') THEN DO
- j = 0
- DO i = 1 TO index.0
- IF WORD(index.i, 1) = link THEN DO
- j = j + 1
- indsrch.j = WORD(index.i, 2)
- tmp = WORD(index.i, 5)
- indlink.j = LEFT(tmp, LENGTH(tmp) - 1)
- indlink.j = CENTER(indlink.j, LENGTH(indlink.j) - 2)
- END
- END
- DROP index.
- indsrch.0 = j; indlink.0 = j
- IF ~WRITEFILE(temp_s, 'indsrch') THEN DO
- SAY msg1c''temp_s'> !'
- EXIT(0)
- END
- IF ~WRITEFILE(temp_l, 'indlink') THEN DO
- SAY msg1c''temp_l'> !'
- EXIT(0)
- END
- END
- ELSE SAY msg1b''indexfile'> !'
-
- EXIT(0)
- END
- END
-
- ADDRESS COMMAND 'Version >NIL: amigaguide.library 40'
- aguidever = RC
-
- IF ~READFILE(temp_s, 'indsrch') THEN DO
- SAY msg1b''temp_s'> !'
- EXIT(0)
- END
- IF ~READFILE(temp_l, 'indlink') THEN DO
- SAY msg1b''temp_l'> !'
- EXIT(0)
- END
-
- CEDTOFRONT
- GETWORD
- theword = RESULT
- IF RIGHT(theword, 1) == lf THEN
- theword = LEFT(theword, LENGTH(theword) - 1)
- GETCHAR
- thechar = RESULT
- charpos = INDEX('#&()*:;@\', thechar)
- IF (theword ~= 0) | (charpos > 0) THEN DO
- SELECT
- WHEN charpos > 0 THEN theword = thechar
- WHEN FIND('B L S UB UL UW W', UPPER(theword)) > 0 THEN DO
- LEFT
- GETWORD
- IF RESULT = '.' THEN theword = '.'theword
- RIGHT
- END
- OTHERWISE
- NOP
- END
- num = RXTR_LSEARCH(theword, 'indsrch', 1)
- IF num > 0 THEN DO
- STATUS PUBSCREENNAME
- ps_name = RESULT
- IF ps_name == '' THEN ps_name = 'Workbench'
-
- IF aguidever = 5 THEN
- CALL SHOWNODE(ps_name, RXTR_PATHPART(indlink.num), RXTR_FILEPART(indlink.num),)
- ELSE
- CALL SHOWNODE(ps_name, RXTR_PATHPART(indlink.num), RXTR_FILEPART(indlink.num),,)
- END
- ELSE OKAY1 'Couldn''t get information about'lf'<'theword'> !'
- END
- EXIT(0)
-
- InstScript:
- IF EXISTS(cedscript1) THEN "INSTALL DOS/AREXX COMMAND" fkey1 cedscript1
- ELSE SAY msg1d''cedscript1'> !'
-
- IF EXISTS(cedscript2) THEN "INSTALL DOS/AREXX COMMAND" fkey2 cedscript2
- ELSE SAY msg1d''cedscript2'> !'
- RETURN 0
-