Click here to Skip to main content
15,909,652 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Constructing a tree Pin
David Crow12-Oct-06 5:56
David Crow12-Oct-06 5:56 
Questionrepresent string as its DWORD value Pin
Makakuin12-Oct-06 3:37
Makakuin12-Oct-06 3:37 
AnswerRe: represent string as its DWORD value Pin
Mark Salsbery12-Oct-06 4:48
Mark Salsbery12-Oct-06 4:48 
GeneralRe: represent string as its DWORD value Pin
Makakuin12-Oct-06 7:20
Makakuin12-Oct-06 7:20 
GeneralRe: represent string as its DWORD value Pin
Mark Salsbery12-Oct-06 7:43
Mark Salsbery12-Oct-06 7:43 
AnswerRe: represent string as its DWORD value Pin
Zac Howland12-Oct-06 7:24
Zac Howland12-Oct-06 7:24 
GeneralRe: represent string as its DWORD value Pin
Makakuin12-Oct-06 7:41
Makakuin12-Oct-06 7:41 
GeneralRe: represent string as its DWORD value Pin
Zac Howland12-Oct-06 7:56
Zac Howland12-Oct-06 7:56 
Makakuin wrote:
Thanx for reply - ill stick to using switch() or that kind of stuff in this case, but the method for storing ONESTOPBIT e.g as string and then read back its defined DWORD value still bothers me - I want to figure it out


Are you saying you want to store it like this:

; Valid values are ONESTOPBIT, ONE_5STOPBIT, TWOSTOPBIT
StopBits=ONESTOPBIT


or like this:

; Value values are 1, 1.5, 2
StopBits=1


In the first case, just use string comparisons. In the second, you have a couple options as well: Read them in as floats and use conditionals to set them to the proper setting (a bit risky since precision can be an issue), or force the values to be multiples of 10x so the file would look like this instead:

; Value values are 10, 15, 20
StopBits=10


Then simply use a switch statement to convert those integers to the proper defined values for stop bits.

Your best bet for making it easily readable is still to use XML and create a schema to validate it against so that you can let the parser determine if you have valid values before you even look at the data.

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

GeneralRe: represent string as its DWORD value [modified] Pin
Makakuin12-Oct-06 9:09
Makakuin12-Oct-06 9:09 
GeneralRe: represent string as its DWORD value Pin
Zac Howland12-Oct-06 9:16
Zac Howland12-Oct-06 9:16 
GeneralRe: represent string as its DWORD value Pin
Makakuin12-Oct-06 10:00
Makakuin12-Oct-06 10:00 
GeneralRe: represent string as its DWORD value Pin
Zac Howland12-Oct-06 10:03
Zac Howland12-Oct-06 10:03 
GeneralRe: represent string as its DWORD value Pin
Makakuin12-Oct-06 9:28
Makakuin12-Oct-06 9:28 
QuestionRe: represent string as its DWORD value Pin
David Crow12-Oct-06 9:34
David Crow12-Oct-06 9:34 
QuestionResource.h File Checking Pin
Andy20212-Oct-06 3:12
Andy20212-Oct-06 3:12 
AnswerRe: Resource.h File Checking Pin
Hamid_RT12-Oct-06 3:20
Hamid_RT12-Oct-06 3:20 
GeneralRe: Resource.h File Checking Pin
David Crow12-Oct-06 3:50
David Crow12-Oct-06 3:50 
GeneralRe: Resource.h File Checking Pin
Maximilien12-Oct-06 7:20
Maximilien12-Oct-06 7:20 
GeneralRe: Resource.h File Checking Pin
David Crow12-Oct-06 7:28
David Crow12-Oct-06 7:28 
GeneralRe: Resource.h File Checking Pin
Grahamfff12-Oct-06 9:41
Grahamfff12-Oct-06 9:41 
GeneralRe: Resource.h File Checking Pin
David Crow12-Oct-06 10:11
David Crow12-Oct-06 10:11 
AnswerRe: Resource.h File Checking Pin
toxcct12-Oct-06 3:26
toxcct12-Oct-06 3:26 
GeneralRe: Resource.h File Checking Pin
Galatei12-Oct-06 7:41
Galatei12-Oct-06 7:41 
GeneralRe: Resource.h File Checking Pin
Blake Miller13-Oct-06 4:32
Blake Miller13-Oct-06 4:32 
QuestionC on UNIX Question Pin
Yadrif12-Oct-06 2:34
Yadrif12-Oct-06 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.