@#StringConstant$ doesn't work

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

@#StringConstant$ doesn't work

Post by Sicro »

Code: Select all

#StringConstant$ = "Hello"
Debug @#StringConstant$
[COMPILER] Line 2: Constant not found: #.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
User avatar
Tenaja
Addict
Addict
Posts: 1949
Joined: Tue Nov 09, 2010 10:15 pm

Re: PB_5.50: @#StringConstant$ doesn't work

Post by Tenaja »

I do not believe this is a bug. If you require a pointer to a constant, you have to make a variable, then assign the constant to it, then point to the variable.

Or, you can put it in data, then point to the data label address.

Unless something has changed that I missed.
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: PB_5.50: @#StringConstant$ doesn't work

Post by Sicro »

Help: history wrote:25th July 2016 : Version 5.50

- Added: #StringConstant$ syntax support, to get the address of a string constant
I just found out that it worked with PB_5.50_beta1. The other beta versions unfortunately I could not test.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Justin
Addict
Addict
Posts: 832
Joined: Sat Apr 26, 2003 2:49 pm

Re: PB_5.50: @#StringConstant$ doesn't work

Post by Justin »

It does not work on windows 64 either.
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: PB_5.50: @#StringConstant$ doesn't work

Post by User_Russian »

This is added in PB 5.50, but has not yet been implemented.
User avatar
skywalk
Addict
Addict
Posts: 3995
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PB_5.50: @#StringConstant$ doesn't work

Post by skywalk »

Still does not work on PBv57 x64.
Sicro wrote:

Code: Select all

#StringConstant$ = "Hello"
Debug @#StringConstant$
[COMPILER] Line 2: Constant not found: #.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply