Skip to main content
Known Participant
Feb 2, 2018 9:04 AM UTC
Answered

Hello. i have varv1 and varv2.

Hello. i have varv1 and varv2. and i want varv2<=varv1 if not it wrong

I START LIKE THIS

// Get field values as numbers

    var v1 = +getField("Textfield66").value;

    var v2 = +getField("Textfield67").value;

how can i end it?

Thanks

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Feb 2, 2018 10:43 AM UTC

maby if this will happent ,a note( v2<=v1) will apear


Add this at the end of your code:

if (v2<=v1) app.alert("Error! v2<=v1");

28 replies

Legend
Feb 5, 2018 11:05 AM UTC

Your syntax error is very clear from the message. Programmers often get this kind of error, and the solution is to carefully count brackets.

Translate
try67
Community Expert
Community Expert
Feb 2, 2018 9:17 AM UTC

What exactly do you want to happen if v2<=v1?

Translate
klothosAuthor
Known Participant
Feb 2, 2018 9:48 AM UTC

it is not allowed v2>=v1 for example if v1=100 and v2=200 this is wrong

Translate
klothosAuthor
Known Participant
Feb 2, 2018 9:52 AM UTC

maby if this will happent ,a note( v2<=v1) will apear

Translate