home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1995-08-01 | 790 b | 39 lines |
- '
- ' VARIABLE SWAPPER
- ' ** Requires the JD Extension!! **
- ' By Andrew Campbell
- '
- ' This routine simply swaps any amount of one single character
- ' contained within a string to another of your specified choice.
- ' Run the program for an example. Could be useful to somebody
- ' else, as it was very useful for me when I coded Magnetic Fiction
- ' for F1 Licenceware.
- '
- ' - AJC
- '
- Curs Off : Flash Off : Cls 0 : Hide On : Colour 1,$FFF : Pen 1 : Paper 0
-
- _XCHANGE["Get*rid*of*all*the*stars!","*"," "]
-
- Print
- Print "Press any key"
- Wait Key
- Print
-
- _XCHANGE["Swap*the*stars*for*dashes!","*","-"]
-
- Wait 20
- Edit
-
- Procedure _XCHANGE[_SOURCE$,A$,B$]
-
- _CNT= Extension_22_005A(_SOURCE$,A$)
-
- For _TM=1 To _CNT
- X=Instr(_SOURCE$,A$)
- Mid$(_SOURCE$,X)=B$
- Next _TM
-
- Print _SOURCE$
-
- End Proc