Search found 303 matches

by ShadowStorm
Tue Feb 25, 2025 2:28 am
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager

Mijikai wrote: Mon Feb 24, 2025 10:49 pm
ShadowStorm wrote: Mon Feb 24, 2025 10:29 pm I've tried to use it in the object creation for the methods instead:

Code: Select all

*ObjectMethods = AllocateMemory(SizeOf(ObjectMethods))
Do you supply the function pointers, setup the vtable?
An error on my part, I've corrected my message thank you.
by ShadowStorm
Tue Feb 25, 2025 2:25 am
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager

This works, but my code doesn't. Go figure ! :evil: :twisted:


Interface NewRectangle
Perimeter.i()
Surface.i()
Length.i(Valeur)
Width.i(Valeur)
Destroy.i()
Abc1.i()
Abc2.i()
Ab3.i()
Abc4.i()
Abc5.i()
Abc6.i()
EndInterface

Structure StructureObject

*SObject.NewRectangle ...
by ShadowStorm
Mon Feb 24, 2025 11:23 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager

It also works like this, but it doesn't change anything, as the methods are not listed in the object.

; ======================================================
; Création d'un nouvel Objet.
; Creating a new Object.
; ======================================================
Procedure.i NewObject ...
by ShadowStorm
Mon Feb 24, 2025 10:29 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager

I've tried to use it in the object creation for the methods instead:

Code: Select all

*Object\Methods  = AllocateMemory(SizeOf(ObjectMethods))
After all, ObjectMethods is an interface, not a structure, so maybe that's where the problem lies!
No changes.
by ShadowStorm
Mon Feb 24, 2025 10:09 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager

Even if I add other procedures, whatever, it doesn't work, and I've even tried removing
AbcBox.s(Title.s, Message.s), to see if the problem came from there, in short, it doesn't work for me!

Interface ObjectMethods ; Les Noms des procédures doivent être identiques à ceux du code, avec les mêmes ...
by ShadowStorm
Mon Feb 24, 2025 9:54 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager


PureBasic is not object-orientated.

You have to look for another language and learn it. PureBasic supports the standard interface for OOP to access COM objects.
It is sufficient for simple OOP in PureBasic. What you want to do is pure OOP and PureBasic will never become an OOP language (luckily ...
by ShadowStorm
Mon Feb 24, 2025 8:30 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager

Even if I restart PB, it doesn't work!
I've already had this kind of problem not long ago on another test, it's incomprehensible!

https://drive.google.com/file/d/1JV9wNgl4BYowIWEM_JGyosO6qtjSVEYN/view?usp=sharing

As I said, I'm doing some tests and then I'll see what I can do, I still have a lot ...
by ShadowStorm
Mon Feb 24, 2025 7:34 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager

I've tried it this way, it might be better but it doesn't change anything in the end.


; Code créer par Dieppedalle David avec l'aide de l'IA, le 24/02/2025.
; Code created by Dieppedalle David with the help of AI, on 24/02/2025 ...
by ShadowStorm
Mon Feb 24, 2025 5:44 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager

Hi, there,

Ok well, at the moment I'm encountering a problem that I don't understand at all ! :? :shock:
I'm trying to integrate parent-child management into the code, but I'm having a strange problem even though the code seems to work fine !

The object's AddChild() method isn't referenced, but ...
by ShadowStorm
Sun Feb 23, 2025 9:17 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: [Rename] Object-oriented programming simulation for a virtual object manager

Hello Smaag,

Thank you again for your example :) :wink:
However, I don't like it :oops:

Why :?:

I want my object to have fields: Properties, Methods, each displaying their own fields, I want everything to be well partitioned!
I understood what you did, but I don't like it, I don't find it ...
by ShadowStorm
Sun Feb 23, 2025 5:04 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: A virtual object manager code

So, what do you think of this approach ?


; Code créer par Dieppedalle David avec l'aide de l'IA, le 22/02/2025.
; Code created by Dieppedalle David with the help of AI, on 22/02/2025.

; ======================================================
; Structure des propriétés de l'Objet.
; Structure of ...
by ShadowStorm
Sun Feb 23, 2025 12:38 pm
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: A virtual object manager code

Oh yes, of course, I'm stupid since in NewObject() I do: *Object\Methods = *Object
Thank you Mijikai :wink:

But then, although everything works now, why when I delete the object at the end with: *MyObject\Methods\DeleteObject()
Do I still have memory spaces?

This shows the same memory addresses as ...
by ShadowStorm
Sun Feb 23, 2025 10:48 am
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: A virtual object manager code



...but the problem with the interface is that I can't do for example:

*MyObject\X = 45
ObjectX.i = *MyObject\X

In fact, I can only use this kind of thing:

*MyObject\SetX(45)
ObjectX.i = *MyObjectGet(X)


Why are you still saying this?
It is wrong, i even posted an example.
\method = *object ...
by ShadowStorm
Sun Feb 23, 2025 1:25 am
Forum: Coding Questions
Topic: [Rename] Object-oriented programming simulation for a virtual object manager
Replies: 73
Views: 13972

Re: A virtual object manager code

Okay, I’m not far from the goal. I tried to modify it myself using an interface, and it seemed
to work until I added a procedure: DeleteObject()

Which:

1- Isn’t even referenced in the object’s methods, and I don’t get why, by the way!
2- There’s a problem with the DeleteObject() procedure—it’s ...