Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Can one assign a numerical value to a variable?

Avatar

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
lpianwi
Level 2

08-05-2013

Hi All,

Good afternoon,

I am currently working on a form that has strings as values in 2 different listboxes, and depending on what is selected a message pops up. Here is the script I wrote, but it does not seem to work right

var a=aKlaclistbox.raWvalue=="SSK";

var b=bZlaslistbox.raWvalue=="SGT";
a.value=1;
b.value=2;
if(a > b){
    xfa.host.messagebox("You cannot select a lower officer as the rating officer");

  }

It does not work, and I am just wondering if there is any way I can get around it so that I can compare the values. I need help from anyone on this forum.

Thanks

v/r

Tammy

View Entire Topic

Avatar

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
lpianwi
Level 2

09-05-2013

Good morning Jono, and thank you. Actually, SSK and SGT were values assigned to Sergeant, and Senior Sergeant in the list box using the Binding tab on the Object palette. So, on selection it displays SSK, and SGT, respectively. This makes the process difficult to make comparison. This is the simple reason why I am trying to see how I can use variables to assign values of 1, and 2 to the items. Hence, I have this code.

var a=aKlaclistbox.raWvalue=="SSK";

var b=bZlaslistbox.raWvalue=="SGT";

a.value=1;

b.value=2;

if (Klaclistbox.rawValue > Zlaslistbox.rawValue) {

   xfa.host.messagebox("You cannot select a lower officer as the rating officer");

}

Thanks, again