PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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 multiline EDT_Info edit control
sLine5 is string = ExtractLine(EDT_Info, 5)
Syntax
<Result> = ExtractLine(<Source string> , <Line number>)
<Result>: Character string
  • Content of the extracted line.
  • EOT if the line number is unknown.
<Source string>: Character string (with quotes)
Character string in which the line is sought.
<Line number>: Integer
Number of the sought line. This line number is included between 1 and the total number of lines found in <Source String>.
Business / GUI classification : Neutral code
Component : wd250vm.dll
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