variables

Assigning number value to a variable in VBA

I need to assign a number value to a variable in VBA. I did this: var num as integer num=1 but when I put a breakpoint at num=1 and see the value of num it's showing 0 (zero). Please help. ...

Make a for loop with an aray and variable

I am using the code below to draw an object to the stage. However I want to be able to redraw the object every time I press ENTER in my onEnterframe function. So I have to add the draw function again but with a new array. Also every time I push enter the value of the variables in the array should increase. Here's the initial code: maat...

PHP curly brace syntax for member variable

First question on SO and it's a real RTFM candidate. But I promise you I've looked and can't seem to find it. I'll happily do a #headpalm when it turns out to be a simple thing that I missed. Trying to figure out Zend Framework and came across the following syntax: $this->_session->{'user_id'} I have never seen the curly braces synta...

Pass large variables with php and http?

Hi, i want to pass large variables to a PHP script on another server with http like: "example.com/get.php?data=this is quite alot data..." I always get the server(apache) response: "Request-URI Too Large" Any ideas hot to pass the big variables to that script? ...

initializing and incrementing a variable in one line of code

Is this the DRYest way to do it in ruby? <% for item in @items %> <%= n = n + 1 rescue n = 1 %> <% end %> which initializes "n" to '1" and increments it as the loop progresses (and prints it out) since this is in one my app's views ...

Variable persistence in PHP

i have a php page, on that page i have text boxes and a submit button, this button runs php in a section: if(isset($_POST['Add'])){code} This works fine here and in that section $name,$base,$location etc are calculated and used. but that section of code generates another submit button that drives another section of code. it is in ...

in coldfusion, variables are resolved in what order?

hi everyone, i have little impression about variables resolve order, but i can't found it in the cfml reference or coldfusion dev guide, anyone can help? great thanks. ...

Variable and jQuery selector

Ive been trying to figure this one out for about 2 days and cant understand why this isn't working. Say for example I declare a variable "ul" and want to say var + li display red. $("document").ready(function() { var menu = $("ul"); $(menu +" li").css("color","red"); }); All list items should now be red. What am I doing wrong? ...

Pass a var to external jQuery

How can I write var menu = $('.something'); and use it in an external .js file like so: $(menu).attr("class", "active"); I have also tried declaring the external js file after the inline code and it will not work. ...

Sybase select variable logic

Ok, I have a question relating to an issue I've previously had. I know how to fix it, but we are having problems trying to reproduce the error. We have a series of procedures that create records based on other records. The records are linked to the primary record by way of a link_id. In a procedure that grabs this link_id, the query is ...

bash: defining a variable with or without export

What is export for? What is the difference between: export name=value and name=value ...

With Delphi are you more likely to re-use temporary variables than with other languages?

Since Delphi makes you go all the way up to the var section of a method to declare a local variable, do you find yourself breaking "Curly's Law" (re-using variables) more often than you did in college?(unless of course, you programmed Pascal in college). If so, what do you do to break yourself of that habit, especially in functions wher...

Use temp variable or inline in this example?

I'm loading an ASP.NET dropdown list. Is there any advantage to doing this:: Private Sub LoadSeasonsListbox(ByVal seasons As List(Of Season)) Dim li As ListItem For Each s As Season In seasons li = New ListItem(s.SeasonDescription, s.SeasonCodeID) frm.SeasonsList.Items.Add(li) Next End Sub o...

c# looping object creation

I'm very new with c#, and was previously attempting to ignore classes and build my small program structurally more similar to PHP. After reaching a road block, I'm trying to start over and approach the problem properly OO. I'm taking a long file, and in a loop, every time certain conditions are met, I want to make a new object. How can I...

Javascript globals variables unchangeable in onsubmit event handler

I've attached onsubmit handler in a form tag like this: <form action="file.php" method="post" onsubmit=" return get_prepared_build(this);" > but whatever global variable (defined earlier, of course) I try to change inside get_prepared_build() function - later it apprears non-modified. Looks like that this function deals with a local c...

php defined variables have null values

I have some database information stored in config.inc.php and i'm trying to use it to access the database in a class I have, but for some reason, the variables are null. heres the code: <?php require_once 'dbinterface.php'; require_once 'config.inc.php'; class user { ... function user($id) { $this->db = new db($DB['host...

What's wrong with defining JavaScript variables within if blocks?

I have some code like this: if (condition) { var variable = blah; } if (differentcondition) { var variable = blah; } Is this correct? I assume that the variable wouldn't be assigned if the condition doesn't return true. JSLint keeps on telling me, variable already defined. Am I doing this wrong? Thanks. OK, Here's my actual usec...

Using single Command line and variables.

how do you define a variable to an integer at the command line. For example if i want to assign A=22 and B=23 and then have the A and B = a separate variable such as C..? I am confused on the syntax of this at the command line. I understand how to set variables in a script but how would i do it from a command line using only 1 line? Any...

change global variables in c++

Hi, Is there a way to define a global variable by user input? Lets say I use #include... #define N 12 double array[N][N]; void main();... But I would like the user to be able to choose what N is. Do I have to have N as a local variable or is there a way around this(without macros)? I've a pretty small program but with a lot of diff...

Dynamically adding variables to a URL using flex

In my Flex application I am able to read the variables using something like /flexapp.html?name=josh with no problems. However, this is because I go into the URL and type in the variables by hand. Is there anyway in the code to dynamically append the variable part "?name=josh" ? For example, like retrieving the url and then adding that...