PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
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
Used to swap two rows in a two-dimensional array or in an advanced array property.
Remark: This function is equivalent to ArraySwapLine.
Versions 21 and later
PHP This function is now available for PHP sites.
WEBDEV - Browser code This function is now available in browser code.
New in version 21
PHP This function is now available for PHP sites.
WEBDEV - Browser code This function is now available in browser code.
PHP This function is now available for PHP sites.
WEBDEV - Browser code This function is now available in browser code.
Example
MyArray is array of 5 by 2 strings
MyArray[1,1] =  "A"
MyArray[1,2] =  "a"
MyArray[2,1] =  "B"
MyArray[2,2] =  "b"
MyArray[3,1] =  "C"
MyArray[3,2] =  "c"
MyArray[4,1] =  "D"
MyArray[4,2] =  "d"
MyArray[5,1] =  "E"
MyArray[5,2] =  "e"
// Swap row 2 with row 4
SwapLine(MyArray, 2, 4)
// The array contains the following elements:
// "A", "a"
// "D", "d"
// "C", "c"
// "B", "b"
// "E", "e"
Syntax
SwapLine(<WLanguage array> , <Subscript of 1st row> , <Subscript of 2nd row>)
<WLanguage array>: Array
Name of Array variable to use. This array must be a two-dimensional array.
<Subscript of 1st row>: Integer
Subscript of the first row to swap.
<Subscript of 2nd row>: Integer
Subscript of the second row to swap.
Component: wd260vm.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Exemplo SwapLine
//Exemplo SwapLine
// Exemplo de Como Mover de Posiçao os dados do Array

tabListanumeros is array of 0 int
ArrayAddLine(tabListanumeros,10)
ArrayAddLine(tabListanumeros,5)
ArrayAddLine(tabListanumeros,3)
ArrayAddLine(tabListanumeros,1)

EDT_Texto = ArrayToString(tabListanumeros)

//http://doc.windev.com/en-US/?1000020482&name=SwapLine

SwapLine(tabListanumeros,EDT_Posicao_Original,EDT_Posicao_Destino)

EDT_Resultado = ArrayToString(tabListanumeros)

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/12/aula-998-windev-array-008-swapline.html
https://www.youtube.com/watch?v=_efT2RVGIyo

De matos
15 Dec. 2016