Are you guys sticking with PowerBASIC?

Started by Paul Squires, August 17, 2015, 10:53:19 PM

Previous topic - Next topic

David Kenny

Paul,

Sorry, I misread the portion of your post that I based my post on.  :P

I was thinking you meant it had an "immediate" window.  Where you could do "Design Time Expression Evaluation". :)

Eddy Van Esch

#46
Quote from: Patrice Terrier on September 03, 2015, 06:45:03 PM
I know a real alternative to PB, but it is not Free ;)
It doesn't have to be free, it just mustn't be C ...  (say this out loud and you will get the reason for my bold) ;D

And open source is different from commercial (closed) code ...
There is always a chance that someone is willing to pick up the thread where another left off...
Eddy

Paul Squires

Quote from: Eddy Van Esch on September 03, 2015, 07:03:40 PM
There is always a chance that someone is willing to pick up the thread where another left off...

And that is exactly what happened with FreeBASIC. dkl is now the primary coder but there are several other people heavily involved as well behind the scenes. PB was a one man show. FB is not. The FreeBASIC compiler is built using FreeBASIC. I would venture to guess that the code is a hell of a lot easier to pick up and maintain than Bob's million lines of assembly language. Even I can understand FB's code.




Paul Squires
PlanetSquires Software

Patrice Terrier

Eddy--

QuoteIt doesn't have to be free, it just mustn't be C ...  (say this out loud and you will get the reason for my bold) ;D

The one i am thinking about, is using a BASIC like syntax very close to PB's, here is a small example easy to understand:
PROCEDURE BassSyncPos(LOCAL nPos is 8-byte int)
K is int
IF BTN_Pause..Visible THEN BassStreamPause() // 09-28-2010
IF gnFlyer THEN
    IF gnFlyerID THEN BASS_ChannelSetPosition(gnFlyerID, nPos, 0)
ELSE
    FOR K = 1 TO MAXCHANNEL - 1
        IF gnChannel[K].ID  THEN
            BASS_ChannelSetPosition(gnChannel[K].ID, nPos, 0)
        END
    END
    nOutMixer is int = ZSL_GetBassOutMixer(); IF nOutMixer THEN BASS_Mixer_ChannelSetPosition(nOutMixer, nPos, 0)
END
IF BTN_Pause..Visible THEN BassStreamResume() // 09-28-2010

Eddy Van Esch

hi Patrice,

Well that code looks pretty "BASIC'ish". No need to be embarrased. You are among friends. Just tell us what compiler that is ...
Oh, and you can tell us other (personal) secrets too if you like ... We like to gossip ...  ;D   :o
just kidding .... don't want to scare you ....  ;)
Eddy

James Fuller


Eddy Van Esch

Quote from: James Fuller on September 04, 2015, 06:24:52 PM
I believe it's this:
http://www.windev.com/
And if their main developer jumps under a train we are still in business ..?  ;D
Eddy

Patrice Terrier

890 â,¬ when you buy it in concurent mode, you just have to give them a proof that you are using another compiler.

For me the word pricey, means nothing until you know all what you can do with it.
So easy to create a mockup, you just have to drag controls on the form(s), but you can also program in low level SDK mode if you want to, including something like this:

//+--------------------------------------------------------------------------+
//|                                GoldFish                                  |
//|                                                                          |
//|                   Example of 32-bit layered animation                    |
//|                                                                          |
//| This is a SDK FLAT API transposition of a C# project written by Davidwu  |
//|                            www.cnpopsoft.com                             |
//|                                                                          |
//+--------------------------------------------------------------------------+
//|                                                                          |
//|                         Author Patrice TERRIER                           |
//|                            copyright(c) 2008                             |
//|                           www.zapsolution.com                            |
//|                        pterrier@zapsolution.com                          |
//|                                                                          |
//+--------------------------------------------------------------------------+
//|                  Project started on : 09-23-2008 (MM-DD-YYYY)            |
//|                        Last revised : 09-23-2008 (MM-DD-YYYY)            |
//+--------------------------------------------------------------------------+

