ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / String functions
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
ExtractLine (Function)
In french: ExtraitLigne
Extracts a specific line from a character string.
Example
// Extract line 5 from the "test.txt" file
sContent is string = fLoadText("C:\test.txt")
sLine5 is string = ExtractLine(sContent, 5)
// Extract line 5 from the EDT_Info multiline Edit control
sLine5 is string = ExtractLine(EDT_Info, 5)
Syntax
<Result> = ExtractLine(<Initial string> , <Line number>)
<Result>: Character string
  • Content of the extracted line.
  • EOT if the line number is unknown.
<Initial string>: Character string
Character string in which the line is searched for.
<Line number>: Integer
Number of the search line. This line number is between 1 and the total number of lines in <Initial string>. Lines are split by carriage returns (CR).
Business / UI classification: Neutral code
Component: wd290vm.dll
See also
Minimum version required
  • Version 18
This page is also available for…
Comments
Exemplo extractLine

_conteudo is string = fLoadText("d:\importa\teste.txt")
EDT_Texto = ""
n_contador is int=0
LOOP
n_contador++
sLinha is string=ExtractLine(_conteudo,n_contador)

IF sLinha=EOT THEN
BREAK
ELSE
EDT_Texto+=sLinha+CR
END
END

//Blog com Video e Exemplo

http://windevdesenvolvimento.blogspot.com.br/2016/10/aula-951-windev-string-24-extractline.html

https://www.youtube.com/watch?v=_fCBatSQilU

De matos
25 Oct. 2016

Last update: 05/26/2022

Send a report | Local help