docs

Home All functions Categories

vuReplaceCharsInFile(FileName, OldStrg, NewStrg)

vuReplaceCharsInFile(*CSTRING, *CSTRING, *CSTRING), Long

Description

Searches through a text file and replaces all occurrences of OldStrg with NewStrg. The replacement substring does not need to be the same length as the original.

Parameters

Parameter Data Type Description
FileName CSTRING(256) Fully qualified path and filename of the file to modify.
OldStrg CSTRING(128) The substring you wish to replace.
NewStrg CSTRING(128) The substring to replace OldStrg with.

Returns

A LONG value:

Example

FileName = 'C:\Temp\myfile.txt'
OldStrg  = 'Windows XP'
NewStrg  = 'Windows Vista'

IF vuReplaceCharsInFile(FileName, OldStrg, NewStrg)
  MESSAGE('Text replaced successfully in ' & FileName)
ELSE
  MESSAGE('Failed to replace text in file.')
END

Notes

Home All functions Categories