Welcome! Log In Create A New Profile

Advanced

Indirection

Posted by jtadebruin 
Indirection
January 27, 2024 10:46AM
Hey,

Can someone help me on how to use indirection with an array in a database field?

[help.windev.com]


TIA smiling smiley
Re: Indirection
January 27, 2024 01:13PM
Hi,

referencing an item, the straight way

MyVariable = MyFileName.MyItemName[17]

I don't know what's your wish wen using the indirect way, but let's

FOR i = 1 to 20
MyVariable = {"MyFile.MyItem["i"]"}
END

Is there something else?

Kind regards,
Guenter Predl
office@windev.at
Re: Indirection
January 27, 2024 02:07PM
Hey Guenther

Your example is not working and the code below is not working too
Trace({"TblArtikelen.Collie_enheidomschrijving[[%i%]]",indItem})
Trace({"TblArtikelen.Collie_enheidomschrijving"+"[[%i%]]",indItem})

ERROR IS
'TblArtikelen.Collie_enheidomschrijving[1]' element unknown.
but this works
Trace(TblArtikelen.Collie_enheidomschrijving[1])
Re: Indirection
January 27, 2024 03:42PM
Hello,

//I think the index should be on the outside of the indirection brackets for arrays.
Try: {"TblArtikelen.Collie_enheidomschrijving",indItem}[ i ]

Trace({"TblArtikelen.Collie_enheidomschrijving",indItem}[ i ])



Edited 3 time(s). Last edit at 01/27/2024 10:13PM by cabinetman.
Re: Indirection
January 28, 2024 11:02AM
YES!!!
That was the solution and when I see it listed like that it makes perfect sense !!!


Thanks to all and special thanks for cabinetman smileys with beer
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: