How define a global variable in a class that all the methods will recognize
hi friends,
i need to define a global variable in a class that all the methods will recognize it.
any suggestions?
thanks,
dana.
Dera Dana,
In se24, create your own "Z" class.
Open the Attributes tab.
Insert your variable in the declaration part.
EQ:
Attribute Level Visibility Typing Associated Type Description
ITAB Instance Attribute Public Type Structure name Description
In the Layout of View page,
<phtmlb:formLayoutDropDownListBox id = "Dropdown"
label = "Drop Down"
table = "<%= controller->Itab %>"
nameOfKeyColumn = "CODE"
nameOfValueColumn = "VALUE"
selection = "<%= controller->feild to be selected %>"
/>
Hope this will be helpful
Regards,
Gokul.N
Similar Messages
-
How can I change my iTunes, Apple and icloud to my yahoo account instead of it being on hotmail, I have yahoo on apple but my iTunes and iCloud still reading my hotmail and I don't know my pw for my hotmail account. I can't update or get apps due to it it going to my hotmail address once logged in to apple it said I can log into iTunes, and iCloud but that's not the case plz help
First sign out of everything,
Second make sure you know the current password
Third got to id.apple.com
Fourth use said password and your hotmail account to sign in then change the primary -
How to send a variable from one class to another?
hello,
i have "One.as", which is the document class for one.swf.
i also have "two.swf", with "Two.swf" entered as its document
class...
One loads two into it. two is basically a 10 frame movieClip
with a variable at the beginning called "var endFrame:Boolean =
false", then on the last frame it says endFrame = true.
my question: how in the world do I communicate this back to
One.as??? i've tried ENTER_FRAME listeners, declaring the variable
here and there... and many other embarrassingly usuccessful
strategies.
i would just like to load in "three.swf" after two.swf
finishes... but One needs to know that it has indeed finished.
your help would be greatly appreciated. thanksyarkehsiow,
> David,
> thank you for responding.
Sure thing! :)
> so does what you are saying mean that endFrame is a
property of
> two (the movieClip), or Two (the Class)?
If you've written a property named endFrame for your Two
class, then
yes, Two.endFrame is a property of that class.
Looking back at your original post, I see that you wrote
this:
> One loads two into it. two is basically a 10 frame
movieClip
> with a variable at the beginning called "var
endFrame:Boolean = false",
> then on the last frame it says endFrame = true.
So it sounds like your Two class extends MovieClip. (I'm not
sure
that's true, but that's what it sounds like.) That means your
Two class
supports all the features of the MovieClip class, including a
play() method,
a currentFrame property, and so on. In addition, you've added
new
functionality that amounts to -- by the sound of it -- a
property named
endFrame. If you made your property public (i.e., public var
endFrame),
then it should be accessible by way of an object reference to
your Two
instance.
myTwoInstance.endFrame;
> so can i invoke that method in One.as? do I call it
Two.endFrame (if
> (Two.endFrame == true) {?
Methods are things an object can *do,* such as
gotoAndPlay(). What
you're describing is a property (a characteristic ... in this
case, a
Boolean characteristic). You wouldn't use the expression
Two.endFrame
unless that property was static. Static classes are those
that cannot have
an instance made of them. Think of the Math class. It
contains numerous
static properties in the form of constants, such as Math.PI,
Math.E,
Math.SQRT2, and so on. You can't create an instance of the
Math class -- it
wouldn't make sense to -- so Math is a static class.
On the other hand, you definitely create instances of the
MovieClip
class. Every movie clip symbol is an instance of MovieClip
class, which
means that each instance carries its own unique values for
MovieClip class
members. The MovieClip class defines x and y properties, but
each movie
clip symbol (that is, each instance of the MovieClip class)
configures its
own values of those properties, depending on where each
instance is located
on the Stage.
Assuming your Two class is not static, then somewhere along
the line,
your One class will have to make an instance of it. Somethine
like ...
// inside your One class ...
var myTwo:Two = new Two();
... at which point that myTwo variable because a reference to
that
particular instance of Two. You can invoke Two methods on
that instance.
You can invoke Two properties and events on that instance.
You can invoke
whatever functionality is defined by the Two class on that
myTwo instance.
If Two extends MovieClip, that means you can also invoke any
MovieClip class
member on that myTwo instance.
At some point in your One class, you can refer to that myTwo
instance
later and check if the value of myTwo.endFrame is true or
false.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design." -
How to modify global variable in a function?
Hello,
I want to modify a globalvariable in a function, at first I did it this way:
class Global_output_class
GlobalDim("Correlation_Status,fail_part,End_Exp")
dim pouet
Correlation_Status = 12
Call Correlation()
pouet = Correlation_Status
Function Correlation()
Dim Global_output_class_sub
Set Global_output_class_sub = new Global_output_class
Correlation_Status = 1
fail_part = 2
End_Exp = 3
Global_output_class_sub.CorrelationStatus = Correlation_Status
Global_output_class_sub.failpart = fail_part
Global_output_class_sub.EndExp = End_Exp
set Correlation = Global_output_class_sub
End function
In this case: correlation_status receive the value 12, then I go to my function correlationn() where it became 1
Then it goes out of the subfunction and takes the previous value from the program(12) ( I dont want that)
To solve the problem I made it this way:
class Global_output_class
public CorrelationStatus
public failpart
public EndExp
end class
GlobalDim("Correlation_Status,fail_part,End_Exp")
Correlation_Status = 12
Set Global_Output = Correlation()
Correlation_Status = Global_Output.CorrelationStatus
fail_part = Global_Output.failpart
End_Exp = Global_Output.EndExp
pouet = Correlation_Status
Function Correlation()
Dim Global_output_class_sub
Set Global_output_class_sub = new Global_output_class
Correlation_Status = 1
fail_part = 2
End_Exp = 3
Global_output_class_sub.CorrelationStatus = Correlation_Status
Global_output_class_sub.failpart = fail_part
Global_output_class_sub.EndExp = End_Exp
set Correlation = Global_output_class_sub
End function
This way my global value are recopied in themselves after leaving the subprogram
I got a lot of variables, is there any easier way so the global variable modified in a function keep the value after leaving the function?
Thanks for help,
Fred
Solved!
Go to Solution.Hi Fred,
it is possible to use a global defined variable but the better way is to use to use a funtion call (or procedure call) with parameters. Please find first the good solution for a funcion call with parameter and the sub-optimal way with an global valiable:
dim oParameter
set oParameter = new cGlobal_output_class
oParameter.Correlation_Status = 12
msgbox "Correlation_Status before Call Correlation: " & oParameter.Correlation_Status
Call Correlation(oParameter)
msgbox "Correlation_Status after Call Correlation: " & oParameter.Correlation_Status
Function Correlation(oPara)
msgbox "Correlation_Status in the FUNCTION before change: " & oPara.Correlation_Status
oPara.Correlation_Status = 1
oPara.fail_part = 2
oPara.End_Exp = 3
msgbox "Correlation_Status in the FUNCTION after change: " & oPara.Correlation_Status
End function
class cGlobal_output_class
dim Correlation_Status,fail_part,End_Exp
end class
call GlobalDim("oPouet")
dim oPouet
set oPouet = new cGlobal_output_class
oPouet.Correlation_Status = 12
msgbox "Correlation_Status before Call Correlation: " & oPouet.Correlation_Status
Call Correlation()
msgbox "Correlation_Status before Call Correlation: " & oPouet.Correlation_Status
Function Correlation()
msgbox "Correlation_Status in the FUNCTION before change: " & oPouet.Correlation_Status
oPouet.Correlation_Status = 1
oPouet.fail_part = 2
oPouet.End_Exp = 3
msgbox "Correlation_Status in the FUNCTION after change: " & oPouet.Correlation_Status
End function
class cGlobal_output_class
dim Correlation_Status,fail_part,End_Exp
end class
Greetings
Walter -
Webdynpro - how to add global variables and common proj to existing proj
How to add global variable in either ViewController or CustomController. We realise that codes must be added within the begin and end exction. Codes outside that will be deleted when saved.
How can we add a common WDP project to an existing project? We have actually added a common wdp project at the project references screen. But during runtime, we encouter error. The error is classNotFoundException. The class is the class created in the common project.Hi.
I think you need to assign ProB to ProA.
Step1.
Open propety of ProjectA.
Step2.
Select WebDynproRefrences
Step3.
Select Sharing references
Step4.
Choose add button.
Step5.
If your projectA named "testapp" and you are not using
DC "local/testapp" is the proper name.
I hope that it work!!!. -
How declear global variable in form and use all form
hi master,
sir,
how i declear global variable in form and how use this variable in all form
i have year table and pik current year or date form table and move in global variable and use in all form
please give ma idea
thanking you
AamirOk, so, what characterset was your database created with?
Does that characterset have a representation of that character?
-Mark -
How to use the class CL_CTMENU with the method DISABLE_FUNCTIONS
Hi Friends,
How to de-activate some functions in the Menu bar?
Eg: - Sales document
Create
Change
Display
I want to de-activate "Change"
In other words: - How to use the class CL_CTMENU with the method DISABLE_FUNCTIONS in my program.
Regards,
Hari
Edited by: Bhatlapenumarthy Hari Krishna on Jun 9, 2008 5:22 PMKrishna,
It is not possible to deactivate the CHANGE option in themenu bar using the method disable_functions of cass CL_CTMENU. This method allows you to deactivate only the function codes of the CONTEXT MENU, which is available only when u press the left mouse button.
U can use the SET PF-STATUS 'XXX' EXCLUDING fcodes option to disable the CHANGE.
*****Reward points if useful
Regards,
Kiran Bobbala -
Global TOp for all the methods
HI all,
I am creating a class, And creating 10 methods inside that class.
i want to use a single TOP program for data declearation which shud applicable in whole class, so that automatically it eccepts all the methods.
any idea HOW to create that global data declearation for all methods.
thanks,
joHello Jo,
In OO-Concept the class variables (Instance or Static) are always visible to the methods.
If you are different classes, and you want to share variables between them, I would recommend you to use a super class or an interface for the sharing functionalities. Of course these concepts are not exactly for sharing variables. But nevertheless it might help you to solve your problem.
P.S. I just wanted to simplify the context a little. Naimesh Patel deserves the credit, since he has given the right answer
Greetz
G.Fendoglu -
Actual Mechanism of Object class as Parent Class to all the classes
Hi All,
We know that all the classes in the java platform are descendants of Object class. Even if we are writing a new class also, in the absence of any other explicit superclass, every class is implicitly a subclass of Object. As we are not extending the Object class directly, then how come the methods in the Object are inheriting to the Sub class what we have written? How the java maintain this heirarchy?
Can you please explain this elaborately?
Thanks in Advance,
UdayUdaya Shankara Gandhi wrote:
Hi All,
We know that all the classes in the java platform are descendants of Object class. Even if we are writing a new class also, in the absence of any other explicit superclass, every class is implicitly a subclass of Object. As we are not extending the Object class directly, then how come the methods in the Object are inheriting to the Sub class what we have written? How the java maintain this heirarchy? Because the language is defined that way. Compilers implement the language according to the rules of the JLS. Exactly how they do that is undefined. It's up to each compiler. As long as it follows the rules defined in the JLS for parsing the code and generating the .class file, that's all that matters. However, somewhere in the compiler is code that does approximately this:
if (class has an extends clause) {
generate corresponding bytes for extends in .class file
else {
generate bytes for extends java.lang.Object in .class file
}No great mystery, nor philosophical question. -
How to create a single 'not null ' validation for all the items in a page ?
Hi everyone ,
how to create a single 'not null ' validation for all the items in a page ? I have many textfields . Instead of creating 'not null' validation for each item , I would like to create a a single validation control that will serve the purpose
Thanks & Regards
UmerNice1 wrote:
bob , as u said I have done the following :
1) under create button , there are 9 items and for each item I have set Required to 'Yes'
2) under delete button , there is 1 item and have set Required to 'Yes' for the item
3) defined page validation for 9 items under 'create ' button and have set it to fire when 'create ' button clicked
4) defined page validation for 1 item under 'delete ' button and have set it to fire when 'delete ' button clicked
now , when I click 'create' button it even shows for the item under 'Delete ' button that it is a required itemSorry, I didn't see this note. The required template won't work, there is no way to attach it to the button.
The best solution is as the reply a couple replies up
Create 2 page type validations as a PL/SQL with code
1st validation
:P1_ITEM1 IS NOT NULL and :P1_ITEM2 IS NOT NULL ...... and :P1_ITEM9 IS NOT NULL include all 9 items
Set the When Button Pressed to the CREATE button
2nd validation
:P1_ITEM10 IS NOT NULL
Set the When Button Pressed to the DELETE buttonI think that's going to be the easiest way to do it.
Edited by: Bob37 on Apr 27, 2012 12:02 PM -
Serializing a class that implements the Singleton pattern
Hello,
I am relatively new to Java and especially to serialization so the answer to this question might be obvious, but I could not make it work event though I have read the documentation and the article "Using XML Encoder" that was linked from the documentation.
I have a class that implements the singleton pattern. It's definition is as follows:
public class JCOption implements Serializable {
private int x = 1;
private static JCOption option = new JCOption();
private JCOption() {}
public static JCOption getOption() { return option; }
public int getX() { return x; }
public void setX(int x) { this.x = x; }
public static void main(String args[]) throws IOException {
JCOption opt = JCOption.getOption();
opt.setX(10);
XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream("Test.xml")));
encoder.setPersistenceDelegate(opt.getClass(), new JCOptionPersistenceDelegate());
encoder.writeObject(opt);
encoder.close();
}Since this class does not fully comply to the JavaBeans conventions by not having a public no-argument constructor, I have create a class JCOptionPersistenceDelegate that extends the PersistenceDelegate. The implementation of the instantiate method is as follows:
protected Expression instantiate(Object oldInstance, Encoder out) {
Expression expression = new Expression(oldInstance, oldInstance.getClass(), "getOption", new Object[]{});
return expression;
}The problem is that the resulting XML file only contains the following lines:
<java version="1.5.0_06" class="java.beans.XMLDecoder">
<object class="JCOption" property="option"/>
</java> so there is no trace of the property x.
Thank you in advance for your answers.How about this:
import java.beans.DefaultPersistenceDelegate;
import java.beans.Encoder;
import java.beans.Expression;
import java.beans.Statement;
import java.beans.XMLEncoder;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public class JCOption {
private int x = 1;
private static JCOption option = new JCOption();
private JCOption() {}
public static JCOption getOption() { return option; }
public int getX() { return x; }
public void setX(int x) { this.x = x; }
public static void main(String args[]) throws IOException {
JCOption opt = JCOption.getOption();
opt.setX(10);
ByteArrayOutputStream os = new ByteArrayOutputStream();
XMLEncoder encoder = new XMLEncoder( os );
encoder.setPersistenceDelegate( opt.getClass(), new JCOptionPersistenceDelegate() );
encoder.writeObject(opt);
encoder.close();
System.out.println( os.toString() );
class JCOptionPersistenceDelegate extends DefaultPersistenceDelegate {
protected Expression instantiate(Object oldInstance, Encoder out) {
return new Expression(
oldInstance,
oldInstance.getClass(),
"getOption",
new Object[]{} );
protected void initialize( Class<?> type, Object oldInstance, Object newInstance, Encoder out ) {
super.initialize( type, oldInstance, newInstance, out );
JCOption q = (JCOption)oldInstance;
out.writeStatement( new Statement( oldInstance, "setX", new Object[] { q.getX() } ) );
} Output:
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.5.0_06" class="java.beans.XMLDecoder">
<object class="JCOption" property="option">
<void property="x">
<int>10</int>
</void>
</object>
</java> -
Download code of all the methods in a class to desktop
Hi,
I want to download code of all the methods in a class to desktop.
Its like user will enter Class name on selection screen, then program should download the code of all the methods inside that class on to desktop as a text file.
How to do it.
Points will be rewarded!!
RegardsYou can use FM SEO_CLASS_GET_METHOD_INCLUDES
to determine the names of all methods implemented in this class with the according names of the includes.
Than you can loop through the table returned by this FM and get the coding of all methods using READ REPORT statement, whereas you must pass the name of the include of the according method, when executing READ REPORT...
Reward points, in case reply meets your expectation...
--MIKE -
How to guarantee that all the inserted data entries are shipped to the...
How to guarantee that all the inserted data entries are shipped to the correct Coherence caches?
I successfully created the table Employees, Address and Phone tables and their conresponding Java Classes. I also finished all the JPA and persistence works. Any updated data can persist to the corresponding database tables. Now I want to create the corresponding Coherence caches for these java objects. I want to know how to guarantee that all the inserted data entries are shipped to the correct Coherence caches? For example, guarantee all the employee data entries are added to the Employees caches and all the address data entries are shipped to the Address caches (do not ship the address data entries to the Phone or Employees caches)?
Thank youqkc wrote:
How to guarantee that all the inserted data entries are shipped to the correct Coherence caches?
I successfully created the table Employees, Address and Phone tables and their conresponding Java Classes. I also finished all the JPA and persistence works. Any updated data can persist to the corresponding database tables. Now I want to create the corresponding Coherence caches for these java objects. I want to know how to guarantee that all the inserted data entries are shipped to the correct Coherence caches? For example, guarantee all the employee data entries are added to the Employees caches and all the address data entries are shipped to the Address caches (do not ship the address data entries to the Phone or Employees caches)?
Thank youWhat persistence architecture are you using?
- Cache stores with JPA/Toplink cache stores?
- JPA implementation with Coherence used as a cache provider for the JPA engine?
- TopLink grid?
- anything else?
Until you provide this bit of info, don't expect a meaningful answer...
Best regards,
Robert -
how to transfer file from ipod touch to i tunes. i have files in my ipod , ut itunes is new so its telling if u sync the ipod all the files will be replaced but no files in the itunes.. so kindly help me how to transfer the files from i pod to itunes......
Some of the information below has subsequently appeared in a document by turingtest2: Recovering your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991
Your i-device was not designed for unique storage of your media. It is not a backup device and media transfer was designed for you maintaining a master copy of your media on a computer which is itself properly backed up against loss. Syncing is one way, computer to device, updating the device content to the content on the computer, not updating or restoring content on a computer. The exception is iTunes Store purchased content.
iTunes Store: Transferring purchases from your iOS device or iPod to a computer - http://support.apple.com/kb/HT1848 - only media purchased from iTunes Store
For transferring other items from an i-device to a computer you will have to use third party commercial software. Examples (check the web for others; this is not an exhaustive listing, nor do I have any idea if they are any good):
- Senuti - http://www.fadingred.com/senuti/
- Phoneview - http://www.ecamm.com/mac/phoneview/
- MusicRescue - http://www.kennettnet.co.uk/products/musicrescue/
- Sharepod (free) - http://download.cnet.com/SharePod/3000-2141_4-10794489.html?tag=mncol;2 - Windows
- Snowfox/iMedia - http://www.mac-videoconverter.com/imedia-transfer-mac.html - Mac & PC
- iexplorer (free) - http://www.macroplant.com/iexplorer/ - Mac&PC
- Yamipod (free) - http://www.yamipod.com/main/modules/downloads/ - PC, Linux, Mac [Still updated for use on newer devices? No edits to site since 2010.]
- 2010 Post by Zevoneer: iPod media recovery options - https://discussions.apple.com/message/11624224 - this is an older post and many of the links are also for old posts, so bear this in mind when reading them.
Syncing to a "New" Computer or replacing a "crashed" Hard Drive - https://discussions.apple.com/docs/DOC-3141 - dates from 2008 and some outdated information now.
Copying Content from your iPod to your Computer - The Definitive Guide - http://www.ilounge.com/index.php/articles/comments/copying-music-from-ipod-to-co mputer/ - Information about use in disk mode pertains only to older model iPods.
Get Your Music Off of Your iPod - http://howto.wired.com/wiki/Get_Your_Music_Off_of_Your_iPod - I am not sure but this may only work with some models and not newer Touch, iPhone, or iPad.
Additional information here https://discussions.apple.com/message/18324797 -
How can I get my photo to work again? the app will not open on my desk top any more. I can not dave my photo on my desk top
Hello, Cubby21.
Thank you for using Apple Support Communities.
Here are the best resources for troubleshooting issues with Message.
iOS: Troubleshooting FaceTime and iMessage activation
http://support.apple.com/kb/ts4268
iOS: Troubleshooting Messages
http://support.apple.com/kb/TS2755
Cheers,
Jason H.
Maybe you are looking for
-
APEX application design question
Hi, I've been working with APEX for a few years now but so far all of the applications that I have built have been hierarchical in their design. The format I generally stick to seems to work, which is to use a combination of tab pages containing list
-
Is there any way of saving progress in a game/app when you remove it from the ipad to the cloud
Is there any way of saving progress in a game/app when you remove it from the ipad to the cloud. Basically i have a 16gb ipad2 (big mistake) so space on the ipad is precious. obviously i occasionally need to remove games/apps to make way for other a
-
Lines around image with drop shadow
Hello, I am currently using Illustrator CS 5.1 and am having an issue with my PDF files. I have a graphic that I am building and when I import an image, place a clipping mask around it and then add a drop shadow to it, everything works fine and looks
-
I am using FF4 to download some .nzb files. I just want it to open the appropriate application when I click to download the .nzb file. Instead, I get prompted each time. this wasn't a problem on beta FF4. I also verified my application settings. Also
-
WBS not updated during asset invoice
Dear all, I post an invoice through MIRO for an asset and i enter a WBS element. However, the line item of the asset is not updated and the WBS element is also not updated with the actual posting. On the other hand, if i enter an expenses account eve