How to use an Array
Morning all,
I am trying to setup an array of numbers however, by looking at the crystal reports help file, I cannot find out how to set one up.
I have created a new formula and inserted
Local NumberVar Array x := MakeArray (1, 2, 3, 4, 5);
however, it says you cannot set a result to an array.
I have also looked at the Array help, but Crystal shows a VB syntax instead of Crystal. (How helpful to show VB syntax in CR!)
My question is how can you use an array in your report that it shows numbers 1-5?
many thanks
Kind Regards
Jehanzeb
The question is - what you want to do with this array. Your code is correct , beside that you need to return something from formula and that needs to be discrete value.
Local NumberVar Array x := MakeArray (1, 2, 3, 4, 5);
"test"
Similar Messages
-
How to use OracleDbType.Array provided by ODP with User defined type ?
Can anyone help me how to use OracleDbType.Array provided by ODP.NET ?
I need to pass string array to a oracle stored procedure .
User defined array type defined in oracle is :
CREATE TYPE TYPE_NAME IS TABLE OF varchar2(20) ;
This type is defined outside of any package , and i have tested that if definition of type is modified to
CREATE TYPE TYPE_NAME IS TABLE OF varchar2(20) index by binary_integer , i am able to pass array as AssociativeArray to my Stored Procedure.
But how to pass array object if the Type's definition does not contain index by clause ?
Please help how to pass Array object to Oracle Stored Procedure ?The solution described in Passing Array of UDT or Collection as IN OUT using OracleDbType.InputOutput
is working for me.
Edited by: stzueger on Jan 2, 2012 10:32 AM -
How to use Javascript array in the JSP
hELLO Friends,
I am creating an String array using the values
in the list of a jsp page using Java script..
How can I use this array in the same jsp
file for processing...
any help in this regard would be highly appreciated.
thanks in Advance...
ashishyou cannot pass values from javascript to JSP without having to form-post to another JSP page.
-
Hi, i'm trying to automate a questionary using array.
// In the compositionReady for the stage
sym.actual = 0;
sym.arr = [ "Hi","Love","You" ] // This is my question array.
sym.checkArr = function(){ // this the function that i use to check whis question of the array i'm going to use.
sym.Question = arr[actual]; // i want to use the value "Hi", and then increase my "actual" var and then use the value "Love"
// In my symbol timeline i use a trigger, in that trigger i use
sym.stop();
sym.quest = sym.getComposition().getStage().Question; // I'm getting the Question value;
sym.$("Ask").html(quest ); //"Ask" is an empty textfield;
sym.getComposition().getStage().actual ++; // Increase "actual" for the nex time.
But the code doesn't work, i think the problem is the way i use the array index.
Please help!
Thanks =)Hi there,
chino_10 wrote:
in te timeline trigger why did you use a local variable?
It's good practice to use local variables whenever possible. The quest variable will only apply to that trigger, and it won't carry over to another trigger in the same timeline. So when using a trigger to set the HTML of a text element in the same timeline, I find it cleaner to assign a new HTML value from a local variable.
chino_10 wrote:
and if you are calling the global variable "actual" from de compositionReady handler why didn'y you call it with all the path like "sym.getComposition().getStage().actual ++;"?
I think maybe I didn't express it as clearly as I could have. When you declare sym.actual in compositionReady, you actually have declared a variable scoped to the main stage symbol - it's not a global variable. To declare a global variable (which is not always best practice), your code in compositionReady would be:
actual = 0;
This actual variable would now be accessible from any element/symbol in the composition simply by assigning a value to actual. You may see how this could quickly get messy.
So getting back to variable scope: if you declare a symbol variable using sym.varName, then any element in the same scope can call it using sym.varName. So your main timeline triggers can call it without using the full addressing of sym.getComposition().getStage().actual++. Instead, you could just use sym.actual++. Less code, and easier to read. But if you wanted to call it from another symbol (outside of the scope of the main stage), then you'd have to use the full addressing to actually address the variable, i.e., sym.getComposition().getStage().actual ++.
hth,
Joe -
How to use an array in a SQL Query
Hi
I need to use an array of numbers such as a VARRAY or Associated Index Array so that I can do the following SQL:
select *
from *
where array is null or id is in array
So that if the array is empty it will return all the records, and if the array is not empty then it will return only the rows associated with the ids in the array.
Is this possible?
Regards,
Néstor BoscánActually, solution I posted returns all rows when VARRAY is empty, not when it is null. To return all rows when VARRAY is null, use:
SQL> select ename
2 from emp
3 where deptno in (select * from table(cast(sys.OdciNumberList(10,30) as sys.OdciNumberList)))
4 or sys.OdciNumberList(10,30) is null
5 /
ENAME
ALLEN
WARD
MARTIN
BLAKE
CLARK
KING
TURNER
JAMES
MILLER
9 rows selected.
SQL> select ename
2 from emp
3 where deptno in (select * from table(cast(null as sys.OdciNumberList)))
4 or null is null
5 /
ENAME
SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS
ENAME
JAMES
FORD
MILLER
14 rows selected.
SQL> SY. -
How to use Associative Array in sql query?
Hello,
I have a problem on using Associative Array variable on query; and my query is similar to the one below;
TYPE OTHERGENERICS IS TABLE OF NUMBER(10) INDEX BY BINARY_INTEGER;
othersGenerics OTHERGENERICS;
CURSOR cursor_othersGenerics IS
select master.GENERICCODEID
from ASMTRG_ARTICLEMASTER master
join ASMTRG_ARTICLEMAP map on MAP.ARTICLECODEID = MASTER.ID
group by MASTER.GENERICCODEID
minus
select FGG.GENERICCODEID
from asmtrg_icfocusgroup fg
join asmtrg_icfocusgrpchannel fgc on FGC.GROUPID = FG.ID and fgc.isactive=1
join asmtrg_icfocusgengroup fgg on FGG.GROUPID = FG.ID and FGg.ISACTIVE=1
where fgc.channelid=1 and fg.isactive = 1
group by FGG.GENERICCODEID;
BEGIN
OPEN cursor_othersGenerics;
FETCH cursor_othersGenerics BULK COLLECT INTO othersGenerics;
CLOSE cursor_othersGenerics;
SELECT icfrd.*,
CASE
WHEN EXISTS(select ta.genericcodeid from <???XXX???> ta where ta.genericcodeid = icfgrp.genericcodeid) THEN -1
ELSE icfrd.icfgroupid
END CLASSIFICATION
FROM ASMTRGVIW_ICFOCUSREPORTDATA icfrd
LEFT JOIN ASMTRG_ICFOCUSGROUP icfgrp on icfrd.ICFGROUPID = icfgrp.ID
WHERE (channelId IS NULL OR icfrd.CHANNELID = channelId)
AND (asmCodeId IS NULL OR icfrd.ASMCODEID = asmCodeId)
AND (yearId IS NULL OR icfrd.YEARID = yearId)
AND (monthId IS NULL OR icfrd.MONTHID = monthId)
END;
By the way this is a part of my function.
The "othersGenerics" is my associative array variable and <???XXX???> is the place where I need to use my "othersGenerics" array to check. So far I've tried
"select ta.genericcodeid from table(cast(otherGenerics as OTHERGENERICS)) ta where ta.genericcodeid = icfgrp.genericcodeid",
"select ta.genericcodeid from table(otherGenerics) ta where ta.genericcodeid = icfgrp.genericcodeid",
"select ta.genericcodeid from otherGenerics ta where ta.genericcodeid = icfgrp.genericcodeid"
and these are not working.
What is your suggestions?Your type will have to be created as an independent object in your schema. So CREATE TYPE cannot be in your function declaration, it has to be outside it. (And then the line inside your declaration that defines the type will have to be removed.)
But now I can see that you use this array as a kind of "temporary lookup table" - you populate the array and then use it for lookup in your select statement. An alternative way of doing this could be like this completely without arrays:
with othergenerics as (
select master.GENERICCODEID
from ASMTRG_ARTICLEMASTER master
join ASMTRG_ARTICLEMAP map on MAP.ARTICLECODEID = MASTER.ID
group by MASTER.GENERICCODEID
minus
select FGG.GENERICCODEID
from asmtrg_icfocusgroup fg
join asmtrg_icfocusgrpchannel fgc on FGC.GROUPID = FG.ID and fgc.isactive=1
join asmtrg_icfocusgengroup fgg on FGG.GROUPID = FG.ID and FGg.ISACTIVE=1
where fgc.channelid=1 and fg.isactive = 1
group by FGG.GENERICCODEID
SELECT icfrd.*,
CASE
WHEN EXISTS(select ta.genericcodeid from othergenerics ta where ta.genericcodeid = icfgrp.genericcodeid) THEN -1
ELSE icfrd.icfgroupid
END CLASSIFICATION
FROM ASMTRGVIW_ICFOCUSREPORTDATA icfrd
LEFT JOIN ASMTRG_ICFOCUSGROUP icfgrp on icfrd.ICFGROUPID = icfgrp.ID
WHERE (channelId IS NULL OR icfrd.CHANNELID = channelId)
AND (asmCodeId IS NULL OR icfrd.ASMCODEID = asmCodeId)
AND (yearId IS NULL OR icfrd.YEARID = yearId)
AND (monthId IS NULL OR icfrd.MONTHID = monthId)
...The with clause (subquery factoring) you can think of as a kind of temp table called othergenerics created "on-the-fly".
The optimizer may decide to actually create a temp table for you and use in the lookup, or it may decide to rewrite the query into suitable joins or nested loops or hashing - whatever the optimizer decides will be the optimal way of doing things :-)
So unless you use your array other places in your function, I would recommend dropping the array completely, skip populating an array, and instead use a with clause for your temporary lookup. -
How I use an array in class2 if I create it in class1
I have 2 class
class1
create array1
class2
how I use the array1public class Class11 {
public static void main(String[] args) {
char[] c = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h' };
Class22 c2 = new Class22(c);
class Class22 {
char[] c;
Class22(char[] p) {
c = new char[p.length];
System.arraycopy(p, 0, c, 0, p.length);
}Mark -
I am giving the input below shows
<to>
<email>[email protected]</email>
<email>[email protected]</email>
</to>
i will put the while loop and i count the index values.
in while loop,it takes only one email id.
my coding is
<while condilition=('varindex'<ora:countnodes('inputvariable','payload',/client:to))>
<assign activity>
<first copy rule>
<vartemp= concat('vartemp',"",bpws:getvariabledata('email'))>
<second copy rule>
<varindex = vraindex+1>
</assign>
</while>
but vartemp adds only 1st email id.if i pass <vartemp= concat('vartemp',"",bpws:getvariabledata('email[varindex]'))> ,It shows error.
pls how to retrieve the two email ids using array index.
Edited by: user8984400 on Jan 13, 2010 11:22 PMhave you tried this :
http://clemensblog.blogspot.com/2006/03/bpel-looping-over-arrays-collections.html
or this :
http://oraclebpelindepth.blogspot.com/2008/09/arrays-in-bpel_21.html
your assign should be something like :
before this assign outside the loop you can assign the counter_index to some variable by ora:countnodes('inputvariable','payload',/client:to), and use this variable in the other xpaths
<from expression="concat('/ns1:to/ns2:mail[',bpws:getVariableData('Variable_Index_Counter'),']') "/>
<to variable="Variable_Xpath"/>
notice also the [] characters, you need those together with the index-value to be able to loop over the list of email-elements
hope its clear? -
How to use an array of references
Hi,
I defined a couple of GOOP objects, each of which has a reference. I want to dynamically add/remove these references into/from an array and, in my implementaion, I had this array a globle variable so that different VI's can access it.
But I always got a "refnum conflict" error when I tried to insert a new reference into the array.
Why? Thank you.
-JianchuThanks, Jim.
I am working on some plug-and-play medical instrumentation prototyping. Two GOOP objects (ECG,PO) are developed. In my LabVIEW code, I need to open/close these two objects when corresponding devices connected to/disconnected from the computer.
I want to build a reference array which I can use to operate (primary data storage) the appropriate object.
I browsed your webpage "Object Oriented Design methods in LabVIEW " on OpenG.org. I guess my problem is related to the so-called "Datalog File Refnum Shell", but I don't have an exact idea.
I attached the two GOOP files and a test fie showing the wiring error.
Your help is highly appreciated.
-Jianchu
Attachments:
test_refnum.vi 23 KB
ECG.llb 393 KB
PulseOx.llb 367 KB -
How to use an array for variable name of swing components using NetBeans
I'm completely new to Java and GUIs, so excuse me if I use the wrong terminology. I'm making a JFrameFrom in NetBeans. I'm getting really tired of typing instructions like jTextField15.setText(variable[15].text); I would like to make the variable names of my text fields an array so I can use a loop to change the values, text, tooltips, etc. When I click "change variable name" it won't let me put an array in. The code that Swing generates is protected and I can't change it. I know there must be a way to do this. Any help is appreciated.
Try not to use the NetBeans visual GUI builder. Then it should be easy to create an array of text fields:
JTextField[] tfs = new JTextField[15];
for (int i = 0; i < tfs.length; i++) {
tfs[i] = new JTextField(10);
}For laying out the text fields, see: [http://download.oracle.com/javase/tutorial/uiswing/layout/using.html] -
I want to link nine arrays whose dimension is 2*2 horizontally,but the function 'build array' (concatenated way) made them vertically.........help me please..........maybe this is too simple.........since I am only a students who learnd labview only few months..
Solved!
Go to Solution.A transpose operation only solves certain scenarios, but you don't give enough information on what you actually want.
For example, of you have 3 2x2 arrays:
a1 a2 b1 b2 c1 c2
a3 a4 b3 b4 c3 c4
What should the final vertical result be?
a1 a2
a3 a4
b1 b2
b3 b4
c1 c2
c3 c4
or
a1 a3
a2 a4
b1 b3
b2 b4
c1 c3
c2 c4
Or something else?
Please be much more specific. Maybe even attach a small VI containing typical default data.
LabVIEW Champion . Do more with less code and in less time . -
How to Use SOAPArray to Exchanged Data with a Web Service
The method of a prototype Web service I created is defined to take many parameters
and return an object of a user defined class. Furthermore, the user defined class
includes data elements of another user defined class and the Java ArrayList class.
This works with a Java client referencing the WebLogic created client.jar file
but I don't know how well it will work with a non-Java client. In particular,
with Perl which is the language that will be used by the developer who first will
test with the prototype.
In posts to this newsgroup use of "language-specific, generic containers" has
been discouraged and the "language-agnostic" SOAPArray recommended. I have searched
this newgsroup and the Web for examples of how to use a SOAPArray in a Web service
EJB to receive parameters and return results but found none.
Will someone refer me to an example or give an overview of how a Java Web service
EJB running in WebLogic 6.1 would use SOAPArray to get parameter values and return
results?
Also, I would like confirmation that it is best to use SOAPArray to exchange data
with a Web service to achieve the goal of a service accessible by any language.
Thank you.Replies in-line:
How are the structures, e.g. gltrans-workType, defined in the Web service?The structure is made up of nested Java Beans, but this does not mean that the
client for your web service has to be written in Java. The WSDL that I sent contains
everything that a .NET-based (or Perl-based, or Python-based, or VB-based, or
C++ based) Web Service Stack needs to correctly create all the data types in the
web services' signature! That's the beauty of XML Schema! It's programming language
independent :-)
In
other words, what definition in Java resulted in the WSDL statements?The WSDL wasn't produced by WLS 6.1, but it (WLS 6.1) can consume it.
What is the signature of method submitGLTransWorkAsJavaBean() in the
Web service?public void submitGLTransWorkAsJavaBean(GlTransactionsCpyType glTransactionsCpyType)
GlTransactionsCpyType is the outer-most Java Bean. WLS 6.1 does not generate
Java Beans for you, but it will use ones that you defined. See the Java Bean tutorial
on the Javasoft sitem for details on how to create a Java Bean.
Was the WSDL generated using the WL tools for creating a Web service?No.
Conclusion:
You asked for someone to provide you with an example of how to use SOAP array
in a WSDL, which is what the attached file contained :-) What you want to do now
is find a tool that can generate Java Bean code from this WSDL (Apache Axis has
a wsdl2java tool that should work), or create the Java Beans yourself. Afterwards,
create a WLS 6.1 Web Service a expose it for a Perl or .NET client.
Regards,
Mike Wooten
"Jeff Carey" <[email protected]> wrote:
>
Please elaborate.
How are the structures, e.g. gltrans-workType, defined in the Web service?
In
other words, what definition in Java resulted in the WSDL statements?
What is the signature of method submitGLTransWorkAsJavaBean() in the
Web service?
Was the WSDL generated using the WL tools for creating a Web service?
Thank you.
"Michael Wooten" <[email protected]> wrote:
Hi Jeff,
Sounds like a pretty cool prototype :-)
I have attached a WSDL (at the bottom of this post) that contains a<schema>
that
uses a SOAPArray to create an array of a <complexType>.
HTH,
Mike Wooten
"Jeff Carey" <[email protected]> wrote:
The method of a prototype Web service I created is defined to take
many
parameters
and return an object of a user defined class. Furthermore, the user
defined class
includes data elements of another user defined class and the Java ArrayList
class.
This works with a Java client referencing the WebLogic created client.jar
file
but I don't know how well it will work with a non-Java client. Inparticular,
with Perl which is the language that will be used by the developerwho
first will
test with the prototype.
In posts to this newsgroup use of "language-specific, generic containers"
has
been discouraged and the "language-agnostic" SOAPArray recommended.
I have searched
this newgsroup and the Web for examples of how to use a SOAPArray in
a Web service
EJB to receive parameters and return results but found none.
Will someone refer me to an example or give an overview of how a Java
Web service
EJB running in WebLogic 6.1 would use SOAPArray to get parameter values
and return
results?
Also, I would like confirmation that it is best to use SOAPArray toexchange
data
with a Web service to achieve the goal of a service accessible by any
language.
Thank you. -
Using two arrays to hold x,y coordinates
Hi, all
Does any1 know how to use 2 arrays to hold x,y coordinates of five rectangles all of which are 30 by 40 pixels in size?Your homework assignment probably meant to use a 2-dimensional array, not to create two separate arrays.
Like this:
int rectangles[][] = new int[100][100]; -
How do I use an array variable in the assignment target?
Hi,
I am creating a BPEL process in which I have to use an array variable. The array variable needs to be initialized based on some condition.
The issue is I cannot find a way to set the value of the array variable. There are ways to GET the value of an array variable indexing into it.
But how do I set the value by using the Array variable in the <to> tag?
Any help is appreciated. I am using BPEL 10.1.2.0.2.
Thanks.You can declare a variable of type integer which will server as your index. Figure out based on some condition in your process which index of array to update. Assign to your integer variable you created.
And have Assign copy operation like this -
<copy>
<from variable="Var_Output_FetchDueDate"
part="OutputParameters"
query="/ns18:OutputParameters/ns18:DUEDATE"/>
<to variable="outputVariable" part="payload"
query="/client:GetCustomerAccountInformationProcessResponse/client:customer/client:accounts/client:account[$Var_Counter]/client:dueDate"/>
</copy>
I have been using this in my processes. -
I guess I'll show you what I am trying to do rather and then explain it
public class arraycalc
int[] dog;
public void arraycalc()
dog = new int[2];
public void setSize(int size)
dog[1] = size;
public int getSize()
return dog[1];
This gives me a null pointer exception...
How can I use my array from other methods?You have to make the array static. :)
Although I must admit, this is rather bad usage. What you want to do is use an object constructor to make this class an object type, and then create the array in your main class using this type, and then call the methods from this class to modify your array. Creating the array inside the other method leads to a whole bunch of other stuff that's ... well, bad. :)
Another thing: Because you're creating your array inside this class and you want to call your array from another class, you need to make the array static; to make it static, you must make your methods static. And according to my most ingenious computer science teacher, STATIC METHODS SUCK. :D
So, if you want to stick with your layout, it would look like:
public class arraycalc
static int[] dog;
public static void arraycalc()
dog = new int[2];
public static void setSize(int size)
dog[1] = size;
public static int getSize()
return dog[1];
}But I must warn you, that is absolutely horrible code, and you shouldn't use it. In fact, I don't even know why I posted it.
You should definitely read up on OOP, as this problem would be better solved by creating a new object type.
Maybe you are looking for
-
Able to change the borders of panels etc. but not tabbedpane???
hi! i am able to set the borders of panels, frames, almost everything to lineborder but when i do this for tabbedpanes, nothing happens and i still get shadowy borders for it... what culd be the reason??/
-
Facing problem with displaying of charts in WAD
Hi, When i try to display graph(charts) in WAD i get this error : " Internal erroe while communicating with IGS " Can anyone please help me with this, also if there is some doc available on the use of Charts in WAD or some doc on how to use features
-
Registration reminder suddenly not working ?
Laptop purchased in February and has been successfully registered for warranty etc with Toshiba. In the last 10 days I have had repeated error messages that the Toshiba registation reminder has stopped working - the windows error message is in fact :
-
Hi friends i'm facing 2 problems1. my bluetooth is not working properly, initially it wont show any blutooth icon when i start up, but after i restart it shows and start working, every time i need to repeat this to use bluetooth. kindly suggest me th
-
Is there a way to get Microsoft based Header(s) files to compile in LabWIndows/CVI. It appears that LabWindows/CVI does not like the words "BOOLEAN" or "HANDLE" in the header file for an example? Is there a switch that I need to set in LabWindows EN