PureObject - PureBasic OOP support

Developed or developing a new product in PureBasic? Tell the world about it.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

It is strange.

Other code works.

Just that (and some minor variations) wander off and get lost in a navel-contemplating loop on my machine (XP-Pro).

Edit: This works:

Code: Select all

Class myStringThing
  myStringThing(string.s = "unused")
  Release()
  get()
  Flex Set(x.l)
  string.s
  bg.l
EndClass

Procedure myStringThing.myStringThing(string.s = "unused")
  Debug string
EndProcedure

Procedure myStringThing.Release()
  This\string =""
EndProcedure 

Procedure myStringThing.set(x.l)
  abc = x
EndProcedure 
  
Procedure.l myStringThing.get()
  bg = 0
  ProcedureReturn bg
EndProcedure 

*object.myStringThing = NewObject myStringThing("abc")
*object\Release()
;DeleteObject *object
Uncomment the DeleteObject line and it doesn't!
Dare2 cut down to size
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Check out OOP support for PB here!
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

OK, tried it out, I always get a syntax error with the code above.

Like it.....but how do you "un-install" it ?
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

I always get a syntax error with the code above
Can't duplicate that.
At what line?
Just a syntax error or a more detailed error message?

Like it.....but how do you "un-install" it ?
http://pb-oop.origo.ethz.ch/wiki/uninstall
Check out OOP support for PB here!
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

The very first line. No details, just a syntax error.

I saw the site already about just disabling it in the tools, what i mean is how do you get rid of it completely? Not that i want to right now but just want to know.
inc. wrote:
I always get a syntax error with the code above
Can't duplicate that.
At what line?
Just a syntax error or a more detailed error message?

Like it.....but how do you "un-install" it ?
http://pb-oop.origo.ethz.ch/wiki/uninstall
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Can you look in your "User/.../Temp/" Temp folder where the file "Pb_Editor_Output.pb" exists? Open it and watch if still "Class" is the first Keyword, if yes then no conversion has been done. Same does apply for the file "Pb_Editor_Output.pb" in case of japbe usage.

Does that syntax error has been throen by "PureBasic" or the OOP-Preprozessor (do look at the titlebar text of the error pupop).

And ..., are you shure your Plugin setup in the IDE or jaPBe is still activated?
Cause as already said 2 lines above ... seems the conversion hasnt been applied.

Greets
Inc.

I saw the site already about just disabling it in the tools, what i mean is how do you get rid of it completely?
Look at the site again where you can see the line where its mentioned that the only other install beside the binary has been applied to the Keywords-Highlightning of the specific Editor. So get into the prefs and just delete them. So a few klicks thats all.
Check out OOP support for PB here!
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Post by citystate »

I've run into an error with a fresh install of PB4.20 running this truly basic oop code

Code: Select all

Class test
  one()
  two()
EndClass

Procedure test.one()
  MessageRequester(""," 1")
EndProcedure

Procedure test.two()
  MessageRequester(""," 2")
EndProcedure

*me.test = NewObject test()
*me\one()
*me\two()
everything works fine provided the debugger is switched off. When I switch it on, I get an Assembler error:
  • Purebasic.asm [527];
    dd SM_I
    error: undefined symbol 'SM_I'.
does anyone else get the same result or is it just my crappy machine?
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

4.20 is not tested, so I can't give you support on this, but never had such an error message coming up, so maybe thats 4.20b based, don't know.
Check out OOP support for PB here!
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

citystate wrote:I've run into an error with a fresh install of PB4.20 running this truly basic oop code

snip

everything works fine provided the debugger is switched off. When I switch it on, I get an Assembler error:
  • Purebasic.asm [527];
    dd SM_I
    error: undefined symbol 'SM_I'.
does anyone else get the same result or is it just my crappy machine?
I get similar errors under 4.2 with debugger and NO oop.

cheers
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

I'm not an OOP-type person but I'm amazed by how polished and professional this looks.

Great job!
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Thanks for your kind words Xombie.
Check out OOP support for PB here!
Godai
Enthusiast
Enthusiast
Posts: 171
Joined: Thu Oct 05, 2006 8:13 pm

Post by Godai »

Hmm. Install seems to fail because I have no jaPBE installed? Setting it's path to empty apparently makes the installation complete, but examples fail and I can't see anything new in my PureBasic directory?!

Otherwise looks damn cool :)
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

yes, if you have no jaPBe installed, then you shouldn't set a path to it in the installer ... regarding your words: strange thing that the installer recognises a path to a jaPBe installation. Did you once installed and afterwards uninstalled jaPBe?

In the PureBasic directory there's nothing new as its a simple plugin.
This plugin has been saved to your user ApplicationData/PureBasic/ Folder.

Just follow the docs in the projectpage and do some tests in writing some OOP code.


In the next release I'll remove the Installer from the project as it seems that a few user systems do have messed up paths or whatever.
A simple manual safe of the plugin and setting up the tools confuguration dialog where the keywords also can be set up manually should be an easy task for everyone.
Check out OOP support for PB here!
Godai
Enthusiast
Enthusiast
Posts: 171
Joined: Thu Oct 05, 2006 8:13 pm

Post by Godai »

Works now. Debugger ASM error in newest beta, but thats a known issue I see.

My problem was that I did not save the file first. This works in normal PB, but the oop.exe came up asking for a file to parse :)
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

The ASM error is due that pointer in general also have to be type declared like *vt.l , ... its on my todo list and a new version including support of abstract classes and some other fixes will be released today.

regarding the up coming of the parser window requesting a file to parse.
In my PB installation I don't have to save the file first, thats only the case when I do use jaPBe, but anyhow I should replace the requester with a message window where it will be mentioned that the source has to be safed first.
Check out OOP support for PB here!
Post Reply