Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Strange Variable behavior Post Reply Post New Topic
Author Message
nalfein
Groupie
Groupie


Joined: 07 Jul 2008
Online Status: Offline
Posts: 47
Quote nalfein Replybullet Topic: Strange Variable behavior
     Posted: 18 Jun 2013 at 1:47am
Hi all

in one field I've put this code

booleanvar test=true;

I've put in the report and, surprise, when I make a preview it print false.
Dunno why and strager is that if I put this code

numbervar test=1;

It still print false!!! Is supposed to print 1 right?

Where am I wrong?

Thank you for answers
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Jun 2013 at 3:37am
you are not assigning the value you are checking to see if the value is True (or 1)
you useĀ  := to assign the vaue
booleanvar test := true;
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 18 Jun 2013 at 3:39am
HI

Here you are comparing test with true and test with 1, find below is how you can assign value to a variable

Wrong : test=true or test=1


Correct : test:=true; or test:=1
Thanks,
Sastry
IP IP Logged
nalfein
Groupie
Groupie


Joined: 07 Jul 2008
Online Status: Offline
Posts: 47
Quote nalfein Replybullet Posted: 19 Jun 2013 at 9:24pm
You're all right.
Mistake was in the syntax.
Thank you
IP IP Logged
Printable version Printable version

Forum Jump
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