name
This function checks returns the current variable name as a string. If applicable, the name also contains the members.
Indirect parameter passing is disabled
1-2
No. | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
1 code |
variable :string |
Variable to check | ||||||
2 input |
string | Option Following options are supported:
Default value: text |
Type | Description |
---|---|
string | Variable name as text Uses same syntax as B4P code |
set | Variable name as set set contains variable name in 1st element followed by member names and/or numbers. |
boolean | false if variable not found In this case, false is returned. |
a[] = Ah;
b[2] = two;
c[alex] = Alexander;
c[tim] = Timothy;
d[] = ^c[alex]; // Reference
echo( name( a[] ) );
echo( name( c[tim] ) );
echo( name( c[tim], members named ) );
echo( name( b[2], members named ) ); // Array members will always be numbered
echo( name( c[tim], members numbered) ); // All members are numbered
echo( name( d[] ) ); // References reveal their destination variables
a[]
c[tim]
{'c','tim'}
{'b',2}
{'c',1}
c[alex]