Using variables to add and subtract a number in a text field?
The adding bit works fine:
// get this pconn count
var this_p_conn:Number = Object(this).parent.p_conn;
// get current pconn total
var c_this_p_conn:Number = Object(root).part_count.p_conn_count.text
// add this pconn count to total pconn
var v_this_p_conn:Number = Number(this_p_conn+c_this_p_conn);
// Update total pconn with new value
Object(root).part_count.p_conn_count.text = String(v_this_p_conn)
Removing a value from the total is another story, this looks like it should work but it does not:
// get this pconn count
var count_p_conn:Number = Object(this).parent.p_conn;
// get current pconn total
var total_p_conn:Number = Object(root).part_count.p_conn_count.text;
// subtract this pconn count from total pconn
var new_p_conn:Number = Number(total_p_conn-count_p_conn);
// Update total pconn with new value
Object(root).part_count.p_conn_count.text = String(new_p_conn);
Any ideas or suggestions? My eyes are a bit blurry from looking at code, maybe I missed something obvious. Thanks in advance!
Never mind, I got it worked out now.
I had the subtraction code firing AFTER my remove self code, so the player never got to fire the subtract code:
var b:MovieClip = Object(this).parent;
Object(this).parent.parent.removeChild(b);
I placed the subtract code before the above code and now it works fine... I think I need powernap...
The lesson here is that apparently code fires from the top to the bottom, mind the order of how your code is stacked.
Sorry for the fuss! Carry on.
Similar Messages
-
Extracting and Sorting a Number in a Text field
Hi everybody,
I have a column in LOAN_DTL Table as LOAN_DESC which contains data like this:
CUSTOMER LOAN A/C : CAR 10.00%
CUSTOMER LOAN A/C : CAR 11
CUSTOMER LOAN A/C - HOUSE 15.5%
CUSTOMER LOAN ACCOUNT - CAR 5.50%
CUSTOMER LOAN A/C - CAR 9%
CUSTOMER LOAN ACCOUNT : HOUSE 10%
CUSTOMER LOAN A/C : PERSONAL LOAN 8.50
CUSTOMER LOAN ACCOUNT : HOUSE 7.75
CUSTOMER LOAN A/C : HOUSE 6.00
From the above data, I need to extract the Group i.e. CAR, HOUSE etc. and sort the Group on Rate of Interest order as below :
CUSTOMER LOAN ACCOUNT - CAR 5.50%
CUSTOMER LOAN A/C - CAR 9%
CUSTOMER LOAN A/C : CAR 10.00%
CUSTOMER LOAN A/C : CAR 11
CUSTOMER LOAN A/C : HOUSE 6.00
CUSTOMER LOAN ACCOUNT : HOUSE 7.75
CUSTOMER LOAN ACCOUNT : HOUSE 10%
CUSTOMER LOAN A/C - HOUSE 15.5%
CUSTOMER LOAN A/C : PERSONAL LOAN 8.50
How to go about the above ?Like this?
SELECT loan_desc,REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+%?') extract_string
FROM loan_dtl
ORDER BY 1,
DECODE(loan_desc,
loan_desc,
TO_NUMBER(REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+')));
Message was edited by: 000000 -
In Table contol,add and subtract button getting disabled.
Hi ,
My requirement is that in table control when user adds more than four rows,error message will be displayed i.e maximum of 4 rows allowed.
But after error message is displayed ,add and subtract button is disabled in table control and I am not able to remove the rows.
Any solution available on making add and subtract button active.
Regards
NikhilHi
In PBO,
module status_100.
looop at itab with control tc.
endloop.
in program
module status_100.
describe table itab lines tc-lines.
if tc-lines = 0.
tc-lines = 4.
elseif tc-lines > 1.
tc-lines = 4.
endif.
endmodule.
here there is no way you will get more than 4 rows at any time.
instead of Error message you can give warning or information message. this will not disable your buttons.
Cheerz
Ram -
How to zoom in model to add and subtract layer after a degree
How to zoom in model to add and subtract layer after a degree
Hi SionReaver.
Here is a link to the webcam's support page. It includes the user guide and contact information if any issues arise.
support page
I hope this helps.
-- Chauntain
I work on behalf of HP.
Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
Click the KUDOS THUMBS UP on the left to say “Thanks” for helping! . -
How do I add and subtract a device
How do I add and subtract devices.
Michael, thank you for taking the trouble to reply.
Yep I can do that, with itunes on the screen putting a new cd in the drives gets a prompt that invites me to add the cd to itunes. Okay so far worked that out fairly early.
BUT
The question I asked was how do I now get then get that ONE cd onto my nano.....I do not want to sych everything just that one cd?
AND
If I subsequently decide that I want to delete that (or any other) ONE cd from the nano to make room for another....how do I do that?
.....................In windows media player for instance you can select an option to display only the contents of the mp3 player, then you simply highlight the cd you want delete and delete it....poof by magic it disapears from the device freeing up space.....but the cd remains in windows media player...............Whereas in itunes if you select ....my ipod on the tool bar instead of simply getting a list of what is on that device....you get instead a list of everything that is in itunes.........and if you delete an item it goes from the itunes library but still stays on the nano itself...............crazy
Itunes seems to me to be totally illogical. -
Add and subtract summary group totals
Looking for a way to add and subtract summary group totals in a report.
I have my data grouped by account type then summarized. Example
have my data grouped by account type then summarized. Example
acct. type amount
51 $100
51 50
Summary $150
61 $100
61 100
Summary $200
70 $50
70 50
Summary $100
Formula I want to make this formula 51+61-70 = GP
I am trying to understand how to put the acct. type(51,61) in the formula and insert in the report.
Thanks for the help.
Raald232 -
ADD ITEMS TO DROPDOWN BOX FROM A TEXT FIELD(USER ENTERS THE ITEM) AND BOUND VALUE ALSO
I WANT TO ADD ITEMS THE DROPDOWN BOX FROM THE TEXT FIELD(ITEM NAME) WHERE USER ENTER'S THE ITEM DESCRIPTION
AND BOUND VALUE ALSO SHOULD BE ADDED TO THE SAME ITEM.
SAME WAY REMOVE ITEMS FROM DROPDOWN BOX
PLEASE GIVE SAMPLE FORM OR JAVASCRIPT FOR THE ABOVE SCENARIO.....
INDEED HELPFUL FOR MY PROJECT PLEASE SEND ATTACHED PDF FORMHi Praveen,
Your form is not shared so I have not been able to access it. But I have updated mine. There are now two approaches, one that follows on from the above method and updates each drop down list in each row. The second updates a separate dataset that the drop down list is bound to. This second approach requires the remerge() method which can cause problems if your code has updates some form properties like a borders color as these will be reset, but the code is simplier and you will only have one list to maintain. The add button click code is;
var particulars = xfa.datasets.resolveNode("particulars");
if (particulars === null)
particulars = xfa.datasets.createNode("dataGroup","particulars");
xfa.datasets.nodes.append(particulars);
var particular = xfa.datasets.createNode("dataValue","particular");
particular.value = ItemName.rawValue;
var boundValue = xfa.datasets.createNode("dataValue","id");
boundValue.value = BoundValue.rawValue;
particular.nodes.append(boundValue);
boundValue.contains = "metaData";
// find sorted position to insert
for (var i = 0; i < particulars.nodes.length; i++)
p = particulars.nodes.item(i);
if (p.value > particular.value)
particulars.nodes.insert(particular, p);
break;
// add to end if greater than all existing items
if (particular.parent === null)
particulars.nodes.append(particular);
// clear source fields
ItemName.rawValue = null;
BoundValue.rawValue = null;
// remerge form data to pick up new item
xfa.form.remerge();
And the binding looks like;
I have updated my sample to include both methods, https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g
Regards
Bruce -
Using variables in Dashboards and Requests
Hi Freinz,
I am trying to use a dashboard prompt and based on the selection in the prompts the data shud be populated.
I used the option request variable in Dashboard prompt and then created the static repository variables in administration.
I have created variable 'vert' and in the requests for the column 'VERTICAL' i am setting the variable as 'vert'.
This is the same value i have given in the dashboard prompt set variable-->request variable.
Guyz pls help me...
Pls let me knw the steps to be followed.
How shud i pass teh values from the dashboard prompt to the requests??/
Thanks,
VeenaIn the Report, Create a filter fro VERTICAL. In the Filter Creation Click On Add - Variable - Presentation, Now in the variable Expr give your variable name, In the default value give any value for this VERTICAL.
Now put your prompt and report in dashboard, test it. -
Using 'variables.instance' structure and implicit getters/setters
I am adopting the use of creating a variables.instance (I use 'variables.my') structure to separate instance data from the object, however I have a question when it comes to ColdFusion creating implicit getters and setters based on that object's defined properties.
BEFORE, if I had a Name property, CF would create getName() and setName() for me, and it would update the variables.Name private variable accordingly in each. But now that my variables are being stored in 'variables.my.Name', does this mean I can no longer use ColdFusion's implicit getters and setters? (because it would improperly be attempting to execute getName and be looking for variables.Name, when that data now exists in variables.my.Name?
Are there any methodologies around that allow me to utilize CF's implicit getters/setters while using this 'my' instance variable and have them work with one another?Thanks for the confirmation Carl.
How cool, then, would it be if ColdFusion 11 supported something like:
<cfcomponent
accessors="true"
implicitpropertyprefix="my."
That way I could specify "my." as the property prefix and when it goes to create those implicit getters and settings, it will concatenate that into 'variables.my.' as the prefix when it alters property values or returns them. -
Adobe LiveCycle Designer 8 - Add days to Current Date in another text field
Hi-
I am working on an expense report. I have six fields, CurrentDate, and countDate1 through countDate5. The CurrentDate is a Time/Date field which the user can select whatever date is needed with the drop down calendar. The other five countDate fields are "text" fields which will represent Monday through Friday. I would like to add zero days to whatever the user selects as the CurrentDate and make that appear in countDate1 which represents Monday(the CurrentDate the user selects will always be a Monday), add one day to whatever the user selects as the CurrentDate and make that appear in countDate2 which represents Tuesday...and so on. I realize this is probably basic for someone familiar with FormCalc but I'm very new at this.
This got me very close but I want the user to select the date and not have the CurrentDate already filled in.
CurrentDate - DateTime field, FormCalc calculation script:
num2date(Date())
Date1 - Text field, FormCalc calculation script:
Num2Date( Date2Num(CurrentDate.formattedValue))
Date2 - Text field, FormCalc calculation script:
Num2Date( Date2Num(CurrentDate.formattedValue) + 1 )
Thanks!
BrianHere is an exmaple of adding days the script is used in the "exit" event for the date select field that has display format of "MM/DD/YYYY". Adding days requires add x number of days to the days since the epoch date for the current date, adding months or years one needs to manipulate the string parts of the date.
----- form1.#subform[0].InputDateField::exit: - (FormCalc, client) ---------------------------------
// fomatted string for selected date
var sFmtDateValue = $.formattedValue
var sMsg = Concat("Entered date formatted: ", sFmtDateValue) // build message string
sMsg = Concat(sMsg, "\u000a" ) // add new line to message
// convert date string to days since epoch date - format is important
var fDaysPast = Date2Num(sFmtDateValue, "MM/DD/YYYY")
// add 7 days to days past epoch date
var f7DaysPlus = fDaysPast + 7 // add 7 days
var s7DaysPlus = Num2Date(f7DaysPlus, "MMM DD, YYYY") // format string for 7 days plus
sMsg = Concat(sMsg, "\u000a", "Plus 7 Days: ", s7DaysPlus) // build message string
// add 14 days to days past epoch date
var f14DaysPlus = fDaysPast + 14 // add 7 days
var s14DaysPlus = Num2Date(f14DaysPlus, "MMMM DD, YYYY") // format string for 7 days plus
sMsg = Concat(sMsg, "\u000a", "Plus 14 Days: ", s14DaysPlus) // build message string
// display results
// work on months
// get parts of date past epoch date
var sFullYear = Num2Date(fDaysPast, "YYYY") // get 4 digit year form days past epoch date
var sMonth = Num2Date(fDaysPast, "MM") // get month form days past epoch date as number
var sDate = Num2Date(fDaysPast, "DD") // get date form days past epoch date as a number
var s2Month = Sum(sMonth, 2) // add 2 months
var s2FullYear = sFullYear
// if more than 12 months in new date adjust year on number of months
if (s2Month > "12") then
s2FullYear = Sum(s2FullYear, + 1) // increment year
s2Month = Sum(s2Month, - 12) // adjsut months
endif
var s2MonthsAdded = Concat(s2Month, "/", sDate, "/", s2FullYear) // date string
sMsg = Concat(sMsg, "\u000a", "Added 2 months: ", s2MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
var s5Month = Sum(sMonth, 5) // add 5 months
var s5FullYear = sFullYear
// if more than 12 months in new date adjust year on number of months
if (s5Month > "12") then
s5FullYear = Sum(s5FullYear, + 1) // increment year
s5Month = Sum(s5Month, - 12) // adjsut months
endif
var s5MonthsAdded = Concat(s5Month, "/", sDate, "/", s5FullYear) //build Date string
sMsg = Concat(sMsg, "\u000a", "Added 5 months: ", s5MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
// display results
xfa.host.messageBox(sMsg, "Sample Adding Days and Months" ,3, 0); -
How do you add a scroll bar to a scrolling text field in a folio?
I've created iPhone and iPad folios with multiple pages. There are scrolling text fields on each page. The fields scroll as designed, but the scroll bars on the text fields only appear while actually scrolling. Is there a way to have them always visible so the user knows there is more hidden info? The only bars that are constantly visible are the page scroll bars. Thanks!
Why is your content pane null? I thought the content pane was the top-level in all windows? If you want complete control over the location of a list box, you want to set the layout of the content pane to null... the way I almost always do this is the other way around, to create my own panel and use setContentPane instead:
JPanel content = new JPanel(null);
JScrollPane scroll = new JScrollPane(myListBox);
scroll.setBounds(380, 10, 500, 500);
content.add(scroll);
setContentPane(content); -
Hi all,
Trying to upload document numbers from Excel into SAP via transaction F-03 using SAP GUI Scripting.
My approach is to enter values one by one and press Enter when the last visible text field is reached. Then enter another batch of values, press Enter and so on..
The problem is that I do not know how to get that event when the last visible field is reached.
I know the solution but for tables when you can count a number of visible rows (.visibleRowCount).
Thanks in advance.Hi Dmitry,
in this case, I would proceed as follows:
1. before the position command the system error handling switch off with
on error resume next
2. behind the position command the test of error number with
if err.number < 0 or err.number > 0
For example:
on error resume next
err.clear
'position command from existing script
if err.number > 0 or err.number < 0 then
'processing . . .
end if
on error goto 0
Declaration on the solution: In a non-relevant line will it not work. This one can evaluate it.
Regards,
ScriptMan
Edited by: ScriptMan on Apr 19, 2010 7:36 PM -
Fill BSEG-LIFNR and LFA1-NAME1 in line item text field of Bank GL line item
Hi all,
I need to develop a program to populate the Vendor Number (BSEG-LIFNR) and Vendor Name (LFA1-NAME1) in the line item text field of Bank GL line item.
The UI design will have the input data as:
- Company Code
- Posting Dates (both from and to date)
- Execute Icon
Please let me know how to proceed on this.
Thanks and regards,
Anishurprogram a bdc to tcode fb09
A. -
Using jquery to user only allow numbers in single line text field with infopath 2010 form
Please provide me right solution for the same.
I have already used below script, but this is not working
<script type="text/javascript">
$(document).ready(function () {
var input = document.getElementById('ctl00_m_g_85322960_0783_4665_a3e7_41708ddd7c1c_FormControl0_V1_I1_T3');
input.onkeydown = function(e) {
//var k = e.which;
/* numeric inputs can come from the keypad or the numeric row at the top */
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105))) {
e.preventDefault();
</script>Hi,
As Matt mentioned, it is OK to change field type to number if you want only number can be entered in the textbox. If you want to treat them as string in the backend, you can use CONVERT function to change its data type in the code.
If you insist on jquery, try to change condition paremeter in IF to:
key >
31 &&
(key <
47 ||
key > 57)
The order number of numbers (0 ~ 9) is from 48 to 57 (in Dec).
Miles LI TechNet Community Support -
CreateTextField and _height: Problem with Placement of Text Fields
I'm using createTextField to create several text fields
dynamically. I'm also using an external XML file and a style sheet
to populate the text fields.
My problem is that I'm trying to position the various text
fields on the page so that they are spaced evenly on the page
(regardless of how much content they might contain). I'm trying to
use _height of the prior text fields to place subsequent text
fields, but I'm getting very inconsistent results. When I trace the
value of _height, I get differing results, even if I don't actually
change any of the parameters. So, the question is...is there a way
for Flash to get the height of a dynamically created text field
that's populated via an exteral XML file and using CSS? I know
that's asking a lot, but I'm trying to avoid using scroll bars if
at all possible.
Thanks for any pointers.
Billi assume you're using multiline textifields with a fixed
width and autoSize="left".
flash will report the correct _height of your textfields IF
you access the _height property after your htmlText has been
assigned to your textfield. ie, you're probably seeing inconsistant
results because you're not waiting until all data needed to
populate your textfield has loaded.
Maybe you are looking for
-
Hi Experts, i scheduled some of my BIP reports integrated with siebel. I Notice that if i schedule a report to genreate a 1.5k+ records i always received this kind of error : oracle.apps.xdo.servlet.scheduler.ProcessingException: oracle.apps.xdo.serv
-
Problem with adobe livecycle rights management es2 extension for microsoft office
occurs several times an error message in Microsoft Office Excel that says it has experienced a problem with the complement of adobe livecycle rights management es2 extension for microsoft office if the message has appeared several times should disabl
-
Webpage Print not rendering correctly
As of Firefox 5, the print rendering of screen CSS styles seems to have broken. It is incorrectly splitting the pages, yet IE, Chrome, Safari and Opera all print correctly, as did Firefox 4 and previous. URL: [http://www.hoamz.co.nz/21301/queenstown/
-
Can't turn dma on [solved]
Hi, I'm creating a new ext3 partition on a new disk, but I can't turn DMA on, I get the following error: [14:43][root@mouse256:~]$ hdparm -d1 /dev/hda2 /dev/hda2: setting using_dma to 1 (on) HDIO_SET_DMA failed: Invalid argument using_dma = 0 (off) I
-
Hii All Can any body help me What parametrs i have to pass in CONVERT_OTFSPOOLJOB_2_PDF function to convert all the copies of a spool request into pdf. Suppose a spool request have three copies. Thanks Viki