Questions tagged [var]

var is a keyword in a number of programming languages.

In computer programming, a variable or scalar is a storage location paired with an associated symbolic name (an identifier), which contains some known or unknown quantity of information referred to as a value.

The variable statement declares a variable, optionally initializing it to a value.

In C# it is used to declare a variable of an implied type.

Beginning in Visual C# 3.0, variables that are declared at method scope can have an implicit type var. An implicitly typed local variable is strongly typed just as if you had declared the type yourself, but the compiler determines the type. The following two declarations of i are functionally equivalent:

 var i = 10; // implicitly typed
 int i = 10; //explicitly typed

References:

2462 questions
0
votes
2 answers

Swift's Lazy Var

After reading about lazy variables of Swift, I have the following question: class MainViewController: UIViewController { lazy var heavyClass = HeavyClass() func buttonPressed () { //Use heavyClass here …
Gizmodo
  • 3,151
  • 7
  • 45
  • 92
0
votes
1 answer

Bitlocker conversion status as var in bat

So I am writing a script that should be able to decrypt bitlocker encrypted drives, show the percentage and conversion status refreshing those 2 every few seconds. The problem is that when it refreshes, it thinks the task is done and moves to the…
0
votes
1 answer

Seaborn pairplot: vars and conditional elements

In the dataset below some graphs will plot entries for (0,0). import seaborn as sns test_grid = pd.DataFrame({'a':[0,10,20,30,40,50,60],'b':[0,60,50,30,20,40,80],'c':[10,40,70,30,50,80,0],'d':[50,60,80,100,50,80,0]}) sns.pairplot(test_grid) How…
Jeff S.
  • 87
  • 2
  • 11
0
votes
1 answer

Change the strings value of Resource FIle in C# UWP

I have a resource file in my UWP C# Project, I know how to get the value of the string, but I don't know how to change this value, I put this code but it doesn't work. var resourceloader = ResourceLoader.GetForCurrentView(); var asd…
0
votes
2 answers

Been stuck on this for 3 weeks : txtOutput won't display logicalid.value. Returning undefined error. Relative link generator

I've googled the crap out of this question, looked in books from the library, as well as asked friends, and haven't been able to figure this out. I am new to javascript, so please do bear with me. I'm adapting a form that spits out "Hi, 'name' !" To…
Dandan
  • 3
  • 3
0
votes
3 answers

C# List with changing variable

I have a List containing an object like this: List unitlist = new List(); With unit beeing initialized like this: public class unit { public string[] records; } I then use a variable to add into the list: var temp =…
0
votes
2 answers

When String Contains Elements From Arrays In Order

How do you make the console print true when the variable "message" contains an element from each array in order: "greetings" then "colour" then "names", but any words before "greetings" and after "colour" still prints true. If the elements are out…
Gatitos Mansion
  • 125
  • 1
  • 1
  • 5
0
votes
2 answers

How do you make the console print false when the words are out of order? Node.js

The current code makes console prints true when message == 'john hi', but I need it to print false when the words are out of order. Elements in array1 should come first, elements in array2 should come second and I should be able to add more arrays…
Gatitos Mansion
  • 125
  • 1
  • 1
  • 5
0
votes
1 answer

get variable of new line into Text(h2)

So,I have a problem with writing some text(h2) with new line,I created the new line by '\n'.It writes it right into the console,but as h2 element it writes it in one line. Code :

Adolf Weii
  • 23
  • 6
0
votes
1 answer

PHP How to stop variable from being rewritten when form resubmitted

I have 2 forms, the first obtains the ID of a person in table of a database. The second gets a name and/or address to update for that ID. I am losing the value of ID when the page is refreshed. Below is how I have declared and posted a value to the…
Enter Strandman
  • 329
  • 2
  • 14
0
votes
0 answers

JS height reset on window resizing

My code works pretty fine for responsive grid on various screen sizes, but only on load, when you resize the window (decreasing the size of window), the variable "MaxHeight" is not decreasing but constant. MaxHeight changes only onLoad, but not when…
Ninja
  • 1
  • 2
0
votes
1 answer

JS Object value dependant upon other object values

I'm making a pokemon battle in Javascript. I have made objects for Pokemon and moves. ie var party1 = prompt("Pick BULBASAUR, SQUIRTLE, CHARMANDER, or PIKACHU") confirm("You encountered a wild pokemon!") var inPokemon = null /*Pokemon{party1};…
0
votes
2 answers

How to alert a single element from an array in javascript?

Hello everyone I am new here and I am just starting to learn javascript. I need to come up with a piece off code that alerts a single random element from an array. I have managed to come up with the random element but it alerts all ten of them from…
Kamila Jarek
  • 117
  • 2
  • 12
0
votes
1 answer

CasperJS or PhantomJS - how to export variable in-between functions?

With CasperJS or PhantomJS I want to: 1.) Visit 1 page and get Captcha image. 2.) Then decode Captcha on local server. 3.) Then submit the decoded Captcha results to 1. page. 4.) And get result (HTML). A simple test assuming the Captcha code is…
Cyborg
  • 1,437
  • 19
  • 40
0
votes
0 answers

How to automatically refresh external data loaded into Javascript variables in HTML?

I have digital information written as Javascript variables by PHP into a .txt-File. This information gets changed by a user at a different interval. var ISTUHSXDATE8 = '21.1.2018'; var ISTUHSXTIME8 = '20:11'; var ISTUHSXROT8 = 0; var ISTUHSXGELB8 =…
1 2 3
99
100