Help with an If Statement for a Message Dialog
Hello all! I need help yet once again! I would prefer hints and nudges rather then the answer please, as this is for a homework assignment. Okay I am supposed to write a program that has 3 text boxes to enter a number between 0 and 255 (for red green and blue) and then the user should push the show button and the background color should change, which I have all working! But I am supposed to have a " gracefully handle the situation where the user enters an invalid color value (any number less than zero or greater than 255)" and I have the if statement written, but for some reason, whenever I hit the show button it always pops up that window, no matter what the user types in. So I need help figuring out how to make it stop popping up all of the time! Here is the code: Any other ideas on how to make the code better would be much appreciated!!! Thanks in advance!
import java.awt.GridLayout;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JPanel;
import javax.swing.BorderFactory;
public class ColorEditor extends JPanel {
private JLabel labelRed;
private JLabel labelGreen;
private JLabel labelBlue;
private JTextField textFieldRed;
private JTextField textFieldGreen;
private JTextField textFieldBlue;
private JButton showButton;
private JButton exitButton;
private JOptionPane optionPane;
public ColorEditor()
super(new BorderLayout());
labelRed = new JLabel("red: ");
textFieldRed = new JTextField(5);
labelGreen = new JLabel("green: ");
textFieldGreen = new JTextField(5);
labelBlue = new JLabel("blue: ");
textFieldBlue = new JTextField(5);
showButton = new JButton("show");
exitButton = new JButton("exit");
JPanel labelPane = new JPanel(new GridLayout(0,1));
labelPane.add(labelRed);
labelPane.add(labelGreen);
labelPane.add(labelBlue);
labelPane.add(showButton);
JPanel fieldPane = new JPanel( new GridLayout(0,1));
fieldPane.add(textFieldRed);
fieldPane.add(textFieldGreen);
fieldPane.add(textFieldBlue);
fieldPane.add(exitButton);
setBorder(BorderFactory.createEmptyBorder(40,40,40,40));
add(labelPane, BorderLayout.LINE_START);
add(fieldPane, BorderLayout.CENTER);
TextFieldHandler handler = new TextFieldHandler();
textFieldRed.addActionListener(handler);
textFieldGreen.addActionListener(handler);
textFieldBlue.addActionListener(handler);
showButton.addActionListener(handler);
private class TextFieldHandler implements ActionListener
public void actionPerformed(ActionEvent event)
if (event.getSource() == showButton)
String textRed = textFieldRed.getText();
String textGreen = textFieldGreen.getText();
String textBlue = textFieldBlue.getText();
int a = Integer.parseInt(textRed);
int b = Integer.parseInt(textGreen);
int c = Integer.parseInt(textBlue);
if ((a < 0) || (a > 255)||(b<0)||(b>255)||(c<0)||(c>255));
optionPane.showMessageDialog(null, "Please enter a number between 0 and 255!");//HERE IS WHERE I NEED THE HELP!!
Color colorObject = new Color(a,b,c);
setBackground(colorObject);
public static void main(String args[])
JFrame frame = new JFrame("Color Editor");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
frame.add(new ColorEditor());
frame.pack();
frame.setVisible(true);
}
Okay now Eclipse is giving me a really funky error that I cannot quite figure out (in the compiler) but my program is running fine.... Can you help me with this too?
Here is what the compiler is giving me....
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Color parameter outside of expected range: Green
+ at java.awt.Color.testColorValueRange(Unknown Source)+
+ at java.awt.Color.<init>(Unknown Source)+
+ at java.awt.Color.<init>(Unknown Source)+
+ at ColorEditor$TextFieldHandler.actionPerformed(ColorEditor.java:80)+
+ at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)+
+ at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)+
+ at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)+
+ at javax.swing.DefaultButtonModel.setPressed(Unknown Source)+
+ at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)+
+ at java.awt.Component.processMouseEvent(Unknown Source)+
+ at javax.swing.JComponent.processMouseEvent(Unknown Source)+
+ at java.awt.Component.processEvent(Unknown Source)+
+ at java.awt.Container.processEvent(Unknown Source)+
+ at java.awt.Component.dispatchEventImpl(Unknown Source)+
+ at java.awt.Container.dispatchEventImpl(Unknown Source)+
+ at java.awt.Component.dispatchEvent(Unknown Source)+
+ at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)+
+ at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)+
+ at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)+
+ at java.awt.Container.dispatchEventImpl(Unknown Source)+
+ at java.awt.Window.dispatchEventImpl(Unknown Source)+
+ at java.awt.Component.dispatchEvent(Unknown Source)+
+ at java.awt.EventQueue.dispatchEvent(Unknown Source)+
+ at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)+
+ at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)+
+ at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)+
+ at java.awt.EventDispatchThread.pumpEvents(Unknown Source)+
+ at java.awt.EventDispatchThread.pumpEvents(Unknown Source)+
+ at java.awt.EventDispatchThread.run(Unknown Source)+
Similar Messages
-
Need help with the session state value items.
I need help with the session state value items.
Trigger is created (on After delete, insert action) on table A.
When insert in table B at least one row, then trigger update value to 'Y'
in table A.
When delete all rows from a table B,, then trigger update value to 'N'
in table A.
In detail report changes are visible, but the trigger replacement value is not set in session value.
How can I implement this?You'll have to create a process which runs after your database update process that does a query and loads the result into your page item.
For example
SELECT YN_COLUMN
FROM My_TABLE
INTO My_Page_Item
WHERE Key_value = My_Page_Item_Holding_Key_ValueThe DML process will only return key values after updating, such as an ID primary key updated by a sequence in a trigger.
If the value is showing in a report, make sure the report refreshes on reload of the page.
Edited by: Bob37 on Dec 6, 2011 10:36 AM -
I think I need help with driver (software) settings for D110a
I think I need help with driver (software) settings for D110a all-in-one
Product: D110a all-in-one
OS: Windows XP Professional
Error messages: None
Changes before problem appeared: None--new installation
The quality of photo images (mostly JPG files) in printouts is awful even though the files display beautifully on the PC screen. I am using
IrfanView software for displaying/printing. As far as I can tell, IrfanView is not the problem.
When I print the same images on a Deskjet 5150 attached to a different PC also running XP Pro and IrfanView, the quality of the printouts is at
least acceptable, Some would probably say good or very good.
It's dificult to explain in words the problem with the printouts. A picture of really pretty vegetables (squashes, tomatoes, watermelon, etc) comes
out much too red. Moreover, the red, which appears shaded on the screen, seems to be all one shade in the D110a printouts.
Something similar happens to a view of a huge tree in full leaf. On screen, there are subtle variations in the "greenness" of the leaves. In the
printout, all green is the same shade. In the same printout, the trunk of the tree is all a single shade of grey. It isn;t even obvious that the
trunk is a round, solid object.
I liken the effect to audio that disappears entirely when you lower the volume and gets clipped into square waves in even moderately loud passages.
I don't know whether the D110a driver software permits adjusting the parameters that appear to be set incorrectly, and if adjustments are possible,
how I would identify which parameters to adjust, how I would access them, or how I would adjust them. I'm hoping that someone can help. Thanks.
I forgot to mention that I have used the diagnostic application and it tells me that there are no problems.
e-mail me at [email protected]brazzmonkey wrote:
Hi everyone,
I noticed the following message when network starts on my gateway
Warning: This functionality is deprecated.
Please refer to /etc/rc.conf on how to define a single wired
connection, or use a utility such as netcfg.
Then I realized the way network settings should be written in rc.conf has changed. But I can't figure out how this should be done.
Currently, my set up is the following (old way):
INTERFACES=(eth0 eth1)
eth0="dhcp"
eth1="eth1 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255"
ROUTES=(!gateway)
eth0 is on DHCP because the IP is dynamically assigned my ISP.
eth1 has a fix IP because it's on the LAN side.
No problem to use DHCP on eth0 with the new settings.
But for eth1, I don't know what I am supposed to write for gateway.
Wiki isn't clear on that one either, and it looks like many articles still refer to the old way.
Any guidance appreciated, thanks.
brazzmonkey,
you can't define 2 interfaces the old way (even though I saw some tricky workaround somewhere in the forums).
Use, f.e., netcfg:
Comment your old lines.
In /etc/rc.conf insert:
NETWORKS=(Eth0-dhcp Eth1-static)
DAEMONS=(..... !network @net-profiles ....)
In /etc/network.d create 2 files:
First one is named Eth0-dhcp.
Contents:
CONNECTION="ethernet"
DESCRIPTION="Whatever text"
INTERFACE=eth0
HOSTNAME="your hostname"
IP="dhcp"
DHCP_TIMEOUT=15
Second one is named Eth1-static.
Contents:
CONNECTION='ethernet'
DESCRIPTION='whatver'
INTERFACE='eth1'
HOSTNAME='hname'
IP='static'
ADDR='192.168.0.10'
GATEWAY='192.168.0.1' # your gateway IP
DNS=('192.168.0.1') # your DNS server
The names Eth0-dhcp and Eth1-static are not magic. They just must be the same in rc.conf and in /etc/network.d.
Hope it helps.
mektub
PS: netcfg must be installed.
Last edited by Mektub (2011-07-20 14:07:05) -
Help with this update statement..
Hi everyone,
I am trying to update a column in a table .I need to update that column
with a function that takes patient_nbr and type_x column values as a parameter.
That table has almost "300,000" records. It is taking long time to complete
almost 60 min to 90 min.
Is it usual to take that much time to update that many records?
I dont know why it is taking this much time.Please help with this update statement.
select get_partner_id(SUBSTR(patient_nbr,1,9),type_x) partner_id from test_load;
(it is just taking 20 - 30 sec)
I am sure that it is not the problem with my function.
I tried the following update and merge statements .Please correct me if i am wrong
in the syntax and give me some suggestions how can i make the update statement fast.
update test_load set partner_id = get_partner_id(SUBSTR(patient_nbr,1,9),type_x);
merge into test_load a
using (select patient_nbr,type_x from test_load) b
on (a.patient_nbr = b.patient_nbr)
when matched
then
update
set a.partner_id = get_partner_id(SUBSTR(b.patient_nbr,1,9),b.type_x);
there is a index on patient_nbr column
and the statistics are gathered on this table.Hi Justin,
As requested here are the explain plans for my update statements.Please correct if i am doing anything wrong.
update test_load set partner_id = get_partner_id(SUBSTR(patient_nbr,1,9),type_x);
"PLAN_TABLE_OUTPUT"
"Plan hash value: 3793814442"
"| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |"
"| 0 | UPDATE STATEMENT | | 274K| 4552K| 1488 (1)| 00:00:18 |"
"| 1 | UPDATE | TEST_LOAD | | | | |"
"| 2 | TABLE ACCESS FULL| TEST_LOAD | 274K| 4552K| 1488 (1)| 00:00:18 |"
merge into test_load a
using (select patient_nbr,type_x from test_load) b
on (a.patient_nbr = b.patient_nbr)
when matched
then
update
set a.partner_id = get_partner_id(SUBSTR(b.patient_nbr,1,9),b.type_x);
"PLAN_TABLE_OUTPUT"
"Plan hash value: 1188928691"
"| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |"
"| 0 | MERGE STATEMENT | | 274K| 3213K| | 6660 (1)| 00:01:20 |"
"| 1 | MERGE | TEST_LOAD | | | | | |"
"| 2 | VIEW | | | | | | |"
"|* 3 | HASH JOIN | | 274K| 43M| 7232K| 6660 (1)| 00:01:20 |"
"| 4 | TABLE ACCESS FULL| TEST_LOAD | 274K| 4017K| | 1482 (1)| 00:00:18 |"
"| 5 | TABLE ACCESS FULL| TEST_LOAD | 274K| 40M| | 1496 (2)| 00:00:18 |"
"Predicate Information (identified by operation id):"
" 3 - access("A"."patient_nbr"="patient_nbr")"Please give some suggestions..
what's the best approach for doing the updates for huge tables?
Thanks -
Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7.
You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.
-
[solved]Need help with a bash script for MOC conky artwork.
I need some help with a bash script for displaying artwork from MOC.
Music folders have a file called 'front.jpg' in them, so I need to pull the current directory from MOCP and then display the 'front.jpg' file in conky.
mocp -Q %file
gives me the current file playing, but I need the directory (perhaps some way to use only everything after the last '/'?)
A point in the right direction would be appreciated.
thanks, d
Last edited by dgz (2013-08-29 21:24:28)Xyne wrote:
You should also quote the variables and output in double quotes to make the code robust, e.g.
filename="$(mocp -Q %file)"
dirname="${filename%/*}"
cp "$dirname"/front.jpg ~/backup/art.jpg
Without the quotes, whitespace will break the code. Even if you don't expect whitespace in any of the paths, it's still good coding practice to include the quotes imo.
thanks for the tip.
here it is, anyhow:
#!/bin/bash
filename=$(mocp -Q %file)
dirname=${filename%/*}
cp ${dirname}/front.jpg ~/backup/art.jpg
then in conky:
$alignr${execi 30 ~/bin/artc}${image ~/backup/art.jpg -s 100x100 -p -3,60}
thanks for the help.
Last edited by dgz (2013-08-29 21:26:32) -
I need help with downgradeing my ios for my ipod touch 4th gen
i need help with downgradeing my ios for my ipod touch 4th gen
As has alwys been the case, you cannot go back.
Sorry -
I am still using CS3. A while back I received an error: "Licensing for this product has stopped working" for my CS3 programs. I used the recovery program suggested by Adobe and was able to get Illustrator, Flash and Dreamweaver to work, but I still can't open Photoshop or In Design. I went back to the Adobe site and did every other trick they suggested to fix the error, but nothing has worked.
I then tried to uninstall photoshop from my CS3 suite (so I could reinstall) but got a JavaScript Alert: "Critical errors were found in set up. Please see set up log for file details." Seeing as I am not the best with the behind the scenes technical stuff, I have no idea what this means or where the set up log even is. Any help anyone can provide?
I have had CS3 installed on my computer for over a year. I started having problems about 4 months ago.I am having similar problem. Can't open any of CS3 programs after trying to download Dreamweaver Trial, which wouldn't work because "couldn't remove DLM extention" error message. So now I can not run Illustrator, Photoshop, or even Adobe Reader. These are properly licensed for about a year. I get "License for product has stopped working". Have 2 pending cases open with Adobe support (one for Dreamweaver trial, one for license problem) since 8/3 with NO ANSWERS - It says answers within 1-3 business days. Was on phone support hold today for over 3 hours before line went dead with no help. What is up with adobe support? Can anyone help?
-
Looking for some help with building insert statements...
Hi, I am using some sql to build some insert statements for me to update a set of tables in our qa environments. The scripts that I have created were working great until someone added a column to some of the tables in the qa env which in turn makes my scripts break because I was simply building the statment to do someting like this...
insert into dest_table (select * from source_table@dblink);
But now when the coumns in the tables do not match it breaks...
This is the dynamic create script I use, can anyone help or suggest a better way to be able to build update statements update to qa tables when the columns are mismatched?
spool insert.sql
select
'insert into ' || table_name || ' (select * from ' || table_name || '@prod );' || chr(10) || ' commit;'
from user_tables
where table_name in
(select * from refresh_tablesl)
any help is greatly appreciated,
Thanks.See my reply to your duplicate post
looking for help building dynamic insert statements... -
Urgent help with simple BPEL process for reading data from database
Hello there,
I need help with BPEL project.
i have created a table Employee in Database.
I did create application, BPEL project and connection to the database properly using Database Adapter.
I need to read the records from the database and convert into xml fomat and it should to go approval for BPM worklist.
Can someone please describe me step by step what i need to do.
Thx,
DpsI have created a table in Database with data like Empno,name,salary,comments.
I created Database Connection in jsp page and connecting to BPEL process.
It initiates the process and it goes automatically for approval.
Please refer the code once which i created.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.Map" %>
<%@page import="com.oracle.bpel.client.Locator" %>
<%@page import="com.oracle.bpel.client.NormalizedMessage" %>
<%@page import="com.oracle.bpel.client.delivery.IDeliveryService" %>
<%@page import="javax.naming.Context" %>
<%@page import="java.util.Hashtable" %>
<%@page import="java.util.HashMap" %>
<%@ page import="java.sql.*"%>
<%@ page import= "jspprj.DBCon"%>
<html>
<head>
<title>Invoke CreditRatingService</title>
</head>
<body>
<%
DBCon dbcon=new DBCon();
Connection conn=dbcon.createConnection();
Statement st=null;
PreparedStatement pstmt=null;
Hashtable env= new Hashtable();
ResultSet rs = null;
Map payload =null;
try
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL, "opmn:ormi://localhost:port:home/orabpel");//bpel server
env.put("java.naming.security.principal", "username");
env.put("java.naming.security.credentials", "password");//bpel console
Locator locator = new Locator("default","password",env);
IDeliveryService deliveryService =
(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
// construct the normalized message and send to Oracle BPEL Process Manager
NormalizedMessage nm = new NormalizedMessage();
java.util.HashMap map = new HashMap();
st=conn.createStatement();
out.println("connected");
String query1="Select * from EMPLOYEE";
rs=st.executeQuery(query1);
/*reading Data From Database and converting into XML format
so that no need of going to BPEL console and entering the details.
while (rs.next()){
String xml1 = "<AsynchBPELProcess1ProcessRequest xmlns='http://xmlns.oracle.com/AsynchBPELProcess1'>"+
"<Empno>"+rs.getString(1)+"</Empno>"+
"<EmpName>"+rs.getString(2)+"</EmpName>"+
"<Salary>"+rs.getString(3)+"</Salary>"+
"<Comments>"+rs.getString(4)+"</Comments>"+
"</AsynchBPELProcess1ProcessRequest>";
out.println(xml1);
nm.addPart("payload", xml1 );
// EmployeeApprovalProcess is the BPEL process in which human task is implemented
deliveryService.post("EmployeeApprovalProcess", "initiate", nm);
// payload = res.getPayload();
out.println( "BPELProcess CreditRatingService executed!<br>" );
// out.println( "Credit Rating is " + payload.get("payload") );
//Incase there is an exception while invoking the first server invoke the second server i.e lsgpas13.
catch(Exception ee) {
//("BPEL Server lsgpas14 invoking error.\n"+ee.toString());
%>
</body>
</html>
Its working fine.And i want it for Bulk approvals.please help me step by step procedure if any other way to implement this. -
Help with a return statement please!
hey, just hoping somone can help me with this return statement
i have to add a method called "specialReport" this method takes a year as it's parameter. if the parameter is not a year between 1930 and 1969 inclusive it displays an error message, "not a valid year"
if the parameter is a valid year, then it compares the parameter with the year field. if they are the same, and is the movie has been rented at least five times, the method will display the message "a good year for movies" if the years are different or the movie has NOT been rented at least five times, the method displays the message "try a different year"
btw, the Year field is : yearReleased
all help is very much appreciated!public void specialReport(int year){
//add functionality to process here
return;
} -
Help with making JLabel visible for a few seconds only
Hello guys,
I need help with making a JLabel object visible for a few seconds only and disappear when a JButton has been clicked.
Here is piece of code where I add mouse listener to the JButton object in my case is (jrbFigure1) and
when is called sets icon and text to the JLabel jlbl object:
jrbFigure1.addMouseListener(new MouseAdapter() {
jrbFigure1.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
jlbl.setIcon(cross);
jlbl.setText(wrong);
This piece of code is in a switch statement, the statement is in a method.
The JLabel jlbl object is added in a panel in the constructor of the class.
I really hope someone could help me on this issue.
I would like to thank you in advance for any help or advice given.Bobson wrote:
Sorry for posting my issue twice, I thought, I posted it in a wrong forum:)It's OK. We'll ask the mods to delete the other thread.
I want the label to appear for X seconds when then button is pressed and disappear after that.Then a Swing Timer is what you want to use.
I need to do this in a number of cases from a switch statement because I several buttons.Better to have several ActionListeners, one for each button or each type of button, rather than one ActionListener with a large switch statement, a so-called switch-board listener. They're messy to debug and upgrade.
I tried to use Swing Timer, but I cannot set it properly.Go through the Sun Swing tutorial on Swing Timers. It's all outlined for you there: [http://java.sun.com/docs/books/tutorial/uiswing/misc/timer.html] -
Help with nested if statements
Can anyone see what is wrong with this? The parameter value is 3. I commented out 4-12 to narrow down the issue. If I run it like this, I get 0. However if I comment out 1 and 2 and just leave the logic for 3, I get the actual numbers. Where is it getting stuck?
Crystal Reports 11
if {?Period} = 1 then
if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} = 1 then
if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
else
if {?Period} = 2 then
if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 2 then
if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
else
if {?Period} = 3 then
if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 3 then
if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
//else
//if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
//if {?Period} = 4 then
//if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 4 then
//If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
//then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
//else
//if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
//if {?Period} = 5 then
//if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 5 then
//If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
//then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
//else
//if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
//if {?Period} = 6 then
//if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 6 then
//If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
//then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
//else
//if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
//if {?Period} = 7 then
//if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 7 then
//If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
//then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
//else
//if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
//if {?Period} = 8 then
//if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 8 then
//If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
//then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
//else
//if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
//if {?Period} = 9 then
//if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 9 then
//If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
//then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
//else
//if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
//if {?Period} = 10 then
//if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 10 then
//If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
//then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
//else
//if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
//if {?Period} =11 then
//if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 11 then
//If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
//then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
//else
//if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
//if {?Period} = 12 then
//if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 12 then
//If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
//then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
else 0Kim,
You never get there. Parenthesis will help you what is happening.
if {?Period} = 1 then
( if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} = 1
then
( if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate)
then
( If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
else
if {?Period} = 2
then
( if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 2
then
( if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate)
then
( If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
else
if {?Period} = 3
then
( if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 3
then
( if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate)
then
( If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
else...
All your statements are looking for true values. You need an else statement for each failed if-then test.
if {?Period} = 1
then
( // 1
if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} = 1
then
( // 2
if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate)
then
( // 3
If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
else
//what happens if it {FC_COST_AREA_ACT_BUD_UNION.TYPE} not ="ACT"
) // 3
else
//what happens if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} not= year(currentdate)
) // 2
else
//what happens if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} not=1
) //1
// the next else is for the first failed if-then test
else
if {?Period} = 2 then...
Debi
The numbers next to the parenthesis are to help you follow them
Edited by: Debi Herbert on Apr 13, 2011 4:40 PM -
Help with Proper DNS Setup for Leopard Standard Server Setup
Hello All,
Problem Description-
I was reviewing some training today on DNS setup and checking for proper setup with the sudo changeip - checkhostname tool and I seem to have an incorrectly configured DNS setup. So I need some help on correcting it. When I go to the "Server Preferences" tool I cannot log in using apple.ourdomainname.com instead in order to use the tool I have to input localhost as the server name. Now I just thought that the system was broken or something and with the help of my training I now see it's a DNS problem. I thought I had everything proper since I followed the steps of creating proper DNS/RDNS entries with my ISP. Now I am stuck wondering what else isn't working properly due to the DNS issue. Thanks in advance.
Technical Info-
My ISP provides us with 5 static IP's and we have asked them to create entries and verified the setup of apple.ourdomainname.com = x.x.x.x which is one of our public IP's assigned currently assigned to the WAN port of our Apple Airport Extreme. We have also had them create a PTR record which also is present, verified and functional. Our MacMini running 10.5.5 is connected directly to one of the ethernet ports on our Apple Airport Extreme which is our NAT/Firewall for the LAN. So during the setup of the Standard Server install the OS configured the Airport with the required ports for chat/web/vpn. And mobile Mac's can VPN in and gain folder access and web works fine too. We don't use the e-mail portion so I can't say how that works. The server is using the DNS of 10.0.200.1 which is the IP of the Airport and the airport is programmed with the DNS of OpenDNS servers 208.67.222.222 and 208.67.220.220. The reason for this whole long shpeal is that I want to give as much technical background as possible for the best possible help.
Thanks
DMWhat happens when you use 'Localhost' instead of 'localhost' (i.e. capitalizing the 'L')?
-
Flex with JMS Topic/Queue for Asynchronous messaging
I have been working on Flex and JMS integration using Data
Services for Asynchronous messaging. I am able to do this
successfuly. Now I am in need to do the same without using the Data
Services piece.
For doing this I have done the following ......
I have created a JMS Webservice in the Oracle JDeveloper 10G
along with Webservice Client.I am able to Listen to JMS Topic/Queue
( this has been created in the Oracle AS ) using this Webservice
and receive the messages from this JMS Topic/Queue
Asynchronously.....
But If I need to use the Flex Client , I am not able to
Communicate with this Webservice to listen to the JMS Topic/Queue.
Did any one in this forum tried to communicate with JMS
Topic/Queue without using Flex Data Service.If so please share your
inputs.Here is my confusion (I'm using J2EESDK1.3).
On a local server I did the following
j2eeadmin -addJmsFactory jms/RemoteTCF topic -props url=corbaname:iiop:mars#mars
In the app client running on the local server I had the code
ic = new InitialContext();
// JNDI lookup. The resource factory ref points to the
// Remote Connection Factory I registered
tcf = (TopicConnectionFactory)ic.lookup("java:comp/env/jms/TopicConnectionFactory");
// The env ref points to jms/Topic of the local server
pTopic = (Topic)ic.lookup("java:comp/env/jms/PTopic");
So I'm assuming that I'm using a connection factory that connect to mars and a Topic on the local box.
On remote server mars, I deployed a MDB which use
jms/TopicConnectionFactory and jms/Topic. But I'm thinking this jms/Topic and the one I used on the local box are not the same one. Right? Then how could the app client and the MDB share messages?
Some of my explanation I don't if it makes sense or not.
ConnectionFactory is a way to tell what kind of connection it could generate (Queue, Topic, Durable etc) and Where the connection would go to (local or remote).'
As for as destination, I'm not sure. How could two server share one Topic?
Maybe you are looking for
-
Updating from 9.1.6 to 9.1.8
I purchased and installed the retail version of Logic Studio 2 a couple of years ago. The Logic Pro version currently on my computer is 9.1.6. I get this message when trying to update: An eligible Logic Pro version was not found in the Applications f
-
Spell Check Text in Spanish in Acrobat Pro 9
I can only spell check in English and I work in various languages. I went to File > Properties > Advanced > Reading, changed it to Spanish Then Edit > Check Spelling > In Fields editable text, comments then when it opens it does not show Editable Te
-
How can I uninstall Magic TrackPad update
Yyyyyyikes!!! First of all I'm totally fed up with these two words: "magical" and "revolutionary". Enough already. Secondly I can't understand why apple is trying so hard to become americas next top microsoft. Ok. The magically padish tracsies update
-
No Service, SIM not provisioned
Hi Everyone, I've just recently purchased my first iphone (iphone 4) but i'm constantly getting no service in the top left hand corner since setting the phone up. Also on my network settings it's stating SIM not provisioned. Can anyone help? As I'm a
-
File Upload in UNIX Problem in using fileaccess.HttpUploadBean
Hi, Some one please help me on File uploading in UNIX using fileaccess.HttpUploadBean. My program is working fine for windows , but when i am running same profram to upload the file in Unix Environment it is giving exception. fileaccess.properties fo