» Home » variable » Page 1
I'm trying to assign a variable to check-boxes and adding that variable to an output variable when it's checked
Category : Web Design

I'm very new to Javascript and would appreciate ANY help! I'm also using a jQuery library if that changes anything.


What I need is that if the first checkbox was ticked the output should be 100kcal, while if both were ticked then it should add up to 300kcal. My problem is that when I untick it adds the variables AGAIN.


HTML:


<input type=ch

View Replies


get a variable's content, from the contents of another variable, both variable names have the same trailing number
Category : Operating Systems

in a bash script, How do I get a variable's content, from the contents of another variable, both variable names have the same trailing number?


IP1=192.168.0.17
DIR1=/mnt/2tb/archive/src/
IP2=192.168.0.11
DIR2=~/src/
IP3=192.168.0.113
DIR3=~/src/
#get local ip and set variable HOST to local ip
HOST=$(ifconfig | grep 'inet addr:'| grep -v '127.0.0

View Replies


How to use the bash command 'read -e variable' and pass the variable to a python variable
Category : Programming Languages

I'd like to pass shell input to a variable in python. Normally I would use the raw_input() method for this, but I'd like to use something which allows me to "browse" through my folders.


In a bash script I'd use something like this: (The -e allows me use the "autocomplete" function of the shell via Tab.)


#!/bin/bash
echo Please input the path to the

View Replies


How to select a variable and update another variable with that selected variable in single query?
Category : Databases

I want to select top 1 row from a table and update a column of that selected row at the same query. So this is the select query I am using


SELECT TOP 1 PageId,
PageUrl,
CrawlDepth
FROM tblPages
WHERE MainSiteId = 1
AND UnExpectedCrawlError = 0
AND CrawlStatus = 0
AND CrawlingStarted = 0

View Replies


PHP Error when using variable variable to insert data into static variable
Category : Development Tools & Services

I'm not very good at this, so I'm sure this is a stupid question.


I have a class:


class debug {
private static $messages = array();
private static $errors = array();
private static $all = array(); // includes both of above
private static $types = array('messages','errors');
public static function add($type, $message) {
if(!i

View Replies


Pass a variable or call a class variable directly? Return variable vs setting class variable directly?
Category : Programming Languages

Which of these would be considered a better coding habit? These all achieve the same results (and is obviously an extremely simple example) but I didnt know if it was better to try and maintain function portability.


1


Public Sub myFunction()
classInteger = GetLength(classString)
End Sub
Public Function GetLength(ByVal localString As String) As Integ

View Replies


Refer to variable name by another variable, or determine variable name from variable
Category : Web Design

I have a function, which iterates over some objects, and I want to then use the variable name of the object being iterated over. Currently I maintain a duplicate list of names, and refer to them by array index. This seems unnecessary. The whole thing is in an enclosure.


In principle, I can see two ways to do it.


One is to use the list of names, and somehow refer the the


View Replies


How do I setup a reference variable to another variable/UILabel variable?
Category : Programming Languages

Let's say I have several lines of code to clarify specific settings on a given UILabel variable:


numberMarkings[selectedBoxX][selectedBoxY][selectedSquareX][selectedSquareY][selectedNoteX][selectedNoteY].text = @"derp";
numberMarkings[selectedBoxX][selectedBoxY][selectedSquareX][selectedSquareY][selectedNoteX][selectedNoteY].center.x = 5;
numberMarkings[selectedBo

View Replies


I have a variable with another variable within its name. How do I change it into a session variable?
Category : Programming Languages

Basically what the title says. I know how to make a normal variable into a session variable ($_SESSION['var']), but not when it contains another var


This is my code:


<?php
session_start();
$_SESSION["uname"] = "Tyler";
if (isset($_SESSION["coins{$uname}"]))
{
echo "$_SESSION["uname"] : $_SESSION["coins{$uname}"]";
}
View Replies


Complex variable (variable name change with others variable) possible?
Category : Programming Languages

I would like to use a way for use variable to change the name of an other variable...
Because an example is always appropriate :


<?php
for ($i = 1; $i <= 5; $i++) {
${a.$i} = "value";
}
echo "$a1, $a2, $a3, $a4, $a5";
//Output is value, value, value, value, value
?>

For me, I got 5 steps, for each step, I have


View Replies


Next
2012 / 2017 Copyrights BigHow , All Rights Reserved .