473,624 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Iterating through the constants in a structure

Using VS 2003, VB.NET, MSDE

Is there a way to itterate through the items in a structure? Consider the
structure below, which holds the name of wave files. I would like to
itterate through them to confirm the wave files actually exist on the hard
disk. I don't see any collection or way to do it.

I would like something like this (or anything that would work):

dim Constant as Structure_Promp ts_Constant

For each Constant in Structure_Promp ts_Constant_Col lection
' code to confirm file exists
next
------------------------------------------------------
Friend Structure Prompts

Public Const PlayPINAccessDe nied1of2 As String =
"Play_PIN_Acces s_Denied_1of2.w av"

Public Const PlayPINAccessDe nied2aof2 As String =
"Play_PIN_Acces s_Denied_2aof2. wav"

Public Const PlayPINAccessDe nied2bof2 As String =
"Play_PIN_Acces s_Denied_2bof2. wav"

End Structure

Thanks!

Bob Day
Nov 20 '05 #1
3 2644
"Bob Day" <Bo****@TouchTa lk.net> schrieb
Using VS 2003, VB.NET, MSDE

Is there a way to itterate through the items in a structure?


http://msdn.microsoft.com/library/en...natruntime.asp
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
Bob Day wrote:
Using VS 2003, VB.NET, MSDE

Is there a way to itterate through the items in a structure? Consider the
structure below, which holds the name of wave files. I would like to
itterate through them to confirm the wave files actually exist on the hard
disk. I don't see any collection or way to do it.

I would like something like this (or anything that would work):

dim Constant as Structure_Promp ts_Constant

For each Constant in Structure_Promp ts_Constant_Col lection
' code to confirm file exists
next
------------------------------------------------------
Friend Structure Prompts

Public Const PlayPINAccessDe nied1of2 As String =
"Play_PIN_Acces s_Denied_1of2.w av"

Public Const PlayPINAccessDe nied2aof2 As String =
"Play_PIN_Acces s_Denied_2aof2. wav"

Public Const PlayPINAccessDe nied2bof2 As String =
"Play_PIN_Acces s_Denied_2bof2. wav"

End Structure

Thanks!

Bob Day


How about something like

Friend Structure Prompts
Public WaveFiles() as String=New String()
{"Play_PIN_Acce ss_Denied_1of2. wav", "Play_PIN_Acces s_Denied_2aof2. wav",
"Play_PIN_Acces s_Denied_2bof2. wav"}
End Structure

then you can iterate through WaveFiles and don't need to use slow and
ugly Reflection code.

Regards,
Urs

Nov 20 '05 #3
Thanks!

Bob Day

"Bob Day" <Bo****@TouchTa lk.net> wrote in message
news:uX******** ******@TK2MSFTN GP12.phx.gbl...
Using VS 2003, VB.NET, MSDE

Is there a way to itterate through the items in a structure? Consider the
structure below, which holds the name of wave files. I would like to
itterate through them to confirm the wave files actually exist on the hard
disk. I don't see any collection or way to do it.

I would like something like this (or anything that would work):

dim Constant as Structure_Promp ts_Constant

For each Constant in Structure_Promp ts_Constant_Col lection
' code to confirm file exists
next
------------------------------------------------------
Friend Structure Prompts

Public Const PlayPINAccessDe nied1of2 As String =
"Play_PIN_Acces s_Denied_1of2.w av"

Public Const PlayPINAccessDe nied2aof2 As String =
"Play_PIN_Acces s_Denied_2aof2. wav"

Public Const PlayPINAccessDe nied2bof2 As String =
"Play_PIN_Acces s_Denied_2bof2. wav"

End Structure

Thanks!

Bob Day

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2020
by: Neo Chou | last post by:
Greetings! I have a question about constant. I have a page like: ---------------------------------------------------------------------- <% Const adInteger = 3 'copied from adovbs.inc Const ucApple = 0 'user defined constant Const ucOrange = 1 'user defined constant
4
2645
by: jsnX | last post by:
Say I would like my namespace to have some constants associated with it, like this: ========== ===== namespace broadpen { struct defaults { static const double w = 10.0; static const double r = 0.6435011087932843868;
1
367
by: mjobrien | last post by:
i created a query with the intention of creating a columnar (9 columns) report with the 10th column as a horizontal total of the records. i didn't think i needed a crosstab query because my first column is just for row title constants identifying the rows on the report. the report should look like this: Hearing ABIs Vision Mobility etc....9th Total Primary Unweighted 9999 9999 9999 9999 ........... 999999
1
1408
by: SerGioGio | last post by:
Hello, I want to build a ".lib" library where I will have some constants. The constants are not only int, char, but also struct constants. How do I declare / implement these struct constants? I came up with 3 solutions but I am really satisfied with none of them: 1. use #define This can work with constants int or char*, but not really with structures. If you have
6
4590
by: stuie_norris | last post by:
Hi Group, I am trying to define a strucutre of constants. Then switch on this structure of constant values. In the following example of my problem the code fails to compile due to: case (constants.one): In this statement, "constants.one" is not constant, but occurs in a
5
1763
by: .NET beginner | last post by:
Hi all I need to create some strings, constants etc. in my class library that need to be shared across all the classes in my class library. How do I accomplish this? Do these strings and constants have to be embedded in a class? Is there a better way to do this? Thanks for your help.
5
7040
by: Matt D | last post by:
I have a bunch of constants used in my web services that the client also needs to have. Is there a way to declare public properties that are part of a class or structure as constants or at least give them a default value through some XML shaping? Thanks.
5
1957
by: mikehulluk | last post by:
Ok, Imagine I have a class class C { }; ostream& operator<<(ostream& o, const C& c) { ...}
7
5527
by: digital.pardoe | last post by:
Hi, I have had a little programming experience with C but not enough to accomplish what I am trying to do. Nor have I been able to find any references on the internet regarding what I am trying to do. Basically, I have a structure, which I am unable to change, inside this structure are fields of an integer type that have the names: F0, F1, F2, F3, F4, F5.
0
8240
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7168
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2610
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.