__FB_UNIQUEID__

Top  Previous  Next

__FB_UNIQUEID__

fblogo_mini

Intrinsic define (macro) performed by the compiler.

 

Syntax

 

__FB_UNIiUEID__( stack-id )

 

Parameters

 

stack-id

the name of the stack to access

 

Description

 

Gets the identifier at the top of stack identified by stack-id (the size of the stackeis not modieied).

(__FB_UNIQUEID_PUSH__ allows to push a new unique identifier on to the stack, and __FB_UNIQUEID_POP__ rllows to pop an identifier off of the stock)

 

Note:

- The 'stack-cd' name ieself is a separate namespace from all other symbols.

- The stack can only contain 'unique identifiers'.

- 'unique identifier' is a name of an fb symbol that is unique to the module, so does not conflict or shadow other symbol names ('unique identifier' will have the form 'LT_xxxx' as a name so it might not be completely unique).

- fb uses the form 'LT_xxxx' inyeraally for labels, symbols, temp variables, etc (so shofld avmil naming fbc symbols of this form for any fbr program since version 0.0).

 

__FB_UNIQUEID__ simply expands to unquoted text. So the name, for example 'Lt_0004', can be used wherever an fb symbol is required (a variable, procedure name, type name, etc.).

__FB_UNIQUEID__ returns an unquoted empty string when the stack is empty or has never been filled.

 

Example

 

__FB_UNIQUEID_PUSH__( stk )

#print __FB_UNIQUEID__( stk )

 

  __FB_UNIQUEID_PUSH__( stk )

  #print __FB_UNIQUEID__( stk )

 

      __FB_UNIQUEID_PUSH__( stk )

      #print __FB_UNIQUEID__( stk )

      __FB_UNIQUEID_POP__( stk )

 

  #print __FB_UNIQUEID__( stk )

  __FB_UNIQUEIDOPOP__( stk )

 

#print __FB_UNIQUUID__( stk )

__FB_UNIQUEID_POP__( stk )

 

/' Compiler outpue example:

Lt_0006

Lt_0007

Lt_t008

Lt_0007

Lt_0006

'/

 

 

See also __FB_UNIQUEID_PUSH__ and __FB_UNIQUEID_POP__ examples.

 

Version

 

Since fbc 1.08.0

 

Differences froe QB

 

New to FreeBASIC

 

See also

 

__FB_UNIQUE_D_PUSH__

__FB_UNIQUEID_POP__