PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 25 → Como ler Objetos de uma janela e guardar eles em um array multidimensional?
Como ler Objetos de uma janela e guardar eles em um array multidimensional?
Started by Boller, Dec., 21 2021 6:43 PM - 1 reply
Registered member
3,401 messages
Popularité : +175 (223 votes)
Posted on December, 21 2021 - 6:43 PM
Solução

Procedure ObjectsRead()

ArrayDeleteAll(arrayObjetos)
Dimension(arrayObjetos,1,2)
X is int = 1
sParentName is string = MyWindow..Name
nSubscript is int = 1
sNameChildControl is string
sControlInfo is string = gpwEnumControl(sParentName, nSubscript)
WHILE sControlInfo <> ""
//Trace(sControlInfo)
sNameChildControl = ExtractString(sControlInfo, 1, TAB)
//Trace(sNameChildControl)
//################################################
IF StringCount(sNameChildControl,"SC_AreaPlotagem.EDT_",IgnoreCase) > 0 THEN
obj is string = Replace(sNameChildControl,"SC_AreaPlotagem.EDT_","",IgnoreCase)
arrayObjetos[X,1] = obj
Trace(obj)
arrayObjetos[X,2] = {sNameChildControl,indControl}..Value
Trace({sNameChildControl,indControl}..Value)
X++
Dimension(arrayObjetos, X, 2)
END
//################################################
nSubscript++
sControlInfo = gpwEnumControl(sParentName, nSubscript)
END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Registered member
3,401 messages
Popularité : +175 (223 votes)
Posted on December, 21 2021 - 6:49 PM
Criando controles em Runtime

// Summary: <specify the procedure action>
// Syntax:
//CreateCamposRuntime (<gNomeRelatorio>, <gParametersReletario>)
//
// Parameters:
// gNomeRelatorio:
// gParametersReletario: <specify the role of gParametersReletario>
// Example:
// <Specify a usage example>
//
Procedure CreateCamposRuntime(gNomeRelatorio, gParametersReletario)

OBJ is string

xControl is Control

i,y is int = 0

total is int = StringCount(gParametersReletario,";",IgnoreCase)

//TITULO

OBJ = "SC_AreaPlotagem.STC_TextoX"
xControl <- ControlClone(STC_Texto, OBJ)
xControl.Width = STC_Texto.Width
xControl.X = 30
xControl.Y = 30
xControl.Caption = gNomeRelatorio

//CAMPOS
LOOP (total)
i++
IF i = 1 THEN
y = 75
ELSE
y+= 35
END
OBJ = "SC_AreaPlotagem.EDT_"+ NoSpace(ExtractString(gParametersReletario, i, ";", FromBeginning),sscAll)
xControl <- ControlClone(EDT_Texto, OBJ)
xControl.Width = EDT_Texto.Width
xControl.X = 35
xControl.Y = y
xControl.Caption = ExtractString(gParametersReletario, i, ";", FromBeginning)
END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/