variables

how to access all public variables in the class sequentially?

I want to access all public variables declared in the class sequentially. Which is the best way to do it? ...

Multiple Thread Variable Access inside a function

I have a function that launches a couple of threads (it's a test function) and one of the threads mutates the state of a variable. Since local variables cannot be marked volatile, I would assume that multiple threads in that method will always have the updated state of the variable. Is this correct? Here is the sample code public void s...

LoadVariablesNum in Action Script

Please, need help! LoadVariablesNum How can I do the reverse one? I mean - clear, delete or unload:) this vars? ...

Why use private variables when we can use properties ?

Hi all, Sorry If I am being noob, I have this doubt, why do we use private variables and set them using properties ? Why can't we just use properites alone ? I am talking about situations like this private string _testVariable; public string MyProperty { get { return _testVariable;} set {_testVariable = value;} } I am thi...

Variables behaving badly - in javascript - in functions

First off, here's my code: var variable1 = 10; function f1 (){ alert(variable1); } //When button is pressed, call function $("#button").click(f1); Why can I not access variable1 inside the function? Many thanks and a Happy Christmas. Modified question $(document).ready(function() { var how_many_words = 3; alert(how_many_words...

Removing double quotes from variables in batch file creates problems with CMD environment

Can anybody help with effective and safe way of removing quotes from batch variables? I have written a batch file which successfully imports a list of parameters %1, %2, %3 etc. and places them into named variables. Some of these parameters contain multiple words, and therefor are enclosed in double quotes. > "Susie Jo" (%1) > "Smit...

Need help reaching a variable in JavaScript

Can someone please help me understand the scoop of JavaScript variables, and how to reach them? Imagine the following... // Namespace declaration var p = {}; p.result = { searchForm: $('#search-form'), searchAction: this.searchForm.attr('action'), anotherSection: { hello: 'Hello ', world: this.hello + 'wo...

Correctly making a <a href> hyperlink with a variable.

Hi. I'm trying to make a small script for my site where the user would go to the page, lets say, http://example.com/test.php?p=22. From there, a script would read the 'p' variable, and result with a hyperlink going to http://example.com/diffdir/22.exe. So far, this is what I have coded: <?php $test = $HTTP_GET_VARS['p']; ?> <a href="...

C++ variable types limits

Hi, here is a quite simple question(I think), is there a STL library method that provides the limit of a variable type (e.g integer) ? I know these limits differ on different computers but there must be a way to get them through a method, right? Also, would it be really hard to write a method to calculate the limit of a variable type? ...

C# Public accessor doesn't work anymore

why this doesn't work anymore in my web control? it just throws a yellow error without any information about the code line. but just at this page... other errors are visible on other pages, it's enabled in web.config. strange is I don't know what I have changed but I think before a week that was running.. It seems a problem with: priv...

Store The Content Of The Selected Line Of a TListBox On a Variable

I'm developing a ebook manager on Lazarus, but I'm having some troubles with a component that I've never used(TListBox). On the TListBox named CategoryList, I have these items: Literature and Fiction Romance Computers and Internet Poetry Professional and Technical Science Fiction and Fantasy Biographies and Memoirs Busi...

Get Ivar value from object in Objective-C

Can someone post an example of how I get an instance variable value that is a double? I tried using the object_getIvar() function but that didn't go very well because it seems like this function is only good for variables that return objects and not scalar data type. thanks in advance, fbr ...

Pass a php variable to dynamically generated div's onclick event

hi, how to pass a php variable to dynamicaly generated div's onclick event? here is my code while($rowset = mysql_fetch_array($result)) { $idTT1++; $editTT='b'.$idTT1; $hidTextTT='t'.$idTT1; $hidSubIdTT='s'.$idTT1; echo "<tr><td>".$rowset[1]." ".$rowset[2]."</td><td> &nbsp; </td> <td class='table_label'> <...

Do I need to have meaningful names for loop control variables?

Code Complete book suggested, it is a good practice to use meaningful names for loop control variables. For example: for(int month=0; month < MONTHS_PER_YEAR; month++){ // processing } Instead of single letters for example for(int i=0; i < MONTHS_PER_YEAR; i++){ // processing } I follow this practice and use meanin...

How to create module-wide variables in Python?

Is there a way to set up a global variable inside of a module? When I tried to do it the most obvious way as appears below, the Python interpreter said the variable __DBNAME__ did not exist. ... __DBNAME__ = None def initDB(name): if not __DBNAME__: __DBNAME__ = name else: raise RuntimeError("Database name has a...

batch file fails to set variable in IF clause

The following code is not updating Run to equal N even though the match occurs. this means I'm not dropping into the CALL code. Am i missing something here? SET Run=Y REM Check current files date/time information and establish if the file has been present too long in the directory REM Skip first 4 lines as header information not requir...

(K&R) At least the first 31 characters of an internal name are significant?

When taken literally, it makes sense, but what exactly does it mean to be a significant character of a variable name? I'm a beginning learner of C using K&R. Here's a direct quote from the book: "At least the first 31 characters of an internal name are significant. For function names and external variables, the number may be less than ...

jquery - find last element with a certain class and pass it to php?

Basically, I have a list: <li class="list">fruit</li> <li class="list">vegetables</li> <li class="list">protein</li> And, I want to find the last list item, get the text from it, and then assign it to a php variable, so that: <?php $variable = 'protein'; ?> I'm fuzzy on how to get it into a php variable? ...

Why value not submitted ?

<form method="post"> <label> <input type="text" value="" size="18" name="searchtxt" class="box"/> <input type="submit" value="Search" class="button" name=""/> </label> </form> I pressed submit,but searchtxt is not submitted,why? ...

Convert Integer Into String

I have a some numbers stored in a Integer called mode, but I need to use they in a TProcess. For this I need to convert the Integer into a String, because if I don't do this, I got the error: Incompatible types: got "LongInt" expected "AnsiString" Then I want to know how I can convert a Integer into a String? ...