Draw Circle Using Array
Hi,
I have a sizeable array which has an N by N size. How can I draw a circle in my array using digits, 0 or 255, in U8 representation?
I have a Flatten Pixmap.vi and Draw Flatten Pixmap.vi to assist in the drawing.
So hope someone out there can help to enlighten me in the logic.
Thanks and Regards,
Jack
There is a function for the 2D picture control that draws real nice circles. You can then turn that picture into whatever you want.
What is it that you are trying to accomplish?
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
Similar Messages
-
I want to draw line on pdf page. I have x,y coordinate depend upon that i want to draw line on page. please reply
Thanks in advanceThanks Leonard..
This is my Circle draw code.. but it's not working properly..
moveto() and CurveTo() are mwthod it is defined like Draw Curve. please give me some suggestion about it..
ASFixed inCenterX = mediaBox.left;
ASFixed inCenterY = mediaBox.top;
ASFixed inRadius = ASInt32ToFixed(2);
PDEPath mov = MoveTo( inCenterX + inRadius, inCenterY );
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)mov);
PDEPath rect1 = CurveTo( inCenterX + inRadius, inCenterY + inRadius * ARC_MAGIC, inCenterX + inRadius*ARC_MAGIC, inCenterY + inRadius,
inCenterX, inCenterY + inRadius );
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)rect1);
PDEPath rect2 = CurveTo( inCenterX - inRadius*ARC_MAGIC, inCenterY + inRadius, inCenterX - inRadius, inCenterY + inRadius*ARC_MAGIC,inCenterX - inRadius, inCenterY );
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)rect2);
PDEPath rect3 = CurveTo( inCenterX - inRadius, inCenterY - inRadius*ARC_MAGIC, inCenterX - inRadius*ARC_MAGIC, inCenterY - inRadius,inCenterX, inCenterY - inRadius );
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)rect3);
PDEPath rect4 = CurveTo( inCenterX + inRadius*ARC_MAGIC, inCenterY - inRadius, inCenterX + inRadius, inCenterY - inRadius*ARC_MAGIC,
inCenterX + inRadius, inCenterY );
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)rect4);
PDEPath close = CloseTo(inCenterX + inRadius, inCenterY );
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)close);
HOw to draw circle using Acrobat SDK?
Thanks in advance.. -
Hi i would like help with:
When I draw circle and add stroke I can not see stroke
I use Photoshop CS 5Make sure the stroke is set to a color and not to the symbol that appears here for Fill
-
Can only draw circle and square in Illustrator CS5 and Photoshop CS5
I am experiencing a strange bug that seems to be affecting both Photoshop CS5 and Illustrator CS5. In Illustrator, when I try to draw a rectangle or ellipse I can only draw circles and squares. Also I can't change the color of selected objects. When I try to change its fill nothing happens. I can also only drag objects on the 0, 45 and 90 degree angles. Also I can no longer select off an object by clicking on the artboard. When I click on the artboard nothing happens.
Similarly in Photoshop I can only draw straight lines using the brush tool. The marquee tool is also not functioning properly. When I try to use the marquee tool the marching ants form a square but when I release the mouse it selects a rectangular portion. Strangely if I use the marquee tool and make selection I can press the shift key and add to it but this second selection's marching ants are not square but are properly rectangular.
Since the problem seems to be affecting both Illustrator and Photoshop I'm thinking it's probably some kind of system conflict or perhaps an application running in the background is affecting it. Also if I restart my mac the problem goes away. Unfortunately the problem eventually returns.
Anyway I'm pretty sure most of the suggested fixes involve systematically going through all the programs running in the background and trying to determine which if any might be affecting Illustrator and Photoshop but I just thought I'd post something in case someone else had the problem or knew of any fixes.
I'm running CS5 on a MBP.
Thanks!Ok I figured out the problem. It was another application called teleport which lets you control 2 macs with one mouse. It requires a hot key and in my case that was the shift key. Even though it was running it was still affecting me. Had to quit it and restart. If you're having a similar problem I'd check to see you're not running any other applications that can be activated with a hot key.
-
How to draw circle if I have two points info and radius of the circle?
Hi,
I am trying to draw circle.
Inputs I have is 1. Two points of the circle and
2. Radius of the circle.
Please let me know if u have solution using Shape, Graphics2D apis.
Thanks in advance..
Cheers,
SomasekharAs far as the drawing is concerned, you would use Graphics# drawOval. There's no API method to draw a circle using the parameters of two points and a radius.
You need to solve the problem on paper and work out the maths involved, then translate that math into working Java code.
btw, you do realize that the information will give you zero to two valid circles, don't you?
db -
Photoshop CS4 Brush Draws Circles
Hi. This wasn't happening but now, all of my brushes draws circles like that. Is it supposed to happen? If answer is no, how can I solve it? Thanks.
Today I've installed the latest Forceware Drivers 180.60 from http://www.laptopvideo2go.com/ to test the bug behaviour.
The brush cursor now seems to be able to handle big brush sizes but the performance is reduced noticable.When painting inside a new document the rendering of the brush path is done after painting over the area, even when using small brush sizes.
So let's wait until Nvidia/Lenovo roll out a new driver.
Message Edited by mikey on 11-24-2008 07:57 AM -
Draw circles in swing..
hello.
I'm making a program that draws circles in a frame and has some buttons in another program.
However, there are some stack overflow errors..
help please~
[error messages]
Exception in thread "main" java.lang.StackOverflowError
at java.util.Hashtable.get(Hashtable.java:336)
at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:142)
at javax.swing.UIDefaults.get(UIDefaults.java:130)
at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
at javax.swing.UIDefaults.getColor(UIDefaults.java:380)
at javax.swing.UIManager.getColor(UIManager.java:590)
at javax.swing.LookAndFeel.installColors(LookAndFeel.java:58)
at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:92)
at javax.swing.plaf.basic.BasicPanelUI.installDefaults(BasicPanelUI.java:49)
at javax.swing.plaf.basic.BasicPanelUI.installUI(BasicPanelUI.java:39)
at javax.swing.JComponent.setUI(JComponent.java:652)
at javax.swing.JPanel.setUI(JPanel.java:131)
at javax.swing.JPanel.updateUI(JPanel.java:104)
at javax.swing.JPanel.<init>(JPanel.java:64)
at javax.swing.JPanel.<init>(JPanel.java:87)
at javax.swing.JPanel.<init>(JPanel.java:95)
at DrawCircle.<init>(DrawCircle.java:7)
at DrawCircle.<init>(DrawCircle.java:6)
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class GUI{
DrawCircle circle = new DrawCircle(100,100,50);
private JButton UpButton, DownButton, LeftButton, RightButton, IncreaseButton, DecreaseButton, InputButton;
public void drawframe(){
final JFrame CircleFrame = new JFrame("Frame for Circle");
CircleFrame.getContentPane().add(circle);
CircleFrame.setSize(200,200);
CircleFrame.setVisible(true);
UpButton = new JButton("UP");
UpButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
circle.up();
if(circle.getY() - circle.getR() <= 0) {
JOptionPane.showMessageDialog( CircleFrame, "Out of window");
circle.setY(circle.getY() +10);
RightButton = new JButton("RIGHT");
RightButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
circle.right();
if(circle.getX() + circle.getR() >= 500) {
JOptionPane.showMessageDialog( CircleFrame, "Out of window");
circle.setX(circle.getX() -10);
LeftButton = new JButton("LEFT");
LeftButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
circle.left();
if(circle.getX() - circle.getR() <= 0) {
JOptionPane.showMessageDialog( CircleFrame, "Out of window");
circle.setX(circle.getX() +10);
DownButton = new JButton("DOWN");
DownButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
circle.down();
System.out.println(circle.getY());
if(circle.getY() + circle.getR() >= 500) {
JOptionPane.showMessageDialog( CircleFrame, "Out of window");
circle.setY(circle.getY() -10);
IncreaseButton = new JButton("INCREASE");
IncreaseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
circle.increase();
if(circle.getY() + circle.getR() >= 500) {
JOptionPane.showMessageDialog( CircleFrame, "Out of window");
circle.setR(circle.getR() -10);
} else if(circle.getX() + circle.getR() >= 500) {
JOptionPane.showMessageDialog( CircleFrame, "Out of window");
DecreaseButton = new JButton("decrease");
DecreaseButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
circle.decrease();
JPanel ButtonPanel = new JPanel();
ButtonPanel.add(IncreaseButton);
ButtonPanel.add(DecreaseButton);
ButtonPanel.add(DownButton);
ButtonPanel.add(LeftButton);
ButtonPanel.add(RightButton);
ButtonPanel.add(UpButton);
ButtonPanel.setLayout(new BoxLayout(ButtonPanel, BoxLayout.Y_AXIS));
JFrame mainFrame = new JFrame("GUI for Circle Drawing");
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
mainFrame.add(ButtonPanel);
mainFrame.pack();
mainFrame.setVisible(true);
public static void main(String [] args) {
GUI intf = new GUI();
intf.drawframe();
}and the DrawCircle Class is
import java.awt.*;
import javax.swing.*;
public class DrawCircle extends JPanel{
private int x, y, r;
DrawCircle circle = new DrawCircle(100, 100, 50);
public DrawCircle( int x , int y , int r){
this.x = x;
this.y = y;
this.r = r;
public int getR(){
return r;
public int getX(){
return x;
public int getY(){
return y;
public void setX(int x) {
this.x = x;
repaint();
public void setY(int y) {
this.y = y;
repaint();
public void setR(int r) {
this.r = r;
repaint();
public void paint(Graphics g){
g.clearRect(0,0,400,400);
g.drawOval(x-r, y-r, r*2, r*2);
public void up() {
circle.setY(circle.getY() -10);
public void down() {
circle.setY(circle.getY() +10);
public void right() {
circle.setX(circle.getX() +10);
public void left() {
circle.setX(circle.getX() -10);
public void increase() {
circle.setR(circle.getR() +10);
public void decrease() {
circle.setR(circle.getR() -10);
The problem is that you're constructing a new DrawCircle each time you construct a new DrawCircle, resulting in infinite recursion causing a stack overflow.
This line:DrawCircle circle = new DrawCircle(100, 100, 50);in your DrawCircle class is causing the problem, do you need it? Remove it and replace references to 'circle' in the class with 'this'. -
HI all,
I am working on a program that will print out my initials 'A' and 'T' using arrays. I am asked to initialize the first intial to '*' and the second intial to '@'. I wrote the code but the output is wrong. Can someone help me by letting me know what I am doing wrong in my arrray?I just get back my array of 30X30. I also wrote a driver but when I run the program, I really appreciate it so much.
public class Initial
private char whichinitial ;
private int MAX =30;//Maximum amount for 2-d Matrix
char[][] letterMatrix = new char[MAX][MAX];//2-d Array 30 x30
private boolean first = true;
public Initial()
{ //FIlls Array full of '*'s
whichinitial = '*';
for(int i=0;i< MAX;i++)
for(int j=0;i< MAX;i++)
letterMatrix[i][j] = whichinitial;
public void setLetter(char letter)
{//Setter for Letter
whichinitial = letter;
public char getLetter()
{//Getter for Letter
return whichinitial;
public void firstLetter()
{ //Creates an A shape
for(int i=0;i< MAX;i++)
for(int j=0;j< MAX;j++)
if((i>0)|| ((i<6) || ((j>0) && (j<29))))
letterMatrix[j] =whichinitial;
public void secondLetter()
{//Creates an T shape
first = false;
for(int i=0;i <MAX;i++)
for(int j=0;j <MAX;j++)
if((i>1) ||(j < 29)||(j>5)||(i>10))
letterMatrix[i][j] = whichinitial;
public void display()
{//Displays the Initials
if(first)
System.out.println("\n \n \n My First Initial," + whichinitial + ", follows:");
else
System.out.println("\n \n \n My Last Initial," + whichinitial + ", follows:");
for(int i=0;i <MAX;i++)
System.out.println();
for(int j=0;j <MAX;j++)
if(letterMatrix[i][j] == '*')
System.out.print(" ");
else
System.out.print(letterMatrix[i][j]);I am trying to write a program using a matrix. The size of the maxtrix should be 30X30. The first initial shoulld be initialized to '*' and the secind initial should be initialized to '@'. Both initials should be 30 characters high and 30 characters wide and the initials should also represent the uppercase letter of your initials. I know that the first initial's matrix needs to be filled up vertically and the second initial needs to be filled horizontally but the output is wrong....PLease Help!
Message was edited by:
apples03 -
Hi guys,
I'm developing an ADF application in JDev 11.1.1.6.0. I have problem about using arrays in jsp page. I have an iterator that brings me data from UCM. I just want to take every documents seperately and use in a Jquery division by division.
Can i have chance to use an array tag in that page? Or how can i make it possible my work in a different way?
Thank you so much,
ErdoHi Frank,
I've already use an iterator. I just want to take datas and after close the af:iterator tag. Then i will use those datas in a different block.
My code :
<af:iterator var="node" value="#{nodes}" id="i1">
<af:outputText value="#{node.propertyMap['CSGMNEWS_REGDEF:Desc'].asTextHtml}"
id="ot1"/>
</af:iterator>
I want to take all informations from node.PropertyMap[] and then i will set the values of outputText with those informations. I hope I'm clear.
Regards,
Erdo
Edited by: erdo on 20.Mar.2013 10:21 -
hi i want to know if some can guide me how to use array in apex.
i have a tabuler report with 4 columns.
i need to write a validation in the tabuler report for that i need to used array.
can I directly access the colums as i have shown below? or do i need to decleare this arrays some were in apex?
e.g
FOR i IN 1 .. ow_app.g_f01.COUNT
loop.........................
LOGIC
end loop;
from what i understand i can access each column as ow_app.g_f01,ow_app.g_f02,ow_app.g_f03,ow_app.g_f04 does this make sense?
thanks a lot.Hi user591315 (please tell us your name - we're a friendly group!),
In answer to this and your previous related post, there is an excellent example of what you're looking to accomplish provided by Denes Kubicek available at http://apex.oracle.com/pls/otn/f?p=31517:41
Hope this helps,
John
If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well. -
First, I would like to thank everyone in this forum for all the help they have given me over the past few weeks. With that said, I am currently trying to alter the following code to accept and use arrays to end to produce three seperate results. The program now as three hard coded variables which are
Amount = 200000.00;
Term = 30;
InterestRate = .0575;
I need to have the program work the same, but produce results for three different Terms and Three different periods. Below is the code the I am working on, I have added two arrays containing the required information. I am having a hard time coming up with a for statment to move the program through the two arrays. Any pushes in the right direction would be great. I left the hard code variable in place, I know that I do need to remove them and alter the equations. I just thought it would be easier for everyone to understand if I left the code in working form.
import java.math.*;
import java.text.*;
import java.util.*;
// The Payment class displays a predetermined monthly mortgage payment
public class Payment
public static void main(String[]arguments)
//Creates Two Arrays for InterestRates and Terms
double[] InterestRates = {.0535, .055, .0575};
int[] Terms = {7, 15, 30};
//Creates variables
double Amount;
int Term;
double InterestRate;
//Assigns values to variables
Amount = 200000.00;
Term = 30;
InterestRate = .0575;
//Alters the display format of Amount variable
NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US);
String s = n.format(Amount);
//Creates variables
double MonthlyInterestRate;
int TotalMonths;
double Payment;
//Assigns values to variables
MonthlyInterestRate = InterestRate / 12;
TotalMonths = Term * 12;
Payment = Amount* MonthlyInterestRate / (1-(Math.pow((1+MonthlyInterestRate ),(-TotalMonths))));
//Takes Payment variable and round answer to 2 decimal points
BigDecimal bd = new BigDecimal(Payment);
bd = bd.setScale(2, BigDecimal.ROUND_DOWN);
//Instructions to display various varibles
System.out.println("Cost of Mortgage "+ s);
System.out.println("Length of Term " + Term);
System.out.println("Interest Rate 5.75% ");
System.out.println("The monthly payment of this loan is $" + bd);
System.out.println();
//Creates new set of variables
double MonthlyInterest;
double MonthlyPrincipal;
double TotalInterestPaid;
int NumberofPayments;
//Creates Balance variable
double Balance;
//Initialization of Balance variable
Balance = 200000;
TotalInterestPaid = 0;
NumberofPayments = 360;
//Creates a loop that calculates the entire term of loan
do
MonthlyInterest = Balance * (InterestRate / 12);
MonthlyPrincipal = Payment - MonthlyInterest;
Balance = Balance - MonthlyPrincipal;
TotalInterestPaid = TotalInterestPaid + MonthlyInterest;
NumberofPayments = NumberofPayments - 1;
//Takes current balance and rounds the answer to two digits
BigDecimal bb = new BigDecimal(Balance);
bb = bb.setScale(2, BigDecimal.ROUND_DOWN);
BigDecimal tip = new BigDecimal(TotalInterestPaid);
tip = tip.setScale(2, BigDecimal.ROUND_UP);
System.out.println("New Loan Balance " + bb);
System.out.println();
System.out.println("Total Interest Paid " + tip);
System.out.println();
System.out.println("Number of Payments remaining " + NumberofPayments);
System.out.println();
//The following lines of code pauses the loop to allow the user to read the output
//The speed of th display can be adujusted to a wide variety of speeds
try
Thread.sleep(400);
catch (InterruptedException exc)
//Loop condition
while (NumberofPayments > 0);
//Ends ApplicationTry this. It should give you some ideas. :)
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.Locale;
// The Payment class displays a predetermined monthly mortgage payment
public class Payment {
public static final NumberFormat CURRENCY_FORMAT = NumberFormat.getCurrencyInstance(Locale.US);
public static final double[] INTEREST_RATES = {.0535D, .055D, .0575D};
public static final int[] TERMS = {7, 15, 30};
public static final double AMOUNT = 200000.00;
public static final int MONTHS_PER_YEAR = 12;
public static void main(String[] arguments) {
for (int t = 0; t < TERMS.length; t++) {
for (int i = 0; i < INTEREST_RATES.length; i++) {
displayPayments(AMOUNT, INTEREST_RATES, TERMS[t]);
private static void displayPayments(double amount, double interestRate, int term) {
//Creates variables
//Assigns values to variables
double monthlyInterestRate = interestRate / MONTHS_PER_YEAR;
int totalMonths = term * MONTHS_PER_YEAR;
double payment = amount * monthlyInterestRate / (1 - Math.pow(1 + monthlyInterestRate, -totalMonths));
//Instructions to display various varibles
System.out.println("Cost of Mortgage " + CURRENCY_FORMAT.format(amount));
System.out.println("Length of Term " + term);
System.out.println("Interest Rate " + new BigDecimal(interestRate * 100).setScale(2, BigDecimal.ROUND_HALF_UP) + '%');
System.out.println("The monthly payment of this loan is " + CURRENCY_FORMAT.format(payment));
System.out.println();
//Creates new set of variables
double totalInterestPaid = 0.0D;
//Creates balance variable, Initialization of balance variable
double balance = amount;
//Creates a loop that calculates the entire term of loan
System.out.println("New Loan balance, Total Interest Paid, Number of Payments remaining");
for (int numberofPayment = totalMonths; numberofPayment > 0; numberofPayment--) {
double monthlyInterest = balance * monthlyInterestRate;
double monthlyPrincipal = payment - monthlyInterest;
balance -= monthlyPrincipal;
totalInterestPaid += monthlyInterest;
//Takes current balance and rounds the answer to two digits
BigDecimal bb = new BigDecimal(balance);
bb = bb.setScale(2, BigDecimal.ROUND_DOWN);
BigDecimal tip = new BigDecimal(totalInterestPaid);
tip = tip.setScale(2, BigDecimal.ROUND_UP);
System.out.println(CURRENCY_FORMAT.format(bb.doubleValue()) + ", " +
CURRENCY_FORMAT.format(tip.doubleValue()) + ", " +
numberofPayment);
System.out.println();
//Ends Application -
Hi All!
Anybody know how to use Arrays in Forms 6?
Best regards.Hello,
have you tried collections ?
Declare
TYPE TYP_NUM_ARRAY IS TABLE OF NUMBER INDEX BY BINARY_INTEGER ;
mytab TYP_NUM_ARRAY ;
Begin
For i IN 1..10 Loop
mytab(i) := i ;
End loop ;
End ;Francois -
Hi Guys,
I always had a few problems using arrays and now I need to use them and I am stuck.
on my program i need to create an array of int with the numbers 1 to 1000 in it for this I have done:
int[ ] array;
on the class constructor
array = new int[1000];
to fill the array:
for (int i = 0; i < array.length; i++)
array[i] = i;
The problem is that I always get an ArrayIndexOutOfBoundsException error.
I know how to solve it which is to create an array with 1001 elements but is there a more elegant way of creating the array or this is the way to do it?
To put my question in another way if any of you Guys was creating this program which way would you do it.
Best regards
LuisSloppy of me. This is a bit better:
package cruft;
import java.util.Arrays;
* A class for a one-based array of ints.
public class OneBasedIntArray
private int [] values;
public static void main(String[] args)
int [] values = new int[args.length];
for (int i = 0; i < args.length; i++)
values[i] = Integer.parseInt(args);
OneBasedIntArray intArray = new OneBasedIntArray(values);
System.out.println(intArray);
public OneBasedIntArray(int[] values)
this.values = new int[values.length];
System.arraycopy(values, 0, this.values, 0, values.length);
public int getValue(int index)
if (index <= 0)
throw new IllegalArgumentException("this array is one-based");
return values[index-1];
public void setValue(int index, int value)
if (index <= 0)
throw new IllegalArgumentException("this array is one-based");
this.values[index-1] = value;
public boolean equals(Object o)
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
OneBasedIntArray intArray = (OneBasedIntArray) o;
if (!Arrays.equals(values, intArray.values))
return false;
return true;
public int hashCode()
return (values != null ? Arrays.hashCode(values) : 0);
public String toString()
StringBuilder builder = new StringBuilder();
builder.append("OneBasedIntArray{");
for (int i = 0; i < values.length; i++)
builder.append("(").append(i+1).append(",").append(values[i]).append(")");
builder.append('}');
return builder.toString(); -
Using Arrays in SELECT BULK queries
Dear All,
Can we use arrays in the SELECT Bulk operations.
Example:
SELECT empno BULK COLLECT INTO v_empno FROM EMP WHERE deptno = v_deptno(m);
Is there any way we can simulate this example.
Appreciate your response on this one.
Thanks,
Madhu K.Yes you can. See the example.
SQL> set serverout on
SQL> declare
2 TYPE varr_typ IS VARRAY(2) OF NUMBER;
3 my_varr varr_typ:=varr_typ(20) ;
4 TYPE rec_typ IS RECORD (fname EMPLOYEES.First_Name%TYPE,
5 lname EMPLOYEES.LAST_NAME%TYPE);
6 TYPE tmp_tbl IS TABLE OF rec_typ;
7 my_tbl tmp_tbl;
8 BEGIN
9 --my_varr(1):=20;
10 SELECT FIRST_NAME,LAST_NAME
11 BULK COLLECT INTO my_tbl
12 FROM EMPLOYEES
13 WHERE department_id=my_varr(1);
14
15 FOR i IN 1..my_tbl.COUNT LOOP
16 DBMS_OUTPUT.put_line(my_tbl(i).fname||' '||my_tbl(i).lname);
17 END LOOP;
18 END;
19 /
Michael Hartstein
Pat Fay
PL/SQL procedure successfully completed. -
Error using Arrays.toString()
Hi there,
I am getting the following error using Arrays.toString on a String Array. 'toString() in java.lang.Object cannot be applied to (java.lang.String[]).
The line in question is at the bottom of the below code. It starts 'rtitem.appendText.....
import lotus.domino.*;
//import java.util.Arrays;
public class JavaAgent extends AgentBase {
Database curDb;
String[] dbList;
public void NotesMain() {
int dbcount = 0;
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
//get current database
Database curDb = agentContext.getCurrentDatabase();
//build a list of servers;
String[] servers = {"Norwich002/Norwich/MoneyCentre","Norwich003/MoneyCentre","Norwich004/MoneyCentre","Norwich005/MoneyCentre","Norwich007/Norwich/MoneyCentre","Norwich008/Norwich/MoneyCentre","Norwich010/Norwich/MoneyCentre","Norwich020/Norwich/MoneyCentre","Norwich021/Norwich/MoneyCentre"};
//loop through server list
int arraylen = servers.length;
for(int i=0;i <= arraylen;i++){
//create a notesdbdirectory collection for the current server iteration
DbDirectory dbdir = session.getDbDirectory(servers);
//get first database
Database db = dbdir.getFirstDatabase(DbDirectory.DATABASE);
//loop through databases in dbdir
while (db != null){
//add database details to our list
dbList[dbcount] = db.getTitle() + " - " + db.getFilePath();
dbcount++;
} catch(Exception e) {
e.printStackTrace();
private boolean sendEmail(String subject){
try{
Document mailDoc = curDb.createDocument();
mailDoc.replaceItemValue("SendTo","Hayleigh S Mann/Norwich/MoneyCentre");
mailDoc.replaceItemValue("Subject",subject);
RichTextItem rtitem = mailDoc.createRichTextItem("Body");
rtitem.appendText(java.util.Arrays.toString(dbList));
mailDoc.send();
return true;
}catch(Exception e){
e.printStackTrace();
return false;No, that doesn't make any sense. Arrays.toString can take any array as an arg: [http://java.sun.com/javase/6/docs/api/java/util/Arrays.html#toString(java.lang.Object[])]
import java.util.*;
public class A {
public static void main(String[] args) {
String str = Arrays.toString(args);
System.out.println(str);
:; java -cp . A abc 123 xxx
[abc, 123, xxx]
Maybe you are looking for
-
Enhancement points option: Function modules or BADI
Hi, I am on ECC 6.0 and I need to validate and set some requirement in customer sales area data when user input the document output message in Documents tab strip screen 7003 of sapmf02d in transaction XD01 or XD02. I found that there is function
-
Duplicating video and wasting storage space???
Here is the scenerio: I have numerous old family movie tapes, but I will just talk about one. On this tape there are 6 different events (birthday, science fair, playing outside, etc). I have purchased an external 500GB hard drive to store footage dir
-
How to send huge no. of excel sheet attachment to a mail ID
HI , I have mail functionality program which send mail to a mail id with multiple excel sheet attchment. I have done all these things. When it sends small number of excel attchment then it's ok. But when it sends huge number of excel attch
-
Search Help Deep Level Accessibility
Hi Experts, I have created a 3 search helps and all with an import paramters. From first search help selection field, if I press F4 on some field(having search help attached), it calls second search help and now on second search help I press F4 on so
-
Connecting 2 WLS 7 servers via the Messaging Bridge
Hi, I am trying to use the messaging bridge to post messages received on a source JMS queue running in one WLS instance to a destination queue running on another target WLS instance. I have followed the instructions in t