AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones Procesador de texto
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Finds all the instances of a character string and replaces them with another string:
  • in an entire Word Processing document.
  • in a fragment.
Example
// Replace all "%CustomerName%" by the customer name
DocReplace(WP_MyDocument, "%CustomerLastName%", Customer.LastName)
// Replace "Presentation" by "PRESENTATION"
DocReplace(WP_NoName1, "Presentation", "PRESENTATION", WholeWord)
Syntax
DocReplace(<Search scope> , <Text to replace> , <Replacement text> [, <Options>])
<Search scope>: Document variable, docFragment variable or control name
Element in which the find and replace must be done. This element can correspond to:
  • WINDEV the name of a Word Processing control.
  • a variable of type Document.
  • a variable of type docFragment.
<Text to replace>: Character string
Text to find and to replace in the document. If this parameter corresponds to an empty string (""), the document will not be modified.
<Replacement text>: Character string
Character string that will replace <Text to replace>. If this parameter corresponds to an empty string (""), all the occurrences of <Text to replace> will be deleted
<Options>: Optional constant (or combination of constants)
Search options for the text to replace:
IgnoreCaseCase and accent insensitive search (ignores uppercase and lowercase differences).
WholeWordSearch for the whole word (enclosed in punctuation characters or in space characters).

By default, the search is case-sensitive: the searched text and the text to find must have the same case. To perform a case-insensitive search, use the IgnoreCase constant.
Caution: The replacement does not take into account the writing direction.
Business / UI classification: UI Code
Component: wd290mdl.dll
Versión mínima requerida
  • Versión 22
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 01/03/2023

Señalar un error o enviar una sugerencia | Ayuda local