Questions tagged [declare]

Use this tag for questions related to declare, which is usually meant for declaring variables, statements, etc.

642 questions
10
votes
1 answer

Is there ever a reason to use the declare keyword in front of types and interfaces?

I have come across some code like this: declare type A = { ... }; declare interface B { ... } From searching for the declare keyword (and none of the hits pointed to me the TypeScript docs for some reason), declare is used when a variable exists in…
pushkin
  • 7,514
  • 14
  • 41
  • 74
9
votes
4 answers

Missing partial modifier on declaration of type 'x' - cause by auto-generated code by designer

The full error description is as per below: And I found a few similar question posted before: A and B But the question in A and B does not provide detail of problem description (perhaps we prompted the same error message but caused by different…
jhyap
  • 3,423
  • 5
  • 24
  • 46
8
votes
2 answers

Create a function declaring a predefined text array

I need to create a function in Postgres and one of the variables I declare is a predefined text array, but I don't know the syntax to set its values. This is what I have so far: CREATE OR REPLACE FUNCTION testFunction() RETURNS text AS $$ DECLARE …
Edson Horacio Junior
  • 2,451
  • 2
  • 23
  • 39
8
votes
4 answers

why a[n] is accepted in c during runtime?

why can we do this in c? int n; scanf("%d",&n); int a[n]; I thought array is located memory during load time but seems like the above example works during runtime. Do I misunderstand any thing? can you guys help? Thanks,
user188276
8
votes
1 answer

How to declare session variable in C#?

I want to make a new session, where whatever is typed in a textbox is saved in that session. Then on another aspx page, I would like to display that session in a label. I'm just unsure on how to start this, and where to put everything. I know that…
Carrie
  • 107
  • 2
  • 2
  • 5
7
votes
3 answers

Declaring SQL variables - SQL Server

Can anyone check on my statement... DECLARE @tblName varchar(MAX), @strSQL varchar(MAX) SET @tblName ='SELECT DISTINCT o.name as TableName FROM sysobjects o JOIN sysindexes x on o.id = x.id …
Argel Joseph
  • 275
  • 2
  • 4
  • 9
7
votes
2 answers

Clojure: resolve declares symbol

I get some weird behaviour when checking if a symbol can be resolved. user=> ok CompilerException java.lang.RuntimeException: Unable to resolve symbol: ok in this context, compiling:(NO_SOURCE_PATH:0) user=> (resolve 'ok) nil user=> (if (resolve…
Dominik G
  • 1,369
  • 2
  • 11
  • 33
7
votes
5 answers

How is this private variable "not declared in this scope"?

I'm currently trying to learn more about object oriented design in C++ (familiar with Java) and am running into some walls. The project I am trying to put together to learn these principles in a game built using SFML for the graphics and audio. I…
XBigTK13X
  • 2,445
  • 8
  • 26
  • 39
7
votes
2 answers

Declare a variable in Oracle SQL to use in a query

Hi I am trying to declare a variable to use in Oracle SQL select query as such: DECLARE myDate DATE; BEGIN SELECT Source as "Source", DT as "Date", Status as "Status", COALESCE("Count", 0) as "Count" FROM (Huge SubQuery that includes many WHERE…
Kairan
  • 4,722
  • 24
  • 57
  • 102
7
votes
1 answer

character encoding of a framed document was not declared

I get this warning in FF when developing a site of mine. I can't find any real info about it and how to fix this. the character encoding of a framed document was not declared. The document may appear different if viewed without the document framing…
Philip
  • 5,950
  • 12
  • 66
  • 99
6
votes
4 answers

How to assign char array in struct inline?

I'm trying to do something like this: struct SomeStruct { const char *bytes; const char *desc; }; SomeStruct example = { { 0x10, 0x11, 0x12, 0x13 }, "10-13" }; Why isn't this working?
d0c_s4vage
  • 3,527
  • 6
  • 21
  • 27
6
votes
2 answers

Kotlin declare nested array

How can nested lists be declared in Kotlin? I'm looking for something in the form of: var nestedList:List = [1,[2,[3,null,4]],[null],5] so that I can flatten it later on (result should be nestedList = [1, 2, 3, 4, 5]).
Dan Crisan
  • 117
  • 5
6
votes
4 answers

C++ Variables - declare and define. Inheritance

Let's have a C++ object A. There are two variables (VAR1 and VAR2) in A accessible to its children. Object B extends A and has one private variable VAR3 it can also access VAR1 and VAR2. Each instance of A/B has its own variables. Would this be the…
Petr
  • 131
  • 2
  • 4
6
votes
2 answers

PHP declare encoding

On the declare() page of the PHP manual: Encoding A script's encoding can be specified per-script using the encoding directive. Example #3 Declaring an encoding for the script. What does…
rink.attendant.6
  • 36,468
  • 57
  • 89
  • 143
6
votes
1 answer

how do php's declare(ticks) really work?

i created a signal handling class using pcntl_signal which now i want to use for sigalrm the problem i have is that my phpunit test for testing the signalclass works (where im only using declare ticks in the signalclass), but the testclass for…
John Doe
  • 2,607
  • 1
  • 29
  • 44
1 2
3
42 43