Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Axoi ! (Registered 2019-05-22) You are not logged in 
CSDb User Forums


Forums > C64 Coding > kick assembler namespaces and enums
2019-04-19 21:19
WdW

Registered: Jun 2013
Posts: 13
kick assembler namespaces and enums

Hi coders,

I would like to use enums in namespaces but so far, no luck. This is what I have right now:

.namespace game {
.enum {PLAY,GAMEOVER,ENTERNAME,ATTRACT}
}

I would like to be able to do something like:

LDA #game.ATTRACT

which would result in .A being 3. But I get this error:

Error: Variable 'PLAY' not present on value of type 'Namespace'

I also tried to add .constants to the namespace, but this also does not work... Any ideas?
2019-04-21 15:22
Dr.j

Registered: Feb 2003
Posts: 247
i am not sure if Enum structure work on namespace , but it work from the root level.
.enum {singleColor, multiColor} // Defines singleColor=0, multiColor=1
lda #multiColor
sta $0400. set #1 on $0400
2019-04-22 11:01
WdW

Registered: Jun 2013
Posts: 13
Yes, I know it works in the root namespace. I thought it would be nice to reference it from a namespace, but that apparently just doesn't work.

Thanks!
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Dipswitch/Up Rough
csabanw
Guests online: 45
Top Demos
1 Unboxed  (9.7)
2 Uncensored  (9.7)
3 Edge of Disgrace  (9.7)
4 Coma Light 13  (9.6)
5 Comaland 100%  (9.6)
6 The Shores of Reflec..  (9.6)
7 Lunatico  (9.6)
8 X Marks the Spot  (9.5)
9 Wonderland XII  (9.5)
10 Comaland  (9.5)
Top onefile Demos
1 Smile to the Sky  (9.6)
2 Instinct  (9.5)
3 Daah, Those Acid Pil..  (9.5)
4 Dawnfall V1.1  (9.4)
5 FMX Music Demo  (9.4)
6 Party Horse  (9.4)
7 Pandemoniac Part 2 o..  (9.4)
8 What Is Special Orde..  (9.4)
9 Crystal Gazer  (9.4)
10 Rewind  (9.4)
Top Groups
1 Fossil  (9.7)
2 PriorArt  (9.7)
3 Oxyron  (9.4)
4 Booze Design  (9.4)
5 Censor Design  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Horizon  (9.8)
3 The Mind Slayer  (9.8)
4 Stormbringer  (9.7)
5 The Shadow  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2019
Page generated in: 0.041 sec.