home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1993-03-10 | 2.9 KB | 118 lines |
- ' ---------------------------------------------------------------------
- ' AMOS Professional Re-tokeniser V1.1
- ' By Francois Lionet
- ' (c) 1992 Europress Software Ltd.
- ' ---------------------------------------------------------------------
- ' This small program is an example of the power of AMOSPro Accessories!
- ' ---------------------------------------------------------------------
- Set Accessory
-
- INIT_SCREEN
-
- ' Make sure we are an accessory
- If Prg Under<>1
- R=Dialog Box(AL$,2,"This program only work as an accessory!")
- MN_QUIT
- End If
-
- ' Question the user
- R=Dialog Box(AL$,2,"Re-tokenise the current program, please confirm.")
- If R=1 : MN_QUIT : End If
-
- ' Re tokenisation loop
- ' ~~~~~~~~~~~~~~~~~~~~
- R=Dialog Box(AL$,0,"Tokenising every line. Press any key to abort.")
- Clear Key
-
- ' Open all procedures
- Call Editor Equ("AEd_UnfoldAll")
-
- ' Ask number of lines
- Ask Editor Equ("AEdAsk_NumberOfLines") : NLINES=Param
-
- ' Top of text
- Call Editor Equ("AEd_TopOfText")
-
- For N=1 To NLINES
-
- If Inkey$<>"" : E$="Tokenisation aborted." : Exit : End If
-
- Ask Editor Equ("AEdAsk_Free") : If Param<256 : E$="Buffer too small!" : Exit : End If
-
- Ask Editor Equ("AEdAsk_CurrentLine"),N : LINE$=Param$
-
- If Left$(Upper$(LINE$),9)<>"PROCEDURE"
-
- Call Editor Equ("AEd_NewLine"),0,LINE$
- If Param$<>""
- E$=Param$ : Exit
- End If
-
- End If
-
- Call Editor Equ("AEd_Down")
-
- Next
-
- If E$<>"" : R=Dialog Box(AL$,1,E$) : End If
- MN_QUIT
-
- Procedure INIT_SCREEN
-
- Global AL$
- Restore ALT
- Repeat
- Read A$ : AL$=AL$+A$
- Until A$=""
-
- Resource Screen Open 0,640,40,0
- Curs Off : Flash Off : Cls 0
- Screen Display 0,,100,,
- Wait Vbl
-
- Paper 0 : Pen 1
- Pop Proc
-
- ' QUICK RUN DIALOG BOXES
- ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ALT: Data " "
- ' One button, CANCEL
- ' ~~~~~~~~~~~~~~~~~~
- Data "SIze SW,SH;"
- Data "BAse SWidth SX -2/,SHeight SY- 2/;"
- Data "IF 0VA 0=;"
- Data "["
- Data "BOx 0,0,1,SX,SY;"
- Data "POut 1VACX,16,1VA,0,7;"
- Data "BU 0,0,0,SX,SY,0,0,0;[][SM;]"
- Data "]"
- Data "IF 0VA 1=;"
- Data "["
- Data "BOx 0,0,1,SX,SY;"
- Data "POut 1VACX,8,1VA,0,7;"
- Data "BU 1,SX112-,SY16-,96,16,0,0,1;[LI 0,0,41BP3*+,SX;PR 4MECXBP+,1,4ME,7;][BR0;BQ;]"
- Data "KY 27,0;"
- Data "BU 0,0,0,SX,SY,0,0,0;[][SM;]"
- Data "RUn 0,3;"
- Data "]"
- Data "IF 0VA 2=;"
- Data "["
- Data "BOx 0,0,1,SX,SY;"
- Data "POut 1VACX,8,1VA,0,7;"
- Data "BU 1,16,SY16-,96,16,0,0,1;[LI 0,0,41BP3*+,SX;PR 4MECXBP+,1,4ME,7;][BR0;BQ;]"
- Data "KY 13,0;"
- Data "BU 2,SX112-,SY16-,96,16,0,0,1;[LI 0,0,41BP3*+,SX;PR 3MECXBP+,1,3ME,7;][BR0;BQ;]"
- Data "KY 27,0;"
- Data "BU 0,0,0,SX,SY,0,0,0;[][SM;]"
- Data "RUn 0,3;"
- Data "]"
- Data "EXit;"
- Data ""
-
- End Proc
- Procedure MN_QUIT
- Trap Dialog Close
- Trap Screen Close 0
- Erase All : Close
- End
- End Proc