loop to generate variables with different values
A quiz, I have answers user saved in a table. At the end of the quiz, I need to extract individual responses to the different variables q1, q2, q3, etc.. The questionnaire can be of different questions so I need to adjust based on total questions inside. How can I use loop to create variables and values to capture?
So, I would change the following:
var q1:int = userAnswersArray [0];
var q2:int = userAnswersArray [1];
var q3:int = userAnswersArray [2];
var q4:int = userAnswersArray [3];
...
to the loop like the one below:
for (i = 0; i < totalQuestion-1; i ++)
{
This ["var var q" + i] + ": int" = "userAnswersArray []" + this [i] + "]";
}
He probably has syntax errors that it does not work.
Thanks for your help.
If evidence of userAnswersArray are always aligned with issue numbers (say, question 1 answer is saved in 0, 2 - position 1, position etc.) maybe work the following:
var urlreq:URLRequest = new URLRequest("subresultpage.asp"); urlreq.method = URLRequestMethod.POST; var urlvars:URLVariables = new URLVariables(); for(var i:int = 0; i < userAnswersArray.length; i++) { urlvars["q" + (i + 1)] = userAnswersArray[i]; }
Tags: Adobe Animate
Similar Questions
-
reuse of filters with different values
We have a usage scenario where the same filters will have to be applied several times with different values. Looking the javadocs, it seems like there is no way to change the values of pre-packaged filters (EqualsFilter, GreaterFilter etc.). Is that correct or is there a way to do it? I see that if we use CohQL, we can use bind variables to do this. However, the use cases we should rather just more complex extractors ReflectionFilters.
In addition, there no performance impact by using CohQL against java constructs directly?
Thank you
Manju.Hi Manju,
While it is true that you cannot change values in the built in filters, even if you could it wouldn't make you save a lot on the construction of a new filter every time. I guess that if you build a very large number of filters, then you're going to create more garbage, but that shouldn't be a problem either. Some of the more specialized filters also contain State so that you do not want to resuse them.
The main performance issue I know with CohQL which is only creates extractors of reflection so won't enjoy all serialized POF values you have. If you have indexed each value you want to query on using the same extractors relflection then it would help, but again, this means that everything you deserialization of the values for the query or insert to update the index.
Kind regards
JK -
DAQmx create track (I-current-Basic) 8 channels with different values of Shunt resistance
Hello
I want to measure 8 current channels with different values of Shunt resistance.
Problem: The channel create DAQmx (HAVE current Basic) specifies that a value of Shunt resistance.
How can I set the value of Shunt resistance for each channel individually?
Concerning
Marcel
Hi Marcel_C,
Take a look to get attached.
Best regards
Mencef
-
two rows of delete with different values
Hello
I wouldn't lines with the same id and have values of E and F 10258932.
I would like the following data:
But I have the following lines:A B C D E N -------- -- ------ ----- - - 10258927 1 103,35 0 10258929 3 284,85 89,52 E N 10258929 4 323,85 89,52 E N 10258930 5 478,80 91,53 E N 10258931 6 436,67 78,09 E N
Does anyone have an idea?SQL> with my_table as 2 ( 3 select '10258927' a, '1' b, '103,35' c, '0' d, NULL e from dual union all 4 select '10258928' a, '2' b, '0' c, '15,19' d, 'E' e from dual union all 5 select '10258929' a, '3' b, '284,85' c, '89,52' d, 'E' e from dual union all 6 select '10258929' a, '4' b, '323,85' c, '89,52' d, 'E' e from dual union all 7 select '10258930' a, '5' b, '478,80' c, '91,53' d, 'E' e from dual union all 8 select '10258931' a, '6' b, '436,67' c, '78,09' d, 'E' e from dual union all 9 select '10258932' a, '7' b, '784,88' c, '23,19' d, 'E' e from dual union all 10 select '10258932' a, '8' b, '100,88' c, '11,11' d, 'E' e from dual union all 11 select '10258932' a, '9' b, '300,88' c, '22,22' d, 'F' e from dual union all 12 select '10258932' a, '10' b, '468,25' c, '78,33' d, 'F' e from dual) 13 select a, b, c, d, e, no_ds from 14 ( 15 select a, b, c, d, e, 16 case when c > 0 and e != 'F' 17 then 'N' 18 end no_ds 19 from my_table) 20 where no_ds = 'N' or e is null 21 order by 1 22 / A B C D E N -------- -- ------ ----- - - 10258927 1 103,35 0 10258929 3 284,85 89,52 E N 10258929 4 323,85 89,52 E N 10258930 5 478,80 91,53 E N 10258931 6 436,67 78,09 E N 10258932 7 784,88 23,19 E N 10258932 8 100,88 11,11 E N 7 Zeilen ausgewählt. SQL>
Oh, I read the title again once: 'remove double lines with different values.
If it means that he is not specifically E and F values, but only if there is more than one distinct value, then you can do the following:with my_table as ( select '10258927' a, '1' b, '103,35' c, '0' d, NULL e from dual union all select '10258928' a, '2' b, '0' c, '15,19' d, 'E' e from dual union all select '10258929' a, '3' b, '284,85' c, '89,52' d, 'E' e from dual union all select '10258929' a, '4' b, '323,85' c, '89,52' d, 'E' e from dual union all select '10258930' a, '5' b, '478,80' c, '91,53' d, 'E' e from dual union all select '10258931' a, '6' b, '436,67' c, '78,09' d, 'E' e from dual union all select '10258932' a, '7' b, '784,88' c, '23,19' d, 'E' e from dual union all select '10258932' a, '8' b, '100,88' c, '11,11' d, 'E' e from dual union all select '10258932' a, '9' b, '300,88' c, '22,22' d, 'F' e from dual union all select '10258932' a, '10' b, '468,25' c, '78,33' d, 'F' e from dual ) -- -- end-of-test-data -- select a, b, c, d, e, num_distinct_values from ( select a, b, c, d, e, count(distinct e) over (partition by a) num_distinct_values from my_table) where num_distinct_values <= 1 order by 1 /
The county notes how the distinct non-null values in column e for each one.
Where clause then selects those with count = 0 (this is where e = null) and count = 1.
If the number is greater than 1, different values exist for this id.Choose what fits your condition ;-)
-
Updated several lines with different values
Hello!
I have a problem. I need to update more than 1000 lines with different values. How can I do?
For exsample I have table:
ID; color, date,
1 red
2 green
3 white
I need to update the date field.
Update table
Set date = '01.02.03'
where id = 1
Update table
Set date = '01.03.03'
where id = 2
Maybe it's how to update multiple rows in a single request?
Sorry for my bad English.
Thank you!Hello
You can try this
UPDATE TABLE SET DATE = CASE WHEN ID = 1 THEN TO_DATE('01-02-03','DD-MM-RR') WHEN ID = 2 THEN TO_DATE('01-03-03','DD-MM-RR') END
see you soon
VT
-
Return only the columns with different values.
Hi all
I am trying to solve a seemingly trivial problem but can't seem to get any clear answer anywhere in any forum. Consider a single table with 5 columns and only two lines:
Assume that there is no primary key or any other constraint. Also assume that there are only and only two lines of this table. So I need basically a query that, overall above lines, would return first name and sex, because they are only different columns in two lines, as well as their values. Even if I can get sort of column names that are different and that would be enough that I can easily access the values later. It is also important to remember that I may not know the names of the columns in the columns, so basically, somehow, I use user_tab_columns in the process.row_id first_name last_name age gender 1 John doe 27 M 1 Jane doe 27 F
Any help appreciated.
Published by: 894302 on May 1, 2013 10:35Hello
894302 wrote:
The exact release could be just a varchar variable that lists all the columns that have different values with each column name separated by commas. We'll call the query you want as a QUERY. So, if I do something likeSelect the REQUEST of double; Output should be: 'first_name, equality of the sexes. Is this possible?
In this case:
SELECT RTRIM ( DECODE (a.row_id, b.row_id, NULL, 'row_id,') || DECODE (a.first_name, b.first_name, NULL, 'first_name,') || DECODE (a.last_name, b.last_name, NULL, 'last_name,') || DECODE (a.age, b.age, NULL, 'age,') || DECODE (a.gender, b.gender, NULL, 'gender,') , ',' ) AS different_columns FROM rhit_table_x a JOIN rhit_table_x b ON a.ROWID < b.ROWID ;
Output:
DIFFERENT_COLUMNS --------------------------------------- first_name,gender
This assumes that you have really a table, then you can use ROWID to distinguish the lines, since there is no primary key.
If this isn't the case, you first assign ROW_NUMBER in a subquery. -
Variable with a value. «PURGE error: bad Argument Type.»
Hi, my 50G calculator accuses a value for the variable 'X' but I can't find it in any directory, and when I try to delete I get the message "' PURGE error: bad Argument Type." " I also have the theta variable with the same problem. How can I remove the value of these variables? TKS
In addition to Make suggestions, two other possibilities come to mind: 'X' can be a directory object (which would cause the error to the wrong Type of Argument because non-empty directory objects cannot be purged by PURGE, but must be purged by PGDIR), or it could be a local variable (which can only be served by putting an end to the environment that created which is usually a program). So if Make suggestions don't work, try foster 'X' PGDIR and if that does not work, try KILL (which ends all the current environments).
If those WHO do not work, please do 'X' TYPE HOME and tell us what object type 'X'.
DISCLAIMER: I do not work for HP; I'm a happy user of HP Calculator.
-
Two tables with different values of basic on an analysis filter
Hi guys,.
Let assume that I have an analysis with columns: group_id and sales.
On this basis I would like to create two tables: table1 where group_id = 1 and table2 where group_id = 2.
OBIEE is able to do?
Kind regards
SlaviHi Slavi,
You can do it in a single analysis, but you have to have the column with group_id twice.
Bring, group_id_1, group_id_2 (same column), sale
Now in table 1.
bring group_id_1, sales
Then in the selection steps for group_id_1-> select members-> Action choose keep only-> choose the value of the filter 1
This will filter the table 1 with group_id 1
In table2 group_id_2 porter, sales
Then do the same step for group_id_2 with the value 2.
You now have two reports with different filter in the same report.
If you want you can keep the same name column for the two columns group_id, I just kept group_id_1, group_id_2 for easy reference.
-
Web Forms using substitution variables with multiple values
Hello
I'm trying to select a substitution variable in a WebForm (Hyperion Planning 11.1.1.3) with multiple values in environmental assessments, but does not does someone knows if this expected behavior.
I already try.
& month = "Jan", "Feb", "Mar".
& month = Jan, Feb, Mar
& month = Jan: Mar
Please let me know something, since I remember in previous versions of Hyperion Planning it was possible.
Kind regardsReading of:- Re: use of the Variables of Essbase alternative forms of planning
See you soon
John
http://John-Goodwin.blogspot.com/ -
Two different running loops one after another with different time intervals
Hello
I am currently using LabVIEW 2013. I'm new to LabVIEW.
I take 10 values to data acquisition during the 9-10 sec time interval within a period of 10 seconds.
I thought runs two loops. 1st loop will run for 9seconds out giving zero and the second loop will launch with 1 second left taking all the required 10 values. can someone help me in this way to do it. If you can suggest me any other idea.
Thank you.
Your task of data acquisition is to take 10 samples in 1 second (I assume that you also spaced). 10 samples/s = sampling frequency of 10 Hz (Hz = events/second). To configure DAQmx tasks, MAX is your friend. Open MAX, find your device (plugged in), open a panel of Test and find a way to let him taste at 10 Hz and collect 10 samples. Test to see if it works. Get it now to save as task.
Now, when you configure your block diagram, drop a DAQmx Start Task (or even read DAQ) and wire an empty constant to the task in. See the little arrow for menu drop-down? If you click on it, one of the choices should be the task DAQ, you just saved. Select that and it will work.
Now, all you have to do is wait 9 seconds before acquiriing your 10 points. There are functions of synchronization that can allow you to do this.
Bob Schor
-
Update of digital control with different values with array function
Hello
I have attached my code base. I want to execute the code for 2 sets of digital control with a gap between the two values, then pass it. Something like that
ABC
Initialize the P1 = 10; P2 = 20; P3 = 30; P4 = 40
Run the code
delay = 10ms
Update of P1 = 150; P2 = 200; P3 = 350; P4 = 500
Run the code
jump to abc
I am stuck how can I update the values of P1, P2, P3, P4? I thought about using a function table but couldn't go further.
Thanks for the help,
Ana
Hello Ana,
One way you might achieve what you are looking for is using property nodes. These property nodes will allow you to change the values of the block diagram control. You can set up a structure of case inside your loop that will change control through nodes of property value after a certain number of iterations. Here is a community sample that shows how to use the nodes property to change the Boolean controls:
https://decibel.NI.com/content/docs/doc-22669
-Erik S
-
I am creating an interactive animation of experience, whereby the user must detect if there is a well of oil beneath the surface by selecting and drill a series of points of coordination on a map.
I did the first step in establishing a background image containing a grid of 20 x 20 points coordinates, for example 1-20 columns and rows A - T. On top of that, I created a dynamic array of clickable objects (open circles) and the center of each is placed on a coordinate point, so when you hover over a coordinate point, for example, C3, an open circle becomes visible and when you deployment, it becomes invisible.
However, I am stuck on the next step. I need to be able to assign variables unique to one or more clickable objects (open circles). Is it possible to do? For example:
coordinates of the grid point give a) to each object (open circle), so, for example, if someone rolls the coordinate of the C3, the empty circle (object) associated with this coordination, a message appears: "Click on the point of grid to Pierce in C3"
(b) assign a variable to one or more objects, so that when the user clicks on an open circle, the animation associated with that point of coordination will be triggered. There will be different animations, depending on which object (point is clicked)
There are other variables that will need to be installed, but if I know how to assign variables to one or several objects, I can probably figure out the rest.
Here is a copy of my code so far:-
set up the grid for solid table
spacing = 5.75;
cols = 20; the number of columns in the grid
lines = 20; number of grid lines
leftMargin = 154;
topMargin = 169;
depth = 100; starting point for the depth
for (i = 1; I < = lines; i ++) {}
for (j = 1; j < = cols; j ++) {}
current = attachMovie ("openCircle_mc", "openCircle_mc" + i + "_" + j, depth ++);
Current._x = leftMargin + ((i-1) * (spacing + current._width));
Current._y = topMargin + ((j-1) * (spacing + current._height));
Open the circle initially invisible, visible on rollover
Current._alpha = 0;
current.onRollOver = function() {}
This ._alpha = 100;
}
current.onRollOut = function() {}
This ._alpha = 0;
}
}
}
Here's the background and a roll in the instance of the object "openCircle' in 'C3 '.
I would appreciate help. Thank you very much.
Pippa
You can assign properties (and methods) to clips:
set up the grid for solid table
spacing = 5.75;
cols = 20; the number of columns in the grid
lines = 20; number of grid lines
leftMargin = 154;
topMargin = 169;
depth = 100; starting point for the depth
for (i = 1; i<=rows; i++)="">=rows;>
for (j = 1; j<=cols; j++)="">=cols;>
current = attachMovie ("openCircle_mc", "openCircle_mc" + i + "_" + j, depth ++);
Current._x = leftMargin + ((i-1) * (spacing + current._width));
Current._y = topMargin + ((j-1) * (spacing + current._height));
Current.Row = i;
Current.Col = j;
Current.Oil = Math.floor (Math.random () * 1.1); about 1/10 objects have oil = 1, 9/10 oil = 0
Open the circle initially invisible, visible on rollover
Current._alpha = 0;
{current.onRelease = function ()}
trace (this.row + "" + this.col +"" + this.oil);
}
current.onRollOver = function() {}
This ._alpha = 100;
}
current.onRollOut = function() {}
This ._alpha = 0;
}
}
}
-
Recently, the pc started having problems with the internet. I have wireless internet set up, and AOL installed on the computer. A few months ago I started having difficulty opening Web sites. I could access my AOL email, but if I tried to go to a Web site, the page would not, it would be just stuck, the same thing would happen if I tried to access Web sites using Internet Explorer. But the computer itself (Word, etc.) was working again fine. Note that since my laptop, internet works fine.
then the other day, I turned on the computer and Windows will not load, it keeps looping of the start screen of Windows to a black screen with an option to press F2 to just recovery, then passes to the other black screen with 2 options - F5 to start something and another option, don't remember now. He kept going just these screens again and again.
Hello
Step 1: You can check if you're able to boot in safe mode. If the computer starts in safe mode with success then, restore the system in safe mode.
Reference:
http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/boot_failsafe.mspx?mfr=true
http://support.Microsoft.com/kb/306084Step 2: You can also try to use the known last good Configuration feature.
Reference: http://support.microsoft.com/kb/307852Thanks and greetings
Umesh P - Microsoft technical support.Visit our Microsoft answers feedback Forum and let us know what you think.
[If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.] -
query users to mulitple update block with different values
Hello
I need to write a SQL script to update the information of multiple users (400) in the database.
Here's the query I use to update a single user:
setting a day of usr set usr_login = "ROBERTAA_OLDx", USR_EMAIL = 'robertaa@abadrer_dellllx.com' where usr_login = 'ROBERTA ';
usr_login and usr_email must be different for each user.
What is the best way to achieve this?
Please suggest
Thank you
OK, I see. Here is my version of update:
DROP TABLE usr; CREATE TABLE usr ( usr_login VARCHAR2(20) ,usr_email VARCHAR2(50) ); INSERT INTO usr VALUES ('PENUMALH', '[email protected]'); INSERT INTO usr VALUES ('IAMTEAM', '[email protected]'); INSERT INTO usr VALUES ('TESTSOA2', '[email protected]'); INSERT INTO usr VALUES ('TESTADF1', '[email protected]'); INSERT INTO usr VALUES ('IAMTESTIR2', '[email protected]'); INSERT INTO usr VALUES ('IAMPWDTT', '[email protected]'); INSERT INTO usr VALUES ('IAMPWDTI', '[email protected]'); COMMIT; SET LINESIZE 80 PAGESIZE 20 COLUMN usr_login FORMAT A20 COLUMN usr_email FORMAT A50 SELECT * FROM usr; UPDATE usr t1 SET (t1.usr_login, t1.usr_email) = (SELECT t2.usr_login || 'OLD' || TO_CHAR(ROWNUM) AS usr_login ,SUBSTR(t2.usr_email, 1, INSTR(t2.usr_email, '.', -1, 1) - 1) || '_delxxxxasdf' || SUBSTR(t2.usr_email, INSTR(t2.usr_email, '.', -1, 1)) AS usr_email FROM usr t2 WHERE t2.usr_login = t1.usr_login); COMMIT; SELECT * FROM usr;
And the output:
Table dropped. Elapsed: 00:00:00.05 Sequence dropped. Elapsed: 00:00:00.03 Table created. Elapsed: 00:00:00.03 Sequence created. Elapsed: 00:00:00.03 1 row created. Elapsed: 00:00:00.13 1 row created. Elapsed: 00:00:00.04 1 row created. Elapsed: 00:00:00.03 1 row created. Elapsed: 00:00:00.03 1 row created. Elapsed: 00:00:00.03 1 row created. Elapsed: 00:00:00.03 1 row created. Elapsed: 00:00:00.03 Commit complete. Elapsed: 00:00:00.02 USR_LOGIN USR_EMAIL -------------------- -------------------------------------------------- PENUMALH [email protected] IAMTEAM [email protected] TESTSOA2 [email protected] TESTADF1 [email protected] IAMTESTIR2 [email protected] IAMPWDTT [email protected] IAMPWDTI [email protected] 7 rows selected. Elapsed: 00:00:00.03 7 rows updated. Elapsed: 00:00:00.04 Commit complete. Elapsed: 00:00:00.02 USR_LOGIN USR_EMAIL -------------------- -------------------------------------------------- PENUMALHOLD1 Hari.Penumalli@abc_delxxxxasdf.com IAMTEAMOLD1 iam.team@xyz_delxxxxasdf.com TESTSOA2OLD1 test.soa2@gio_delxxxxasdf.com TESTADF1OLD1 test.adf1@yu_delxxxxasdf.com IAMTESTIR2OLD1 iam.testir@ou_delxxxxasdf.net IAMPWDTTOLD1 iam.pwdtt@iuet_delxxxxasdf.in IAMPWDTIOLD1 iam.pwdt@oiyoi_delxxxxasdf.com 7 rows selected. Elapsed: 00:00:00.03
-
question of xsd. several records with different values.
I need help in the creation of xsd.
My data from the file will be as Fallows.
Sample data file
AB xxxx yyyy zzz ttttt
BBB hhh ddd ddd
BBB hhh ddd ddd
BBB hhh ddd ddd
BC xxxx yyyy zzz ttttt
CCC hhh ddd ddd
CCC hhh ddd ddd
CCC hhh ddd ddd
CD xxxx yyyy zzz ttttt
Hhh ddd ddd DDD
Hhh ddd ddd DDD
Hhh ddd ddd DDD
My xsd is as Fallows:
< xsd: element name = "Root Element" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "Element" type = "tns: mainelement" minOccurs = "0" maxOccurs = "unbounded" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: complexType name = "mainelement" >
< xsd: SEQUENCE >
< xsd: element name = "Header" type = "tns:HeaderType" maxOccurs = "1" / >
< xsd: element name = "lineitem1" type = "tns:lineitemrecord1" minOccurs = "0" maxOccurs = "unbounded" nxsd:lookAhead = "0" nxsd:lookFor = "" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< xsd: complexType name = "HeaderTyep" >
< xsd: SEQUENCE >
< xsd: element name = "HeaderData" type = "xsd: String" nxsd:style = "fixedLength.
nxsd:length = "2528" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< xsd: complexType name = "lineitemrecord1" >
< xsd: SEQUENCE >
< xsd: element name = "RecordData" type = "xsd: String" nxsd:style = "fixedLength" nxsd:length = "161" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
How can differentiate the values in the starting header field by [AB, BC, CD] and record data fields starting with [bbb, ccc, ddd]
I can't use nxsd: lookahead and nxd:lookFor.
Required inputs to process the file. What alteration is suitable for the xsd to run.
Is there a parent - child relationship kind of thing in your file structure?
Row containing sales, purchases etc. is the parent and the tracking records are the child records, until we meet any record type 'Bill of sales, purchases',? In addition, tried to use "conditionValue" and "startsWith" and it did not work... Is it?
Maybe you are looking for
-
Firefox prompts you to enter the master password so that there is no form on the page
I open Firefox and visit: http://twitter.com/astro_paoloAlthough there is no form on this page, Firefox invites me to enter my master password
-
AF113CL: Windows 7 para HP AF113CL drivers?
Hola, Necesito UN ayuda para los drivers get from el laptop HP AF113CL para Windows 7 64 bit. Por lo that he revisado el sitio web in solo package para Windows 10. I hope I can help. Gracias.
-
Unable to access the shortcut icons after changing the property
Original title: shourtcut icons I have traied to 'replace the owner of subcontainers and objects' in my vista... and after that my icons of shourtcut was defferant and I can't use it! I don't know what I'll do! no idea? Thank you
-
I uninstalled OpenMG Secure Module on my Windows Vista [Sony VAIO]... Since then all my videos extension AVI has stopped working and other disturbing messages appear as I start my system... Please help me original title: (what is the problem? And wha
-
Hello world I couldn't find this information on the page "Test your application on a BlackBerry smartphone reconditioned" so hopefully someone here can help: I have an application that has been deployed on a phone (using blackberry - deploy.bat signe