CONSTANT
  MAX_PATH             = 260
  ERROR_ALREADY_EXISTS = 183
  AC_SRC_OVER          = 0x00
  AC_SRC_ALPHA         = 0x01
  SW_SHOW              = 5
  SW_RESTORE           = 9
  WM_DESTROY           = 0x0002
  WM_NCHITTEST         = 0x0084
  WM_KEYDOWN           = 0x0100
  WM_TIMER             = 0x0113
  HTCAPTION            = 2
  WS_POPUP             = 0x80000000
  WS_EX_TOPMOST        = 0x00000008
  WS_EX_LAYERED        = 0x00080000
  CS_VREDRAW           = 0x0001
  CS_HREDRAW           = 0x0002
  CS_DBLCLKS           = 0x0008
  PM_REMOVE            = 0x0001
  ULW_ALPHA            = 0x00000002
  SM_CXSCREEN          = 0
  SM_CYSCREEN          = 1
  IDC_ARROW            = 32512
 
  GDI32                = "GDI32"
  USER32               = "USER32"
  GDIPLUS              = "GDIPLUS"
  GDIMAGE              = "GDIMAGE"
END

POINTAPI is structure
  x is int   // long x
  y is int   // long y
END

SIZEL is structure
  cx is int   // long x
  cy is int   // long y
END

RECT is structure
  nLeft   is int   // long Left
  nTop    is int   // long top
  nRight  is int   // long Right
  nBottom is int   // long bottom
END

SECURITY_ATTRIBUTES is structure
  nLength              is int   // DWORD nLength
  lpSecurityDescriptor is int   // LPVOID lpSecurityDescriptor
  bInheritHandle       is int   // BOOL bInheritHandle
END

TagMSG is structure
  hWnd    is int      // HWND hwnd
  nMessage is int     // UINT Message
  wParam  is int      // WPARAM wParam
  lParam  is int      // LPARAM lParam
  nTime    is int     // DWORD time
  pt       is POINTAPI  // POINT pt
END

BITMAP is structure
  bmType       is int     //Type C : LONG
  bmWidth      is int     //Type C : LONG
  bmHeight     is int     //Type C : LONG
  bmWidthBytes is int     //Type C : LONG
  bmPlanes     is 2-byte int  //Type C : WORD
  bmBitsPixel  is 2-byte int  //Type C : WORD
  bmBits       is int     //Type C : LPVOID
END

BLENDFUNCTION is structure
  BlendOp             is 1-byte int
  BlendFlags          is 1-byte int
  SourceConstantAlpha is 1-byte int
  AlphaFormat         is 1-byte int
END

WNDCLASSEXA is structure
  cbSize        is unsigned int //Type C : UINT
  style         is unsigned int //Type C : UINT
  lpfnWndProc   is int      //Type C : WNDPROC
  cbClsExtra    is int      //Type C : int
  cbWndExtra    is int      //Type C : int
  hInstance     is int      //Type C : HINSTANCE
  hIcon         is int      //Type C : HICON
  hCursor       is int      //Type C : HCURSOR
  hbrBackground is int      //Type C : HBRUSH
  lpszMenuName  is int      //Type C : LPCSTR
  lpszClassName is int      //Type C : LPCSTR
  hIconSm       is int      //Type C : HICON
END

BITMAPINFOHEADER is structure
  biSize          is int
  biWidth         is int
  biHeight        is int
  biPlanes        is 2-byte int
  biBitCount      is 2-byte int
  biCompression   is int
  biSizeImage     is int
  biXPelsPerMeter is int
  biYPelsPerMeter is int
  biClrUsed       is int
  biClrImportant  is int
END

RGBQUAD is structure
  bBlue     is 1-byte int
  bGreen    is 1-byte int
  bRed      is 1-byte int
  bReserved is 1-byte int
END

