AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones Looper
  • Use conditions
  • Using the LooperBreakIndex function
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Advertencia
A partir de la versión 28 (75), LooperBreakSubscript se conserva por motivos de compatibilidad. Esta función ha sido reemplazada por LooperBreakIndex.
Returns the index of the break header and footer for a given break in a Looper control:
  • The index of the header for a given break also corresponds to the index of the first row in this break.
  • The index of the footer for a given break also corresponds to the index of the last row in this break.
Ejemplo
// The LOOP_Invoices Looper control lists the invoices of each customer
// A break is performed for each customer
// The break footer contains the TotalInvoice control 
// linked to the ATT_Total attribute
// This control displays the total of all invoices for each customer
MyRow is int = 1	// Beginning of the Looper control
BreakHeader is int		// Index of break header
BreakFooter is int		// Index of break footer
Index is int		// Index of rows
Total is int		// Total for each break

// Calculates breakage totals for the entire RepeatString field
WHILE MyRow <= LOOP_Invoices.Count
	// Reset total to 0
	Total = 0
	// Index of the current break
	BreakHeader = LooperBreakIndex(BRK_CustHeader, MyRow)
	BreakFooter = LooperBreakIndex(BRK_CustFooter, MyRow)

	// Browse the rows found in the current break
	// to calculate the total
	FOR Index = BreakHeader TO BreakFooter
		Total += ATT_Value[Index]
	END

	// Assign the total
	ATT_Total[BreakFooter] = Total

	// Go to the next break
	MyRow = BreakFooter + 1
END
Sintaxis
<Result> = LooperBreakIndex(<Break header/footer> [, <Index>])
<Result>: Integer
  • Index of the header/footer break specified in the break containing the row at index <Index>,
  • 0 if an error occurs. To get more details on the error, use ErrorInfo with the errMessage constant.
<Break header/footer>: Character string
Name of the break header or footer to be used.
This parameter can correspond to:
  • the name of the break header or break footer directly.
  • <Name of Looper control>.<Name of break header/footer>
<Index>: Optional integer
Index of one of the rows in the desired break.
If this parameter is not specified, the index of the header/footer break specified in the break containing the current row is returned.
Observaciones

Use conditions

La función LooperBreakIndex puede utilizarse en:
  • un control Looper basado en un archivo de datos,
  • un control Looper rellenado mediante programación.
WEBDEV - Código Navegador Esta función no está disponible para los controles Looper lineales. Esta función sólo está disponible para los controles Looper en modo navegador.
WEBDEV - Código ServidorPHP Esta función está disponible para los controles Looper en modo AJAX, los controles Looper en modo clásico y los controles Looper lineales.

Using the LooperBreakIndex function

It is recommended to call LooperBreakIndex once the Looper control is displayed in its entirety. Otherwise, the indexes returned by LooperBreakIndex may not correspond to the actual indexes displayed in the Looper control.
Clasificación Lógica de negocio / UI: Código UI
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

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