Talk:Constants: Difference between revisions

From Unreal Wiki, The Unreal Engine Documentation Site
consts are always global
ah yes, the UScript compiler...
 
(One intermediate revision by one other user not shown)
Line 30: Line 30:


:That's because it doesn't really apply the scpoing concept to constants. They are always global to the class. —[[User:Wormbo|Wormbo]] 00:11, 19 November 2015 (EST)
:That's because it doesn't really apply the scpoing concept to constants. They are always global to the class. —[[User:Wormbo|Wormbo]] 00:11, 19 November 2015 (EST)
::I did not find any scope description in the article - therefore I found it worth to mention here. (BTW: UScript is the first language I saw where the scope of local definitions extends that area.) --[[User:SeriousBarbie|SeriousBarbie]] ([[User talk:SeriousBarbie|talk]]) 00:29, 19 November 2015 (EST)
:Well, the UnrealScript compiler is really basic compared to other languages - and it's written in really messy code. All these weird things are essentially compiler bugs. —[[User:Wormbo|Wormbo]] 10:28, 20 November 2015 (EST)

Latest revision as of 08:28, 20 November 2015

Constants with same name in different functions (UE1)

The UE1 compiler UCC.EXE does not support constants with the same name in different functions.

Example:

class test expands Object;

function Nothing1() {
const CDebug = true;
	return;
}

function Nothing2() {
const CDebug = true;
	return;
}

On compiling this, a GPF occurs:


Parsing Test General protection fault!

History: FScriptCompiler::CompileConst <- Const <- FScriptCompiler::CompileDeclaration <- FScriptCompiler::CompileStatement <- FirstPass <- TryCompile <- FScriptCompiler::CompileScript <- (Class BarbiesWorld.Test, Pass 0, Line 9) <- MakeScript <- MakeScript <- DoScripts <- UEditorEngine::MakeScripts <- UMakeCommandlet::Main

Exiting due to error


--SeriousBarbie (talk) 23:33, 18 November 2015 (EST)

That's because it doesn't really apply the scpoing concept to constants. They are always global to the class. —Wormbo 00:11, 19 November 2015 (EST)
I did not find any scope description in the article - therefore I found it worth to mention here. (BTW: UScript is the first language I saw where the scope of local definitions extends that area.) --SeriousBarbie (talk) 00:29, 19 November 2015 (EST)
Well, the UnrealScript compiler is really basic compared to other languages - and it's written in really messy code. All these weird things are essentially compiler bugs. —Wormbo 10:28, 20 November 2015 (EST)