Trouble with nested scopes

Light Alkmst

New Member
Reaction score
20
Lately, I've been trying to give a little bit more order to my post-processor code, and getting rid of a lot of "requires", but NewGen won't let me nest my scopes.

JASS:

scope Foo initializer FooBar
     scope Bar
     endscope

     private function FooBar takes nothing returns nothing
     endfunction
endscope


I have something similar to that, and I've hit a couple of roadblocks :banghead:. The syntax checker says that nested scopes can not have initializers. The other trouble is that it does not allow me to make Bar private to Foo.:confused:

"Scopes with initializers cannot allow nested scopes"

I'm pretty sure NewGen doesn't have code regions...
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Jass is very limited. Vexorian extends it to many crazy things(PRO!!). I think you need to ask Vexorian about this question on wc3c.net
 

saw792

Is known to say things. That is all.
Reaction score
280
JASS:
scope Foo
  scope Bar initializer FooBar
  
  private function FooBar takes nothing returns nothing
  endfunction

  endscope
endscope


Should work. But may be useless to you. Nested scopes are fairly useless themselves.
 

Light Alkmst

New Member
Reaction score
20
It's not the functionality I'm worried about though. I just wanted the folding...you know, making it a little tidier...
 

Romek

Super Moderator
Reaction score
963
You could use a struct initializer if you don't mind the code being run before other initializers.
Otherwise, just make another scope, which calls an Init function within the first scope.
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Jass is very limited. Vexorian extends it to many crazy things(PRO!!). I think you need to ask Vexorian about this question on wc3c.net
Horribly wrong. Everything in vJASS is possible in JASS, if you know how to write it.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
How does that even make sense in regards to what T.s.e said :nuts: ?

He's saying that vJASS can be made in JASS.
So vJASS isn't really "PRO".
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top