• Welcome to Theos PowerBasic Museum 2017.

News:

Attachments are only available to registered users.
Please register using your full, real name.

Main Menu

Recent posts

#21
C++ WinLIFT / GDImage / MediaBox video
Last post by Patrice Terrier - July 30, 2017, 07:31:08 PM
You can download a video presentation of MediaBox from the link below
MBox64.mp4

Note: Microsoft Edge allows you to see the video in streaming mode without downloading it first.
#22
MovieBox / Re: MovieBox 2.61
Last post by Patrice Terrier - July 29, 2017, 06:13:19 PM
To solve the zip memory corruption that occured in post #14 from this thread.
The MCI version has been moved here:
http://www.objreader.com/index.php?topic=112.0
#23
General Discussion / Re: I realize this may be be a...
Last post by John Strasser - July 19, 2017, 01:40:25 AM
Thanks Jose. I'll try again when I get home. It might be an issue on my office computer
#24
General Discussion / Re: I realize this may be be a...
Last post by José Roca - July 19, 2017, 01:24:12 AM
The forums are there: https://forum.powerbasic.com/

Maybe you're using a differen address. It was changed to use https instead of http.
#25
General Discussion / I realize this may be be a dum...
Last post by John Strasser - July 19, 2017, 01:02:29 AM
Hi Folks,

as the subject says. . .

Whilst my programming hours have been few and far between lately my interest in PB hasn't waned. I see the website is still there, and the store.

But I can't get to the forums (surprise  ???). Are they still around?

Thanks for the help,

JS
#26
General Discussion / Re: What would be best C++ IDE...
Last post by Paul Breen - July 14, 2017, 09:03:55 PM
C++ Builder by Embarcadero is free now for the starter edition, used to be about $240. With this you get the famous VCL library made famous by delphi. For desktop apps this frequently cited as the best library for windows. The new compiler is llvm based, not the old borland compiler anymore. Starter is limited to 32 bits but probably not a problem for a beginner. Microsoft makes the best compiler for windows but it may not be the best for you. See the videos on youtube to help you make up your mind. I prefer the RAD Studio IDE myself, in Delphi mode. If you are a student, get the RAD Studio professional, it is a steal even if you do have to pay about $130 for it. Sure, visual studio is free, but it is free for everybody, so why do people who make their living writing programs pay for other tools? As an extra benefit, your soul will not burn on the lake of fire for all eternity as punishment for joining the dark side. Try them both and see which one you like better.
#27
Discussion / Re: String::Remove(const TCHAR...
Last post by Frederick J. Harris - June 30, 2017, 09:19:50 PM
I think I just did a fairly extensive job of testing for memory leaks and I'm not finding any.  Actually, the version where the return from the Remove is being assigned to itself yields the least amount of code overhead.  Here's the results of a sample run...


// Main.cpp
// cl Main.cpp Strings.cpp /O1 /Os /GR- /GS- TCLib.lib kernel32.lib user32.lib
// 4,608 Bytes VC15 (VStudio 2008); x64; UNICODE
#ifndef UNICODE
   #define   UNICODE
#endif
#ifndef _UNICODE
   #define   _UNICODE
#endif
#include <windows.h>
#include "stdio.h"
#include "Strings.h"

int main()
{
String s1(L"one  , two,     three,  four     ");  // 840
 
s1=s1.Remove(L" ");                               // 952
s1.Print(true);
getchar();

return 0;
}

/*
Entering String::String(const TCHAR* pStr) Constructor!
  this->lpBuffer = 1739840
Leaving String::String(const TCHAR* pStr) Constructor!

Entering String String::Remove(const TCHAR* pStr)
  this->lpBuffer   = 1739840
  Entering String::String(const size_t iSize, bool blnFillNulls)
    this->lpBuffer = 1739952
  Leaving String::String(const size_t iSize, bool blnFillNulls)
Leaving String String::Remove(const TCHAR* pStr)

Entering String& String::operator=(const String& strAnother)
  strAnother.lpBuffer = 1739952
  this->lpBuffer      = 1739840
  this->lpBuffer      = 1739840
Leaving String& String::operator=(const String& strAnother)

Entering String Destructor!
  this->lpBuffer = 1739952
  this->lpBuffer = one,two,three,four
Leaving String Destructor!

one,two,three,four

Entering String Destructor!
  this->lpBuffer = 1739840
  this->lpBuffer = one,two,three,four
Leaving String Destructor!

840  deleted
952  deleted
*/

#28
Discussion / Re: String::Remove(const TCHAR...
Last post by James C. Fuller - June 30, 2017, 06:20:42 PM
Fred,
  bc9 has both function and statement string procedures for a couple of it's calls.

------------------------------------------------------------------------------
SubStr$ = Remove$(Main$,Match$)
Remove Match$ FROM Main$
------------------------------------------------------------------------------
SubStr$ = Replace$(Main$,Match$,Change$)
Replace Match$ WITH Change$ IN Main$
------------------------------------------------------------------------------


but all the rest do not modify the Main$ and return a new string.


James
#29
Discussion / Re: String::Remove(const TCHAR...
Last post by Frederick J. Harris - June 30, 2017, 04:00:36 PM
I'll do some debug console output on that later today Jim just to make sure, but my guess is that it'll be OK.  If it isn't crashing anywhere then the only concern would be memory leaks, so that's what I'll be looking for.  Good idea, by the way.  I hadn't thought of that.

Originally when I first wrote my string class years ago I had it that the original object was modified, then in one of the apps where I was using the string class I ran into an issue where I kept needing the original unmodified string.  It was at that point it occurred to me I should perhaps modify the method to return a modified string, rather than altering the original string.  I suppose it could be argued either way.  Or do you think my original thought of modifying the original string is best?

That issue served as a lesson to me though in that in all my further work on the String Class I always gave a thought to whether I want to modify the original String (this) or leave it be and create/return the altered one.
#30
Discussion / Re: String::Remove(const TCHAR...
Last post by James C. Fuller - June 29, 2017, 04:50:41 PM
Patrice,
  Pretty cool.
I have all the [w]char routines built into bc9 but I prefer Fred's string class because I can do this without the overhead of the circular buffer used for returns of character strings in bc9.
James


fstring GetHello ()
{
    fstring  fsHello(_T("Hello There!"));
    return fsHello;
}

int _tmain ()
{
    fstring  fs = {0};
    fs = GetHello();
    fs.Print( true);
}