Questions tagged [scalar]

In computing and programming, a scalar variable or value refers to a single value, as opposed to data structures such as arrays or lists.

In computing and programming, a scalar variable refers to a single value, as opposed to data structures such as or s. A scalar can be of any type, including a complex type such as an object or string. Being scalar only means that it is manipulated as a single value.

As an example, the string type in C++ is considered to be a scalar as it is a primitive type containing a single value, although in the C language there is no such primitive type. Thus, the char array implementation of strings typically used would not be considered as a scalar.

See also:

532 questions
-1
votes
3 answers

Perl scalar reference

I am trying to do some scalar reference work. Here is a simplified version of what I am trying to accomplish. I am currently using perl 5.10.1. Notes: *color is dynamically obtained *trying to get a say 100, or the red value *I realize this is…
tavor999
  • 447
  • 6
  • 25
-1
votes
2 answers

Can't use string ("a,b,c") as an ARRAY ref

I am writing some code for an automated theorem prover. I wanted to implement an option for the user to pass a file on the cmd line and have it operate in batch mode. Here is the code to parse the file and fill the @clauses array. # batch mode if…
-1
votes
1 answer

Deciphering and printing a loop condtion

Apologies for being newbie, I inherited perl code that I can not figure out, perhaps one of you can. for ( @{$things} ){ ... } I know arrays begin with @ and scalars begin with $. I am not sure exactly what we are doing here, and attempts to…
MuchNoob
  • 3
  • 2
-1
votes
2 answers

Stata naming scalars in a loop

I am starting with a list of variables that I would like to run regressions on. I would then like to save their coefficients as a scalar with a number on the end. For example, here is my code so far local varlist="vertical reps" foreach…
Pcarlitz
  • 223
  • 1
  • 5
  • 17
-1
votes
2 answers

Create 1000 Function W/ Leading 0's

Good Morning DBA's, I need a function to pulls an int DocumentID column and returns the lowest thousand int. The limitation is our result must have 8 chars and the leading characters need to be 0's. Example 1: 1234 (int contained in DocumentID…
Chase Cabrera
  • 83
  • 1
  • 1
  • 6
-1
votes
1 answer

Must declare a scalar variable

I was creating a column that will give a me random number but I was getting some errors. CREATE TABLE tblBookInfo ( AccessionNumber NVARCHAR(MAX) RandomNumber NVARCHAR(10); AccNo NVARCHAR(MAX) @Upper INT; @Lower INT SET @Lower = 1 SET @Upper =…
user1932119
  • 35
  • 10
-1
votes
3 answers

Preceding a number with \ prints garbage value

Preceding a number with escape character '\' produces garbage value Ex: $a = \12; print $a; This code gives below output SCALAR(0x2001ea8) and the output changes when I again execute the program. If I take a value(number) from user when the user…
VAR121
  • 512
  • 2
  • 5
  • 16
-1
votes
1 answer

Counting to Scalar Value

So I have a foreach loop: foreach (1..10) { print "#", $t, "\n"; } But I also have a scalar: $number = 5; Can I count from 1 to the scalar like so? foreach (1..$number) { print "#", $t, "\n"; } When I do this, the program simply…
Dynamic
  • 921
  • 1
  • 12
  • 31
-2
votes
2 answers

can use " int a = {0} " in C programe to init a array?

I found this code , when I compile it , the compiler tell me "subscripted value is neither array nor pointer" . I know my platform is old . but I want know that "unsigned int bValue = {0}" is a new way to init array ? unsigned int bValue =…
riverfan
  • 475
  • 4
  • 7
-2
votes
1 answer

Incorrect syntax near 'nvarchar'. Must declare the scalar variable "@Road"

While importing bak file to SQL Server, I am getting above messages. I do not know where this error is coming from. Is there a way to check where this @road is defined in my SQL DB? How to declare scalar variable in SQL?//Standard declaration…
-2
votes
1 answer

Fortran 90 - Algebra operation with scalar and arrays

I am working with a Fortran 90 program that, amongst many others, has the following variables declared: real(r8) :: smp_node_lf real(r8), pointer :: sucsat(:,:) real(r8), pointer :: h2osoi_vol(:,:) real(r8), pointer :: watsat(:,:) real(r8), pointer…
thiagoveloso
  • 2,537
  • 3
  • 28
  • 57
-2
votes
2 answers

which clustering algorithm is best for clustering one-dimensional features?

Which clusetring machine learning algorithm is best to be used for clustering one-dimensional numerical features (scalar values)? Is it Birch, Spectral clustering, k-means, DBSCAN...or something else?
-2
votes
1 answer

RDL to SQL, Must declare the scalar variable

I am trying to take a query I found in a RDL file and run it in SQL. I have no idea what I'm doing. I tried multiple solutions I found through searching the web to no avail. The errors I am getting are: "Must declare the scalar variable" for…
-2
votes
2 answers

Declare scalar variable SQL

My problem is i want to use this local variable inside my update query, is there a way of doing this? DECLARE @listStr VARCHAR(MAX) SELECT @listStr = COALESCE(@listStr+''',''' , '') + cast(int_guid as varchar(max)) FROM ex_in SELECT…
Girre
  • 47
  • 1
  • 9
-2
votes
1 answer

Using scalar value in Stata

I am trying to do a t test for values I stored in scalars that I extracted from a regression analysis on panel data-set (see sample code A). but Stata is not allowing me to use the scalar names as variable names (error:'Type7df' found where integer…
OAM
  • 73
  • 2
  • 2
  • 7
1 2 3
35
36