[Implemented] Som Compiler Things

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

[Implemented] Som Compiler Things

Post by Konne »

I would like the following Compiler\Debuger Commands:

The Debugger Command:

Code: Select all

ViewMemory(*Start,End)
And the Compiler Command:

Code: Select all

CompilerVarSelect <Variable>
  CompilerVarCase #PB_Word
CompilerVarEndselect
Apart from that Mrs Lincoln, how was the show?
MVXA
User
User
Posts: 18
Joined: Tue Feb 22, 2005 11:09 pm
Contact:

Post by MVXA »

Since this was my idea, I'm likewise for the new ViewMemory instruction. :wink:
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

CompilerVarSelect <Variable>
CompilerVarCase #PB_Word
CompilerVarEndselect
i do not understand your request.

there's already these ones :
CompilerSelect
CompilerCase
CompilerEndselect
CompilerIf Defined(myvar,#PB_Variable)
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

maybe this it what you need (?)

Code: Select all

Macro TypeOf(var)
  If Defined(var, #PB_Constant):       Debug "constant"
  ElseIf Defined(var, #PB_Variable):   Debug "variable"
;  ElseIf Defined(var, #PB_Byte):       Debug "byte"
;  ElseIf Defined(var, #PB_Character):  Debug "character"
;  ElseIf Defined(var, #PB_Word):       Debug "word"
;  ElseIf Defined(var, #PB_Long):       Debug "long"
;  ElseIf Defined(var, #PB_Quad):       Debug "quad"
;  ElseIf Defined(var, #PB_Float):      Debug "float"
;  ElseIf Defined(var, #PB_Double):     Debug "double"
  ElseIf Defined(var, #PB_Array):      Debug "array"
  ElseIf Defined(var, #PB_LinkedList): Debug "linkedlist"
  ElseIf Defined(var, #PB_Structure):  Debug "structure"
  ElseIf Defined(var, #PB_Interface):  Debug "interface"
  Else:                                Debug "undefined"
  EndIf
EndMacro

a.l
b.f
NewList c.s()
Dim d.l(10)

TypeOf(a)
TypeOf(b)
TypeOf(c)
TypeOf(d)

but it needs to this macro some new defined types to works in an interessant way :

#PB_Byte
#PB_Character
#PB_Word
#PB_Long
#PB_Quad
#PB_Float
#PB_Double

rather than the very general #PB_Variable

:roll:
Last edited by Flype on Tue Apr 18, 2006 6:04 pm, edited 2 times in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

I think they want a TypeOf() compile-time function.

Edit: right.
Last edited by remi_meier on Tue Apr 18, 2006 6:04 pm, edited 1 time in total.
Athlon64 3700+, 1024MB Ram, Radeon X1600
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

i think so :wink:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Post Reply