Help with if statement in XPATH
Hi,
I´m using XPath to return a value for a conditional Branch in OSB, I understand that it is supposed to work with standard XPath so I post this question in this forum:
What I want to do should be simple but have not worked for me, I want to do an IF statement and to return one value in the then part or another value in else.
if the statement is acomplished I want tu return just a string and if it does not acomplish then in the else return a value from an Xpath expresion:
here something similar of what I´m trying:
if (./imp:iniciarCambio/cambios/bea:ListaDeCambios/bea:Cambio/bea:campoNombre/text() = "Name")
then M6yBilling
else ./imp:iniciarCambio/cambios/bea:companiaTipo/text()
The part that is not working is where I want to return M6yBilling if the statement acomplishes, I have tried "M6yBilling" also 'M6yBilling' and fn:string(M6yBilling) but none is working at all.
Any ideas?
Kind Regards,
Gerardo J
analytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
CASE
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
Incorporating either of these into your query should assist you in returning the desired results.
Similar Messages
-
Help with if statement in cursor and for loop to get output
I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
Here is my cursor:
/*Cursor for Email procedure. It is working Shows userid and the string
You need to update these folders*/
DECLARE
a_user varchar2(200) := null;
v_assigneduser varchar2(20);
v_folderrsn varchar2(200);
v_emailaddress varchar2(60);
v_subject varchar2(200);
Cursor c IS
SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
--MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
WHERE f.foldertype = 'HJ'
AND f.statuscode NOT IN (20, 40)
AND f.folderrsn = fp.folderrsn
AND fp.processrsn = fpa.processrsn
AND vu.userid = fp.assigneduser
AND vu.statuscode = 1
GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
ORDER BY fp.assigneduser;
BEGIN
FOR c1 IN c LOOP
IF (c1.assigneduser = v_assigneduser) THEN
dbms_output.put_line(' ' || c1.folderrsn);
else
dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
END IF;
a_user := c1.assigneduser;
v_assigneduser := c1.assigneduser;
v_folderrsn := c1.folderrsn;
v_emailaddress := c1.emailaddress;
v_subject := 'Subject: Project for';
END LOOP;
END;
The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
emailaddress
Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
v_folderrsn
v_folderrsn
etc
[email protected]......
Subject: 'Project for: ' Jim...'not updated in the last 30 days'
284087
292709
[email protected].....
Subject: 'Project for: ' Kim...'not updated in the last 30 days'
185083
190121
190132
190133
190159
190237
284109
286647
294631
322922
[email protected]....
Subject: 'Project for: Joe...'not updated in the last 30 days'
183332
183336
[email protected]......
Subject: 'Project for: Sam...'not updated in the last 30 days'
183876
183877
183879
183880
183881
183882
183883
183884
183886
183887
183888
This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
JIM......... jim@ aol.com.... 284087............. 9/28/2006.......10/5/2006...........690
JIM......... jim@ aol.com.... 292709............. 3/20/2007.......3/28/2007............516
KIM......... kim@ aol.com.... 185083............. 8/31/2004.......2/9/2006............. 928
KIM...........kim@ aol.com.... 190121............. 2/9/2006.........2/9/2006.............928
KIM...........kim@ aol.com.... 190132............. 2/9/2006.........2/9/2006.............928
KIM...........kim@ aol.com.... 190133............. 2/9/2006.........2/9/2006.............928
KIM...........kim@ aol.com.... 190159............. 2/13/2006.......2/14/2006............923
KIM...........kim@ aol.com.... 190237............. 2/23/2006.......2/23/2006............914
KIM...........kim@ aol.com.... 284109............. 9/28/2006.......9/28/2006............697
KIM...........kim@ aol.com.... 286647............. 11/7/2006.......12/5/2006............629
KIM...........kim@ aol.com.... 294631............. 4/2/2007.........3/4/2008.............174
KIM...........kim@ aol.com.... 322922............. 7/29/2008.......7/29/2008............27
JOE...........joe@ aol.com.... 183332............. 1/28/2004.......4/23/2004............1585
JOE...........joe@ aol.com.... 183336............. 1/28/2004.......3/9/2004.............1630
SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............ 1631
SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............ 1631
SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............ 1631
SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............ 1631
PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............ 48
PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............ 175
NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
[email protected]/27/2004.......3/8/2004............1631
How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
Edited by: user4653174 on Aug 25, 2008 2:40 PManalytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
CASE
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
Incorporating either of these into your query should assist you in returning the desired results. -
Hi,
First Special thanks to Kglad for the help with the AS1 to AS3 conversion.
I've been able to link up my buttons to play a different frames of the movie. this was my novice way of finally getting the programming to work.
In frame 95 I have
var myLoader:Loader = new Loader();
addChild(myLoader); var url:URLRequest = new URLRequest("page1.swf");
myLoader.load(url);
in frame 165:
var myLoader1:Loader = new Loader();
addChild(myLoader1); var url1:URLRequest = new URLRequest("page1.swf");
myLoader1.load(url1);
My buttons link to 116 which plays a frame and loads ^
in frame 226: removeChild(myLoader).
But if the user has looped back into home from another part in the movie clip then it would need to remove myLoader1 instead of myLoader.
I'm guessing there is some really dynamic way to solve the programatic nightmare i'm developing, but I'm really novice.
So what i need is an if statement for frame 226
That would do something:
if(myLoader <> null
removeChild(myLoader)
else(
removechild(myLoader1)
Anyone have a method for this?yes, you can use the same urlrequest but just change its url property:
// initialize, for example in frame 1. this is done once and never again:
var loader:Loader=new Loader();
var urlR:URLRequest=new URLRequest();
// then in frame 2, for example:
urlR.url="page1.swf";
loader.load(urlR);
// in frame 20, for example:
urlR.url="page2.swf";
loader.load(urlR);
// in frame 30, for example:
urlR.url="page3.swf";
loader.load(urlR);
//etc. if you're loading any swfs that play streams (sound or video), you'll want to add some code to this. -
Help with Switch statements using Enums?
Hello, i need help with writing switch statements involving enums. Researched a lot but still cant find desired answer so going to ask here. Ok i'll cut story short.
Im writing a calculator program. The main problem is writing code for controlling the engine of calculator which sequences of sum actions.
I have enum class on itself. Atm i think thats ok. I have another class - the engine which does the work.
I planned to have a switch statement which takes in parameter of a string n. This string n is received from the user interface when users press a button say; "1 + 2 = " which each time n should be "1", "+", "2" and "=" respectively.
My algorithm would be as follows checking if its a operator(+) a case carry out adding etc.. each case producing its own task. ( I know i can do it with many simple if..else but that is bad programming technique hence im not going down that route) So here the problem arises - i cant get the switch to successfully complete its task... How about look at my code to understand it better.
I have posted below all the relevant code i got so far, not including the swing codes because they are not needed here...
ValidOperators v;
public Calculator_Engine(ValidOperators v){
stack = new Stack(20);
//The creation of the stack...
this.v = v;
public void main_Engine(String n){
ValidOperators v = ValidOperators.numbers;
*vo = vo.valueOf(n);*
switch(v){
case Add: add(); break;
case Sub: sub(); break;
case Mul: Mul(); break;
case Div: Div(); break;
case Eq:sum = stack.sPop(); System.out.println("Sum= " + sum);
default: double number = Integer.parseInt(n);
numberPressed(number);
break;
//default meaning its number so pass it to a method to do a job
public enum ValidOperators {
Add("+"), Sub("-"), Mul("X"), Div("/"),
Eq("="), Numbers("?"); }
Notes*
It gives out error: "No enum const class ValidOperators.+" when i press button +.
It has nothing to do with listeners as it highlighted the error is coming from the line:switch(v){
I think i know where the problem is.. the line "vo = vo.valueOf(n);"
This line gets the string and store the enum as that value instead of Add, Sub etc... So how would i solve the problem?
But.. I dont know how to fix it. ANy help would be good
Need more info please ask!
Thanks in advance.demo:
import java.util.*;
public class EnumExample {
enum E {
STAR("*"), HASH("#");
private String symbol;
private static Map<String, E> map = new HashMap<String, E>();
static {
put(STAR);
put(HASH);
public String getSymbol() {
return symbol;
private E(String symbol) {
this.symbol = symbol;
private static void put(E e) {
map.put(e.getSymbol(), e);
public static E parse(String symbol) {
return map.get(symbol);
public static void main(String[] args) {
System.out.println(E.valueOf("STAR")); //succeeds
System.out.println(E.parse("*")); //succeeds
System.out.println(E.parse("STAR")); //fails: null
System.out.println(E.valueOf("*")); //fails: IllegalArgumentException
} -
Help with if statement for a beginner.
Hello, Im new to the dev lark and wondered if someone could point me in the right direction.
I have the following (working!) app that lets users press a few buttons instead of typing console commands (please do not be too critical of it, its my first work prog).
//DBS File send and Receive app 1.0
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import java.applet.Applet;
public class Buttons extends JFrame
public Buttons()
super("DBS 2");
JTextArea myText = new JTextArea ("Welcome to the DBS application." +
"\n" +
"\n\n1. If you have received an email informing you that the DBS is ready to dowload please press the \"Receive DBS\" button." +
"\n" +
"\n1. Once this has been Received successfully please press the \"Prep File\" button." +
"\n\n2. Once the files have been moved to their appropriate locations, please do the \"Load\" into PAS." +
"\n\n3. Once the \"Load\" is complete, do the \"Extract\"." +
"\n\n4. When the \"Extract\" has taken place please press the \"File Shuffle\" button." +
"\n\n5. When the files have been shuffled, please press the \"Send DBS\" Button." +
"\n\nJob done." +
"\n", 20,50);
JPanel holdAll = new JPanel();
JPanel topPanel = new JPanel();
JPanel bottomPanel = new JPanel();
JPanel middle1 = new JPanel();
JPanel middle2 = new JPanel();
JPanel middle3 = new JPanel();
topPanel.setLayout(new FlowLayout());
middle1.setLayout(new FlowLayout());
middle2.setLayout(new FlowLayout());
middle3.setLayout(new FlowLayout());
bottomPanel.setLayout(new FlowLayout());
myText.setBackground(new java.awt.Color(0, 0, 0));
myText.setForeground(new java.awt.Color(255,255,255));
myText.setFont(new java.awt.Font("Times",0, 16));
myText.setLineWrap(true);
myText.setWrapStyleWord(true);
holdAll.setLayout(new BorderLayout());
topPanel.setBackground(new java.awt.Color(153, 101, 52));
bottomPanel.setForeground(new java.awt.Color(153, 0, 52));
holdAll.add(topPanel, BorderLayout.CENTER);
topPanel.add(myText, BorderLayout.NORTH);
setSize(700, 600);
setDefaultCloseOperation(EXIT_ON_CLOSE);
getContentPane().add(holdAll, BorderLayout.CENTER);
Container c = getContentPane();
c.setLayout(new FlowLayout());
final JButton receiveDBS = new JButton("Receive DBS"); //marked as final as it is called in an Inner Class later
final JButton filePrep = new JButton("Prep File");
final JButton fileShuffle = new JButton("File Shuffle");
final JButton sendDBS = new JButton("Send DBS");
JButton exitButton = new JButton("Exit");
// JLabel statusbar = new JLabel("Text here");
receiveDBS.setFont(new java.awt.Font("Arial", 0, 25));
filePrep.setFont(new java.awt.Font("Arial", 0, 25));
fileShuffle.setFont(new java.awt.Font("Arial", 0, 25));
sendDBS.setFont(new java.awt.Font("Arial", 0, 25));
exitButton.setBorderPainted ( false );
exitButton.setMargin( new Insets ( 10, 10, 10, 10 ));
exitButton.setToolTipText( "EXIT Button" );
exitButton.setFont(new java.awt.Font("Arial", 0, 20));
exitButton.setEnabled(true); //Set to (false) to disable
exitButton.setForeground(new java.awt.Color(0, 0, 0));
exitButton.setHorizontalTextPosition(SwingConstants.CENTER); //Don't know what this does
exitButton.setBounds(10, 30, 90, 50); //Don't know what this does
exitButton.setBackground(new java.awt.Color(153, 101, 52));
topPanel.add(receiveDBS);
middle1.add(filePrep);
middle2.add(exitButton);
middle3.add(fileShuffle);
bottomPanel.add(sendDBS);
receiveDBS.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
if (ae.getSource() == receiveDBS);
try
Runtime.getRuntime().exec("cmd.exe /c start c:\\DBS\\ReceiveDBSfile.bat");
catch(Exception e)
System.out.println(e.toString());
e.printStackTrace();
filePrep.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
if (ae.getSource() == filePrep);
try
Runtime.getRuntime().exec("cmd.exe /c start c:\\DBS\\filePrep.bat");
catch(Exception e)
System.out.println(e.toString());
e.printStackTrace();
exitButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
System.exit(0);
fileShuffle.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
if (ae.getSource() == fileShuffle);
try
Runtime.getRuntime().exec("cmd.exe /c start c:\\DBS\\fileShuffle.bat");
catch(Exception e)
System.out.println(e.toString());
e.printStackTrace();
sendDBS.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
if (ae.getSource() == sendDBS);
try
Runtime.getRuntime().exec("cmd.exe /c start c:\\DBS\\sendDBSFile.bat");
catch(Exception e)
System.out.println(e.toString());
e.printStackTrace();
c.add(receiveDBS);
c.add(filePrep);
c.add(fileShuffle);
c.add(sendDBS);
c.add(exitButton);
// c.add(statusbar);
public static void main(String args[])
Buttons xyz = new Buttons();
xyz.setVisible(true);
}What I would like help with is the following
I would like output to either a JLabel or JTextArea to appear if a file appears on the network. Something along these lines
If file named nststrace*.* is in \\[network path] then output Download successful, please proceed.
btw I have done my best to search this forum for something similar and had no luck, but I am looking forward to Encephalopathics answer as he/she has consistently made me laugh with posted responses (in a good way).
Thanks in advance, Paul.Hospital_Apps_Monkey wrote:
we're starting to get aquainted, but I think "best friend" could take a while as it is still as hard going as I recall, but I will persevere.Heh, it's not so bad! For example, if I had no idea how to test whether a file exists, I would just scan the big list of classes on the left for names that sound like they might include File operations. Hey look, File! Then I'd look at all of File's methods for something that tests whether it exists or not. Hey, exists! Then if I still couldn't figure out how to use it, I'd do a google search on that particular method. -
Help with dynamic statement returning values into collection
Hi All
I am trying to use dynamic statement to return values into a collection using the returning clause. However, I get an ORA-00933 error. Here is a simple setup:
create table t(
pk number,
id_batch varchar2(30),
date_created date,
constraint t_pk primary key ( pk )
create or replace type num_ntt is table of number;
create or replace type vc2_ntt is table of varchar2(30);
create or replace
package pkg
as
type rec is record(
pk num_ntt,
id_batch vc2_ntt
procedure p(
p_count in number,
p_rt out nocopy rec
end pkg;
create or replace
package body pkg
as
procedure p(
p_count in number,
p_rt out nocopy rec
is
begin
execute immediate '
insert into t
select level, ''x'' || level, sysdate
from dual
connect by level <= :p_count
returning pk, id_batch into :pk, :id_batch'
using p_count returning bulk collect into p_rt.pk, p_rt.id_batch;
end p;
end pkg;
declare
r pkg.rec;
begin
pkg.p( 5, r );
end;
/sanjeevchauhan wrote:
but I am working with dynamic statement and returning multiple fields into a collection.And using an INSERT...SELECT statement combined with a RETURNING INTO clause still does not work. Whether it's dynamic SQL or not: it doesn't work. The link describes a workaround.
By the way, I don't see why you are using dynamic SQL here. Static SQL will do just fine. And so you can literally copy Adrian's setup.
Regards,
Rob. -
Need help with Object States or Buttons?
I currently work in InDesign to compile layouts and present design decks to clients. Our template includes an approval section (Not Approved, Revised, Approved) that we currently have as white/black bubbles that we change manually on each page. I've been trying to find a way to speed up this process. I know that in InDesign you can create buttons than you can then click on-off on your PDF - we used to do this but it is too time consuming (we have PDF's anywhere from 25-120 pages). I have been playing around with Object States, so we can quickly update the bubbles in InDesign itself as we work.
Does anyone know of a way to change the state of multiple objects on multiple pages at the same time? (For example, if I want to change all pages to "Approved" at the same time - or if I only wanted to do some, but not all, of the pages.)
Can anyone recommend any other InDesign tools that may be able to create a similar function for an "approval" stamp, but that still is done in InDesign (not in the PDF after exporting)?I was hoping that wouldn't be the only way. My have multiple master pages already, and not all pages will be "approved" at the same time. So we've run into issues with putting these on the masters as it gets easier to miss them.
-
Help with IF statement in numbers
Hi Community
Please could someone assist with creating a formula.
I have created an exercise log (see image). Now when I input a formula in E, =D2/C2 it gives me my Minutes/km, but in a row containing 'Resistance' it obviously gives me the enoying red beacon.
How can I create an IF/THEN statement, basically IF column C = "0", then 'leave field black', otherwise 'calculate my Minutes/km'.
A solution will be greatly appreciated.
Cheers,
MikeI suggest the following changes:
1) omit the "km" from in each entry of the "Distance" column and simply place it in the column header
2) use the following formula for the "Min / km" column:
E2=IF(C2>0,DURATION(,,,DUR2MINUTES(D2)/C2,), "")
the problem is you cannot divide by 0 (EVER). so you were correct to consider using an if to omit entries where the was no distance.
I hop this helps.
Wayne -
Urgent help with If statement please!
HI Everyone
Was wondering if anyone can tell me why flash seems to be
ignoring my If Statements, every time I try to use one it ignores
the condition and just actions the command. Its driving me crazy.
I'm sure I must be doing something wrong I just can't work it out.
I've put;
on (release) {
if ((_root.eyeshadow = "Pink") && (_root.lipy =
"Pink")) {
_root.correct._alpha =100;
It seems to just action the _root.correct._alpha = 100;
even when a different colour is selected.
I was wondering can flash read a variable from another
script, because if not it will not know what eyeshadow and lipy
are. I dont get any error messages though.
Please help somebody!
Thank you,
Stacy.x.Thank you that appears to have made the if statement work,
but now i have another problem.
It doesn't seem to acknowledge wether these selections have
been selected.
I have put in the code for the pink eyeshadow;
on (release) {
_root.eyeshadow2._alpha =0;
_root.eyeshadow1._alpha = 100;
eyeshadow == "Pink";
the same code is in all the other selections, with the name
variations.
any ideas?
.x. -
Need help with IF Statement!!!
I am trying to write an IF statement using FormCalc in LiveCycle. I have cell "tpe" which captures total points. I would like to assign levels based on the number of points achieved. For example, level I = 1001-1985; level II = 851-1000; level III = 551-850; level IV = <551. I want cell "level" to show either I, II, III or IV, based on the points in cell "tpe". How can I do this? I have zero familiarity with FormCalc or scrips in general. Can someone please help me with this? Would appreciate any help!! Thanks!
This is what it says:
topmostSubform.Page3.tpe::calculate - (FormCalc, client)
sum (rrtotal, programtotal, financetotal, leadershiptotal, executivetotal, meetingstotal, filestotal, brotherhoodtotal, conferencetotal, communicationstotal, minutestotal, standardstotal, basileustotal, abtotal, gramtotal, antigramtotal, tamtotal, pgramtotal, partotal, epistotal, torchtotal, hodtotal, phitotal)
if ($ > 1000 and $ <= 1985)then
level = "I"
elseif ($ > 850 and $ <= 1000)then
level = "II"
elseif ($ > 550 and $ <= 850)then
level = "III"
elseif ($ <= 550)then
level = "IV"
else level = ""
endif -
JavaScript: Help with IF Statement
I am not familar with Java and I have been fighting with this IF statement and I cannot get it to work. I am sure it is something fairly basic. Can anyone help? I have seeminly tried everything. In this example below I am trying to check if the data the user has entered in the FAVOR field is AAA and if it is then put up a message and if it isn't then put up a different message. My top node in my hierarcy is data and then I have a MainSubform and then a Contact02Subform. I have this code attached to a button and notthing happens when I click the button. If I remove the if statement and just have the message box by itself then it shows the message box. So I know it is my IF statement and I am sure it is simple. Help please?
if (xfa.resolveNode("xfa.form.data.MainSubform.Contact02Subform.FAVOR").rawValue == 'AAA')
xfa.host.messageBox("My IF"); else; xfa.host.messageBox("My ELSE");
endif;Try this.
if (xfa.resolveNode("xfa.form.data.MainSubform.Contact02Subform.FAVOR"). rawValue == 'AAA')
xfa.host.messageBox("My IF");
else
xfa.host.messageBox("My ELSE");
endif is used in FormCalc generally not in JavaScript.
Thanks,
Bibhu. -
Need help with If statement Please
Hi guys,
This is my first time posting and sorry if for some reason i post incorrectly.
I am having trouble figuring out what I am doing with my if Statement and why the compiler is giving me an error which says 'cannot find symbol';
Just incase you need to see the code here it is. And please any pointers would help me get back on track. And please dont laugh at the novice code i just started^^;
import java.util.*;
import java.text.*;
public class Student
public static void main(String[]args)
Scanner scan=new Scanner(System.in);
double std1, std2, std3, num1, num2, num3, num4;
String a, answer1, name1;
System.out.println("Welcome to _____ program, press any button to continue: ")
a=scan.nextLine();
System.out.println("Good, would you like to enter a grade for a student(y/n)?");
answer1=scan.nextLine();
if (answer1 == y)
System.out.println("Please enter the students name ");
name1=scan.nextLine();
System.out.println("Please label the test number ");
num1=scan.nextDouble();
System.out.println("Please enter the grade, "+name1+" recieved");
std1=scan.nextDouble();
if (answer1==n)
System.out.println("Thank you for trying my program ");
else
System.out.println("It's obvious you couldn't follow a simple direction good bye ");Thanks Flounder,
I'll keep in mind to edit the code the way you told me too.
As far as the code goes, what do you mean 'y' is not a string and should be a variable. All I'm trying to do is give a true false statement.
For example
if (input==y)
System.out.println("________");
And in my code it gives an error stating that y is a variable.
I dont understand why.
Thanks much for all your replies. -
Help with getting a node xpath from within the rules engine
I'm new here and to BizTalk. In the rule composer I've setup my vocabularies and have started implementing rules.
When a rule is evaluated to false I have a custom function called AddValidationError which is attached to the Action section. This method accepts three parameters, a TTypedXmlDocument containing
the validation errors node, an xpath to the node that was validated and an error code. AddValidationErrors will append a new ValidationError node to the validation errors node containing the error code, error message, severity, and the xpath of the node
that was validated.
The issue is that I can't figure out how to get the xpath to the node being validated so that I can pass it to the AddValidationError function. I have tried defining the xpath parameter as
a TTypedXmlDocument which allows me to pass nodes of type TTypedXmlDocument, from there i can working the xpath but this doesn't allow me to pass nodes of other types, such as String, Int, DateTime, etc.
Basically I want to be able to add the xpath to the node being validated into the validation errors. I noticed that the Predicate function Exists cal accepts any node from which it resolves
the xpath however I can't figure out how it does this.
Anyway I was hoping that someone could point me in the right direction. How can I pass a node of any type to a function, or get the xpath to node being validated which I can then simply pass
as a string.
Note that I am aware that I can simply type the xpath or copy it from the node properties window but the rule will be managed by people who are not developers, e.g. BA's or system administrators.
I don't really want to expect them to write an xpath query or piece one together from the node properties. I also thought that I could add two definition's for each node, one of the value type (String, decimal, DateTime) and another of type TTypedXmlDocument
and pass the TTypedXmlDocument one to the AddValidationError method, which works but its not really ideal.Can you post the exact issue and what you really need ?
Do you want to create a Vocabulary or Rule with the predicate functions?
Regards, Aboorva Raja R Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Need help with update statement with multiple joins
I've got the following select statement that is pulling 29 records:
SELECT
PPA.PROJECT_ID,
PPA.SEGMENT1,
peia.expenditure_item_id,
peia.expenditure_type,
pec.expenditure_comment
FROM PA.PA_PROJECTS_ALL PPA,
pa.pa_expenditure_items_all peia,
pa.pa_expenditure_comments pec
where PPA.segment1 < '2008' and
PPA.project_id = 52 and -- just run for project # 20077119 for testing
peia.expenditure_type = 'PAYROLL' and
peia.project_id = ppa.project_id and
PEC.EXPENDITURE_ITEM_ID = PEIA.EXPENDITURE_ITEM_ID;
I need to update the pec.expenditure_comments to a static field for those 29 records. I assume I should start with the following, but not sure how to complete the where:
update
pa.pa_expenditure_comments pec
set pec.expenditure_comment = 'REFERENCE HD#728'
where
First time that we've ever needed to update, so any and all help appreciated.Try using exists:
update pa.pa_expenditure_comments pec
set pec.expenditure_comment = 'REFERENCE HD#728'
where exists ( select null
from pa.pa_projects_all ppa
, pa.pa_expenditure_items_all peia
, pa.pa_expenditure_comments pec2
where ppa.segment1 < '' -- not sure what you posted here, so for next time:
-- please put your examples between the code tags.
and ppa.project_id = 52 -- just run for project # 20077119 for testing
and peia.expenditure_type = 'PAYROLL'
and peia.project_id = ppa.project_id
and pec2.expenditure_item_id = peia.expenditure_item_id
and pec2.expenditure_item_id = pec.expenditure_item_id
); -
Help with City, State Field
Hi
I need help in take one field with the City, State to 2 fields. One with City and the other State. I know how to take 2 fields into 1 but what is the script for 1 into 2 using the "," has the divider?
Thank you in advance!Have a look here: http://w3schools.com/jsref/jsref_split.asp
Maybe you are looking for
-
Problem with constructor of inner class.
Hi everybody! I have an applet which loads images from a database. i want to draw the images in a textarea, so i wrote an inner class, which extends textarea and overrides the paint method. but everytime i try to disply the applet in the browser this
-
Black bars alongside video+squished aspect ratio on export
I'm trying to get my import/export settings right--I keep getting black bars and a squished or stretched image when my videos export. Since Elements doesn't read MOD I've been using miro to convert, which doesn't like to export to mp4 all that well
-
Itunes cant find my new ipad mini.
I just got a new ipad mini and i followed the setup to the letter but when i connect it to my laptop itunes doesnt recognize it. Ive looked at hours of youtube videos and searched through dozens of google pages and still i cant seem to figure out how
-
Comparative vendor analysis needed
Hi Everyone! If anyone has a comparative study or analysis of the various MDM vendors in the markets, please forward it to me. Thanks & Regards, Taj.
-
Multiple crashing freezing Airport
Everything has been working fine until the last month. I am getting random and pretty frequent system freezes and restarts. No crash logs are being generated and all the hardware seems fine (passed all the hardware tests and it has also been in the a