21 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for ffonz

I managed to get the value of an enum via reflection. I have to use reflection since I have different objects with enums in them. But how do I get the name of the enum? Let's say I have [CODE] enum MyEnum { A, B } [/CODE] I can get …

Member Avatar for Oscar_5
0
8K
Member Avatar for ddanbe

Maybe a bit silly question, but in one of my projects I needed an enum and I suddenly wondered what would be the best place for it to write it in a file. Should it be in a .cs file of his own or could I place it in the …

Member Avatar for RichardGalaviz
0
381
Member Avatar for ParPau

Having issues with array. Seems to pull in the enum files (month and average rainfall) and print accordingly. Also seems to read in the updated rainfall per month. However, problem is I can not make updated print with the enum. Also, last line in program has ..."actual[i]". If use a …

Member Avatar for ParPau
0
274
Member Avatar for pwolf

one of my goals for this year is to learn java, and I found an excuse to get started lately. So over hte last couple of hours I have been reading tutorials and the likes, and started following the advice from this post http://www.daniweb.com/software-development/java/threads/99132/starting-java-java-tutorials-resources-faq As such I am up to …

Member Avatar for JamesCherrill
0
343
Member Avatar for rahul_29

<?php mysql_select_db("store"); $t="SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'stoke' AND COLUMN_NAME = 'catogory'"; $q=mysql_query($t); while($r=mysql_fetch_array($q)) { $y=$r['COLUMN_TYPE']; $u=explode("','",substr($y,6,-2)); //print_r($u); ?> <select name="category" > <option value="">Select Category:</option> <?php foreach($u as $option) { print("<option>$option</option> "); } ?> </select> <?php } ?>

0
178
Member Avatar for Labdabeta

I need to know which of these three copies of code is considered best. I also need to which one is more efficient memory wise and which is more efficient time wise. Thanks: enums [CODE]enum MyEnum{EnumTypeOne=1,EnumTypeTwo=2,EnumTypeThree=4,EnumTypeFour=8};[/CODE] macros [CODE]#define EnumTypeOne 1 #define EnumTypeTwo 2 #define EnumTypeThree 4 #define EnumTypeFour 8 typedef …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for amvx86

Hello all, I am trying to get a bunch of sub-keys and values from the registry in vb 2010 and i remember in vb6 this was quite easy. Can anyone share code to help? Or a link where I can go? I've been searching for nearly 8 hours on line …

Member Avatar for amvx86
0
2K
Member Avatar for UKnod

I have a warning that I can;t get rid of: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. I am pretty sure it is becasue I have not dimentioned the variable but how do you dimention an IO.memorystream. …

Member Avatar for UKnod
0
277
Member Avatar for tingwong

Hello all. For my project I have to create a snack machine with mints and cookies. So far I have gotten an array of cookies with the code below. However an interesting problem I'm having is my output: OATMEAL cookie LEMON cookie null CHOCOLATE_CHIP cookie OATMEAL cookie LEMON cookie null …

Member Avatar for JamesCherrill
0
1K
Member Avatar for poloblue

Good Afternoon, I'm having trouble with loops that deal with enumeration. So far I have this code #include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdlib> #include <iomanip> using namespace std; int main( ) { //enumerate type definition enum weekDays {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday,Sunday}; //variable …

Member Avatar for Lucaci Andrew
0
292
Member Avatar for phummon

Hola code gurus, I’m wondering if there’s a way to use a string to access a specific item in a matrix of int[X]. I have a program which uses enums as iterators to reference a large amount of data. To select an item in the matrix, the user will enter …

Member Avatar for phummon
0
317
Member Avatar for cheiL

I'm working on a *soap message *to send to a client system. I must use the client's predefined data types specified on their soap to send my message. Theres alot of arrays and enumerators used and my code gives the following error: > Error 1 Cannot implicitly convert type 'UpdateRatePs._Default.Rate.AvailAppType' …

Member Avatar for cheiL
0
259
Member Avatar for radiat

I'm studying enumeration at the minute and i've a quick question. In the following code using enum, are you limited to ouputting the sequence number of the possible values, or can you use the enum operator to output the text "green"? [CODE] #include <iostream> #include <sstream> #include <fstream> #include "conio.h" …

Member Avatar for Ab000dy_85
0
179
Member Avatar for Twistar

I am making a simple blackjack game. I have now made the deck which i can draw cards from. But I don't know how to get the values from each card so that i can add them together. I have a card class named Kort with the enum: [CODE]public enum …

Member Avatar for Twistar
0
265
Member Avatar for schoolboy2010

Holler fellow programmers I have an error that's been bugging me for almost a day now: I keep getting 14 of this error: class, interface, or enum expected Yes, 14 different exact same error message basically for every line of code in the inputGetter method below. Can someone please help... …

Member Avatar for JeffGrigg
0
4K
Member Avatar for tdba.316

After a few months of learning and practicing C++ with the book C++ Primer Plus through Chapter 7, I decided to do myself a little simple program. I started with the decision to try splitting my program into multiple files, and I decided to collect all shared declarations/definitions (*) into …

Member Avatar for tdba.316
0
2K
Member Avatar for daudiam

I was reading an SCJP book by Khalid Mughal and I came across a statement [QUOTE]Enum constants are static members[/QUOTE] and another [QUOTE]Enum constant is an instance of its enum type[/QUOTE]. I am unable to reconcile the 2 statements. Are the constants static members or are they instances ? (Instances …

Member Avatar for daudiam
0
361
Member Avatar for amit.hak50
Member Avatar for griswolf

I need to keep track of the status for a person who registers for an event. This is going to be part of a tool that is administered by non-programmers. Various events will have different sets of status values, and it is possible for several events with distinct or overlapping …

Member Avatar for pritaeas
0
157
Member Avatar for Geekitygeek

I'm currently re-writing a bit of code and i'm in two minds about which way to take it. Advice would be greatly appreciated :) The application is used to control a USB circuit board. The board has 32 analog outputs. The outputs are switched on and off by sending a …

Member Avatar for Geekitygeek
0
191
Member Avatar for ddanbe

Hi all, The following does work, but not as I expected. If I use an enum I normally don't have to prefix it with a class name. Here it seems the only option. Can anyone tell me why? [CODE=c#]namespace ConsoleApplication1 { class Program { static void Main(string[] args) { MyEnums …

Member Avatar for ddanbe
0
88

The End.