BITMAPINFO_API is structure
  bmiHeader is BITMAPINFOHEADER //BITMAPINFOHEADER est une autre structure
  bmiColors is RGBQUAD      //RGBQUAD est une autre structure
END

GdiplusStartupInput is structure
  GdiplusVersion is int             // Must be 1
  DebugEventCallback is int         // Ignored on free builds
  SuppressBackgroundThread is int   // False unless you//re prepared TO call
  SuppressExternalCodecs is int     // False unless you want GDI+ only TO Use
END

gnToTheRight, gnFrame are int //  To store SetImage static values

gsIMAGE_FullPathName is string = CompleteDir(fExeDir()) + "GoldFish.png"
gnFRAME_SizeX is int = 84 // Must match the animation frame width
gnFRAME_SizeY is int = 84 // Must match the animation frame height
gnFRAME_Count is int = 20 // The frame number
gnUSE_StepX   is int = 3  // X step value in pixel
gnUSE_StepY   is int = 1  // Y step value in pixel

LOCAL
IF LoadDLL(GDIMAGE) THEN

  // The WinMain section
 
  nRet, x, y are int
  wc is WNDCLASSEXA
  zClass is string ASCIIZ on 16 = "ZANIMATION"
  wcStyle is int = CS_HREDRAW + CS_VREDRAW
  IsInitialized is int = API(USER32, "GetClassInfoExA", Instance, &zClass, &wc)
  IF IsInitialized = 0 THEN
    wc.cbSize        = Dimension(wc)
    wc.style         = wcStyle
    wc.lpfnWndProc   = &WndProc
    wc.cbClsExtra    = 0
    wc.cbWndExtra    = 0 // Extend_cbWndExtra * 4
    wc.hInstance     = Instance
    wc.hIcon         = API(USER32, "LoadImageA", Null, "GoldFish.ico", 1, 0, 0, 0x00000010 + 0x00000040)
    wc.hCursor       = API(USER32, "LoadCursorA", Null, IDC_ARROW)
    wc.hbrBackground = Null
    wc.lpszMenuName  = Null
    wc.lpszClassName = &zClass
    wc.hIconSm       = Null
    IF API(USER32, "RegisterClassExA", &wc) THEN IsInitialized = True
  END
 
  IF IsInitialized THEN
    x = Max((API(USER32, "GetSystemMetrics", SM_CXSCREEN) - gnFRAME_SizeX) / 2, 0)
    y = Max((API(USER32, "GetSystemMetrics", SM_CYSCREEN) - gnFRAME_SizeY) / 2, 0)
   
    hMain is int = API(USER32, "CreateWindowExA",   
    WS_EX_LAYERED,            // SDK extended style
    zClass,                   // Set this one to your default path name
    "GoldFish",               // Caption
    WS_POPUP + WS_EX_TOPMOST, // SDK style
    x,                        // X location
    y,                        // Y location
    gnFRAME_SizeX,            // Control width
    gnFRAME_SizeY,            // Control height
    Null,                     // Parent handle
    0,                        // Control ID
    Instance,                 // Instance
    0)
   
    IF hMain THEN
     
      Msg is TagMSG
      SetImage(hMain, gsIMAGE_FullPathName, 255)
      API(USER32,"ShowWindow", hMain, SW_SHOW)
     
      IF gnFRAME_Count > 1 THEN API(USER32, "SetTimer", hMain, 1, 50, Null)
      WHILE API(USER32, "GetMessageA", &Msg, Null, 0, 0)
        API(USER32, "TranslateMessage", &Msg)
        API(USER32, "DispatchMessageA", &Msg)
      END
      IF gnFRAME_Count > 1 THEN API(USER32,"KillTimer", hMain, 1)
     
      nRet = Msg:wParam   
     
    END
   
  END
 
END


And you can intermix it with any 32-bit or 64-bit DLL(s) written in PB or C++.

See the attached screen shot of the latest application (ProBand) i wrote with WinDev for a music company in the UK.

