Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15849

VS 2019 [RESOLVED] Refer to structure element using variable

$
0
0
Hi

If I have a simple structure set up like this:

Code:

Structure myfile

Public fullpath As String
Public numrecords As Integer
public category as string

End Structure

I can refer to the 'fullpath' element easily enough like this:

Code:

myfile.fullpath
Is there any way I can refer to an element using a variable?

So it would be something like:

Code:

myvar="fullpath"
myfile.(myvar)

Is something like this possible? I'd like to apply the technique to a list of structures.

Thanks for reading!

Viewing all articles
Browse latest Browse all 15849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>