Strongly needed this:

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Strongly needed this:

Post by Psychophanta »

Is this code well done?

Code: Select all

Structure a 
  b.l 
  *c.l 
EndStructure 
var.a 
*var\c=2 
Obviously it is not well done, because it is not the same var.a than *var.a, so why PB syntax doesn't allow var\*c=2 in order we can see in the code whether there is a pointer field or not in a structure?

Fred, maybe you can think about to add var\*c like syntax :?
Can you see what i mean?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

yes, this sounds logical. it will be done for the next major release.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

next... as in next century's? :-)

any hopes of getting this one resolved in 4.00?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

blueznl wrote:any hopes of getting this one resolved in 4.00?
Yes, here is one hope: my hope :D
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Post by Justin »

wouldn't this break tons of existig code without introducing any feature?
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

This is a inconsistency here which needs to be resolved IMHO.
MLK
User
User
Posts: 57
Joined: Sat Jan 24, 2004 8:46 pm
Location: Germany

Post by MLK »

since last release *pointers are allowed in structures. but using them as var\*pointer fred just forgot to implement :-)
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Post by Dr. Dri »

this code works, doesn't it ? why would you change PB syntax ?

Code: Select all

Structure test
  variable.l
  *pointer.Long
EndStructure

var.test
var\pointer = @var\variable
var\variable = 5
Debug var\pointer\l
Dri :?:
okasvi
Enthusiast
Enthusiast
Posts: 150
Joined: Wed Apr 27, 2005 9:41 pm
Location: Finland

Post by okasvi »

because var\*pointer is more logical and im sure Fred tries to keep syntax clear and logical :)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

okasvi wrote:because var\*pointer is more logical
That's the point.

And if i can do:

Code: Select all

*pointer.Long
pointer.Long
then why can not do:

Code: Select all

Structure test 
  *pointer.Long
  pointer.Long
EndStructure
:?:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

To Fred:
What about this? :)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

After much tough, it won't be changed for now.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

:cry:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

:cry:
But when you don't change it for V4, there will be another release that will
break a lot of existing code which is surely not nice, too :?
:(
Athlon64 3700+, 1024MB Ram, Radeon X1600
vanleth
User
User
Posts: 79
Joined: Sat Jun 28, 2003 4:39 am
Location: Denmark - Valby

Post by vanleth »

Agree with the inconsistency of the syntax in this structure/pointer subject. It has confused me before.

But I rather wait for PB4 Beta, and then take subject to discussion, since I also belive it will put down alot of ealier PB codes and I have no idea what PB4.0 brings.
Maybe others have similar suggestions to the current PB syntax consistency, so they can all be nailed down in one future release.
Post Reply