You can learn more about ProBand from this link:
http://svc.flyworship.com/WD190AWP/WD190Awp.exe/CONNECT/ProBand
The web site should be completed and fully operationnal by the end of september.

And here is a link to a 64-bit application i wrote with WinDev and GDImage,
http://www.zapsolution.com/preview/Accordion64.zip
that will show you why WinDev could become your best friend...



Patrice Terrier

Forget to say that the ProBand web site is also written in WinDev, as well as the back office and paypal secure payment, go figure.  8)

Eddy Van Esch

Patrice,
I am always open to new suggestions.
Why in particular should we consider WinDev before FF/FB?
Does it have a Visual Designer that can compete with FF?
How about string handling functions?
Enquiring minds want to know ...  Dooohhhhh!!!!! I didn't want to say that !!!  ;)
Eddy

Patrice Terrier

#55
Eddy

Their visual designer takes its origine into PC-Soft HIGH SCREEN that was created 25 years ago in DOS days (for me it is just years light ahead of everything else, once you get familiar with it).

When i need to write a small 32-bit DLL, then i keep using PowerBASIC.
When i need to write 32/64-bit DLL(s) then i am using Visual Studio C++.
When i need to write visual applications with hundred of child controls then i am using WinDev.

String handling is a breeze: string, unicode, asciiz, html.
Example:
nInt32 is int = 32
nInt64 is system int = 64
sString is string = "WinDev can produce " + nInt32 + " or " + NumToString(nInt64) + "-bit code"

but you can also write:
sString is string = "WinDev can produce "
sString += NumToString(nInt32) + " or " + NumToString(nInt64)
sString = sString + "-bit code"

Note: Because WinDev is p-code (like .NET), it couldn't be used to produce native DLL.

...


Anand Kumar

I have moved to WinDev from the beginning of this year.  I have lots of code written in PB but I don't think that I will migrate any of it.  They have served their purpose and its time to look at a completely different field of application. 

Best Regards
An&

Patrice Terrier

#57
Anand--

The main problem with WinDev (for people coming from PB, or SDK coders) is the learning curve.
At first, after 2 weeks using it, i was close to give up, because it was so different to what i was accustomed to.

And indeed it tooks me 3 monthes to master the beast, but now i can do in only one week, things that would have taken me monthes to write in PB or C++.

The ease of creating a complex GUI window form is unbelievable, and i can concentrate my SDK expertise to speed up the code, or to work around the existing bugs (because WinDev, like most languages, is not 100% bug free).

The debug facilities are also just amazing, compared to everything else i have used. And my zTrace utility, has been modeled on the WD built-in TRACE function.

In the long run, the hability to reuse large blocs of code, helps me to further reduce the development cycle.

...




Anand Kumar

Patrice,

I don't find the change to be a big problem.  It is a necessity considering the multi platform needs that I am encountering for the past couple of years. 

My company expects my software to work in Windows (32/64), Linux, Mac, iPhone, iPad, Windows Phone, Windows Tablet, Android Phone/Tablet, Regular web, Mobile web and in my organization's private Cloud. 

It is also increasingly getting difficult to get resources to develop software in all these platforms.  We had a requirement from a client for a iPad based solution and by the time the solution was built and delivered, the client switched to Surface Pro making our solution completely useless. 

I know that WinDev will open up new avenues for us.  I am used to the Visual Studio environment so I didn't find it too complicated to switch.  It is indeed a new learning exercise but I think that considering the ROI, it is necessary. 

An&

Patrice Terrier

#59
Anand--

I am confident that you have selected the right tool, especially if you want to target all the platforms you have enumerated. For professional it is a real time saver, and we should all know that time is money, except for the hobyists. ;)

And because you are also a C++ programmer, let me say that the core WinDev API is written with it, so no risk of dead end, like with PB.

Does you, as a scientist, and Anand Ar (working in the Tata Research Development & Design Centre) are the same person?

...