Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..
636 views

Performing conditional logic on a text area field

Jump to solution
I am trying to perform conditional logic on a text area field: if (textfield.length() < 1 ) { //do A"; } else { // do B } action B always gets performed - never A The same with: if (textfield == null) { //do A"; } else { // do B } B always gets actioned The same with: if (textfield.length() == 0 ) { Why is this the case
0 Likes
1 Solution

Accepted Solutions
Highlighted
Established Member..
Established Member..

Re: Performing conditional logic on a text area field

Jump to solution

Maybe you can try like the following sample:

if (system.functions.lng(system.functions.denull(operator.secRole)) == 0) {

}

View solution in original post

0 Likes
7 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Performing conditional logic on a text area field

Jump to solution
Here is the entire text: Performing conditional logic on a text area field I am trying to perform conditional logic on a text area field: if (textfield.length() < 1 ) { //do A"; } else { // do B } action B always gets performed - never A The same with: if (textfield == null) { //do A"; } else { // do B } B always gets actioned The same wit: if (textfield.length() == 0 ) Why is this these case
0 Likes
Highlighted
Established Member..
Established Member..

Re: Performing conditional logic on a text area field

Jump to solution

Why not just print the condition and you will where is the wrong.

based your code, should be 

print(textfield.length());

print(textfield);

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Performing conditional logic on a text area field

Jump to solution
It looks as though .length() does not work with [C++ object Datum] - {, , }
0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Performing conditional logic on a text area field

Jump to solution
oldcount [C++ object Datum] - {, , } represents an emply dataum - How do we test this in an if condition?
0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Performing conditional logic on a text area field

Jump to solution
How do we test for an empyt datum type field?
0 Likes
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: Performing conditional logic on a text area field

Jump to solution

HI @gdurso  

Try lng method

if (system.functions.lng(textfield)<0){
//do staff
}
else {
//do staff
} 

HTH.

0 Likes
Highlighted
Established Member..
Established Member..

Re: Performing conditional logic on a text area field

Jump to solution

Maybe you can try like the following sample:

if (system.functions.lng(system.functions.denull(operator.secRole)) == 0) {

}

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.