Topic: dumb question about syntax Posted: 07 Aug 2009 at 1:25pm
Hi all - I am using CR XI.
I have no knowledge at all of Crystal Syntax, Crystal Basic or Visual Basic. I know some perl. My question is a very simple one, but I've been googling all day and can't seem to find an answer, or even some sample code that addresses my question.
I would like to know how Crystal Syntax handles a block of code?
For instance, in perl you can write:
if (x > y) { x = 0; } else { x = 1; z= 4; }
Where *both* of the assignments ("x=1" and "z=4") are made if the "if" test is false.
I am trying to do the same in Crystal Syntax, but I just can't figure out how to put two statements into one block. When I do:
If (x > y) Then x := 0 Else x := 1; z := 4;
The code assigns 4 to z regardless of the tests, because it is not blocked in with the other "else" command.
I tried:
else x = 1, z = 4; else (x = 1; z = 4); else {x = 1; z = 4};
Needless to say, I am just using common sense and guessing (!). Can someone answer this very "basic" question for me? Thanks!
PS I have poured over dozens of formulas I found on the web, and not one of them ever used a "block of code" (maybe you just can't do it in CS and I am beating my head against a wall here).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum