Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
2
Erster Beitrag:
vor 2 Jahren, 10 Monaten
Letzter Beitrag:
vor 2 Jahren, 10 Monaten
Beteiligte Autoren:
Fabrice Harari, Ericus

[WB19]Indirection on Array

Startbeitrag von Ericus am 19.04.2015 19:10

Hi

I have an array created by means of FiletoArray. I want to export some of the fields, based on a list of fields the user added to a ListBox.

So I run through the elements in the listbox for each row of the array and store the currently selected item in the listbox to my variable sFieldname.

DocumentsArray.sFieldname is the value that I want but how to use indirection on this please?

I have tried

{"DocumentsArray"+"."+sfieldName} and all variations thereof without success.

Thanks in advance.


Ericus Steyn

Antworten:

Hello Ericus

This is the simplest way to find out what the right syntax is:

type in the correct syntax WITHOUT indirection, for one of the real cases and verify that it works

by example (i'm typing without verifying anything here):
DocumentsArray.CompanyName[1]
if that is the correct syntax, you then place it inside the indirection:
{DocumentsArray.CompanyName}[1]
You add the qualifier, depending of the type of object you are working on
{DocumentsArray.CompanyName, indvariable}[1]
and then you replace the example value by the variable(s) that will contain this value
{"DocumentsArray."+sFieldName, indvariable}[1]

at this point -IF- the original line WAS WORKING and -IF- the string built by the variable CONTAINS THE RIGHT VALUE, then you have your syntax

Best regards

von Fabrice Harari - am 19.04.2015 19:22
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.