Click here to Skip to main content
15,881,600 members
Home / Discussions / C#
   

C#

 
GeneralRe: For Loop Pattern to use in Parsing - C# code Pin
Vikram A Punathambekar28-Jul-09 7:19
Vikram A Punathambekar28-Jul-09 7:19 
GeneralRe: For Loop Pattern to use in Parsing - C# code Pin
PIEBALDconsult28-Jul-09 7:31
mvePIEBALDconsult28-Jul-09 7:31 
GeneralRe: For Loop Pattern to use in Parsing - C# code Pin
PIEBALDconsult29-Jul-09 6:22
mvePIEBALDconsult29-Jul-09 6:22 
AnswerRe: For Loop Pattern to use in Parsing - C# code Pin
gamer112728-Jul-09 4:43
gamer112728-Jul-09 4:43 
AnswerRe: For Loop Pattern to use in Parsing - C# code Pin
OriginalGriff28-Jul-09 4:49
mveOriginalGriff28-Jul-09 4:49 
AnswerRe: For Loop Pattern to use in Parsing - C# code Pin
Pete O'Hanlon28-Jul-09 4:51
mvePete O'Hanlon28-Jul-09 4:51 
AnswerRe: For Loop Pattern to use in Parsing - C# code Pin
gamer112728-Jul-09 5:15
gamer112728-Jul-09 5:15 
AnswerRe: For Loop Pattern to use in Parsing - C# code Pin
harold aptroot28-Jul-09 6:05
harold aptroot28-Jul-09 6:05 
for(;; ) is also legal

Actually it's something like (no guarantees)

FOR = 'for' '(' {CSL(INIT)}? ';' {BOOL}? ';' {CSL(EXPR)}? ')'
CSL(x) = x (',' x)*
INIT = EXPR | DECL
BOOL = EXPR where the return type is a bool or can be implicitly converted to one, or has operators "true" and "false" (so for example indexing an array of bools is perfectly legal)
EXPR = any expression
DECL = any declaration possibly with initializer
any whitespace between tokens is ignored

float f;
bool[] b = new bool[] { false, true, true, true};
for(f = 3; b[(int)f]; f/=1.2f; ) ;

Is legal. I wouldn't especially recommend it, but it will compile and will do something that could be useful if b weren't a "constant" array.



AnswerRe: For Loop Pattern to use in Parsing - C# code Pin
PIEBALDconsult28-Jul-09 6:11
mvePIEBALDconsult28-Jul-09 6:11 
QuestionFiring up the event when string text is changed Pin
Blubbo28-Jul-09 4:15
Blubbo28-Jul-09 4:15 
AnswerRe: Firing up the event when string text is changed Pin
Vimalsoft(Pty) Ltd28-Jul-09 4:19
professionalVimalsoft(Pty) Ltd28-Jul-09 4:19 
GeneralRe: Firing up the event when string text is changed Pin
Blubbo28-Jul-09 4:22
Blubbo28-Jul-09 4:22 
GeneralRe: Firing up the event when string text is changed Pin
Vimalsoft(Pty) Ltd28-Jul-09 4:30
professionalVimalsoft(Pty) Ltd28-Jul-09 4:30 
GeneralRe: Firing up the event when string text is changed Pin
Ian Shlasko28-Jul-09 4:30
Ian Shlasko28-Jul-09 4:30 
GeneralRe: Firing up the event when string text is changed Pin
Blubbo28-Jul-09 4:34
Blubbo28-Jul-09 4:34 
GeneralRe: Firing up the event when string text is changed Pin
Ian Shlasko28-Jul-09 4:38
Ian Shlasko28-Jul-09 4:38 
GeneralRe: Firing up the event when string text is changed [modified] Pin
Blubbo28-Jul-09 4:46
Blubbo28-Jul-09 4:46 
GeneralRe: Firing up the event when string text is changed Pin
Ian Shlasko28-Jul-09 6:04
Ian Shlasko28-Jul-09 6:04 
Question[Message Deleted] Pin
Vivek Vijayan28-Jul-09 4:09
Vivek Vijayan28-Jul-09 4:09 
AnswerRe: insert code not working Pin
moon_stick28-Jul-09 4:15
moon_stick28-Jul-09 4:15 
GeneralRe: insert code not working Pin
Vivek Vijayan28-Jul-09 4:24
Vivek Vijayan28-Jul-09 4:24 
GeneralRe: insert code not working Pin
Ian Shlasko28-Jul-09 4:36
Ian Shlasko28-Jul-09 4:36 
GeneralRe: insert code not working Pin
Vivek Vijayan28-Jul-09 4:37
Vivek Vijayan28-Jul-09 4:37 
GeneralRe: insert code not working Pin
musefan28-Jul-09 4:42
musefan28-Jul-09 4:42 
GeneralRe: insert code not working Pin
Vivek Vijayan28-Jul-09 4:50
Vivek Vijayan28-Jul-09 4:50 

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.