FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

TEXT

Replace characters in an Edit Field


tedd, you might wanna look at this function too as a way to "walk through" an edit field...
'=================
LOCAL FN replaceChars(fldID,old$,new$)
  '---------------------------------------
  ' Searches a text field and replaces
  ' characters from one value to another.
  '---------------------------------------

  old%=ASC(old$)
  new%=ASC(new$)
  
  GET FIELD theFld&,fldID
  LONG IF theFld&
    numChars& = {[theFld&]}
    FOR thisChar = 2 TO numChars&+1
      char = PEEK([theFld&] + thisChar)
      LONG IF char = old%
        POKE [theFld&] + thisChar,new% 
      END IF
    NEXT
    EDIT FIELD fldID,&theFld&
  END IF
  KILL FIELD theFld&
END FN
Bowerbird