Dynamic and object style structs

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Dynamic and object style structs

Post by techjunkie »

I would like something like this,

Code: Select all

Structure <struct_name>
  Var1
  Var2
  AnotherStruct
EndStructure

instance.struct_name = New struct_name

Delete instance
Delete struct_name

Insert
InsertAfter
InsertBefore
FirstStruct
NextStruct
LastStruct
(and more)

For instance.struct_name = Each struct_name
Next

While instance.struct_name
Wend

Repeat
Until instance.struct_name = LastStruct
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
venom
User
User
Posts: 56
Joined: Fri Jul 25, 2003 1:54 pm
Location: Australia

Post by venom »

A linkedlist of <struct_name> using NewList, or use pointers and allocate the memory for the struct.
Kris_a
User
User
Posts: 92
Joined: Sun Feb 15, 2004 8:04 pm
Location: Manchester, UK

Post by Kris_a »

Ah, that sounds a lot like Blitz. I agree, I think this would be nicer than the current linked list system :)

Edit: I think this code, though...

Code: Select all

Repeat 
Until instance.struct_name = LastStruct 
would need to be changed to 'LastStruct.struct_name', so it knows which one you're talking about...
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

Kris_a wrote:Ah, that sounds a lot like Blitz. I agree, I think this would be nicer than the current linked list system :)

Edit: I think this code, though...

Code: Select all

Repeat 
Until instance.struct_name = LastStruct 
would need to be changed to 'LastStruct.struct_name', so it knows which one you're talking about...
Yeah - it's "Blitz Style"... :oops:

But it is really usefull... :D

Code: Select all

Until instance.struct_name = LastStruct.struct_name
Well, do you need this? You can pick the struct_name from the left side - couldn't you?
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

or - why not go all the way...

Code: Select all

Class <class_name>
  Protected var1
  Public var2
  Public struct1
  Procedure1
  Procedure2
EndClass
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Kris_a
User
User
Posts: 92
Joined: Sun Feb 15, 2004 8:04 pm
Location: Manchester, UK

Post by Kris_a »

techjunkie wrote: Well, do you need this? You can pick the struct_name from the left side - couldn't you?
Well, no, but I'm sure this is easier to program (into PB itself)

Good idea about the protected/public members, too :idea:
Last edited by Kris_a on Mon Feb 23, 2004 2:31 pm, edited 2 times in total.
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

OOP, oop-e-oop, oop-e-oop.. :lol:

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

LarsG wrote:OOP, oop-e-oop, oop-e-oop.. :lol:
:D Yeah - what can I say...

BlitzMax is scheduled to Mars and it will be all object oriented... I would love to see Pure give it a real fight!

I like Blitz but I like Pure more!
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

techjunkie wrote:I like Blitz but I like Pure more!
and yes Fred... You can use this for advertising... :lol:
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

techjunkie wrote:...BlitzMax is scheduled to Mars..
8O whaaaaat?!? where did you get that information :?: .. I haven't read anything about BlitzMax since Marks last worklog post...

Spill the beans.. spill it!!!!!!! :twisted:

ellers så må jeg komme å ta deg!!!! :wink:

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

LarsG wrote:ellers så må jeg komme å ta deg!!!! :wink:
No, no - don't take me... :roll:

This is way of topic, but... :wink:

What I heard from the Blitz Community and the Blitz Forum... Is the scheduled release date Mars 11 2004. I don't know if it is a rumor or true... I read it in several places...
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

wow.. that's just over two weeks..
*LarsG goes to read up on BB.com and BC.com*

[edit] techjunkie: I couldn't find a sigle post on March 11 and blitzmax.. can you give me some links?? [/edit]

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

:cry:

Couldn't find the links... but I asked in the forum again... I'll guess we have to wait and see...

Cheers!
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Kris_a
User
User
Posts: 92
Joined: Sun Feb 15, 2004 8:04 pm
Location: Manchester, UK

Post by Kris_a »

Well, if pure has all these features that have been asked around on the forum (especially this one and the dynamic pointer one), I'm sure it'll give BMax some good competition :D
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

Kris_a wrote:Well, if pure has all these features that have been asked around on the forum (especially this one and the dynamic pointer one), I'm sure it'll give BMax some good competition :D
Ohhh YES it would, ohhh yes it would... :!: :!: :!:

:D

Called what? PurePower++? PP++?!?!

Hehe...
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Post Reply