PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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.
Versions 20 and later
WINDEVJava This function is now available for the Java applications.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
New in version 20
WINDEVJava This function is now available for the Java applications.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
WINDEVJava This function is now available for the Java applications.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
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>.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • 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
Oct. 25 2016