Opinions about ADW Modula

Started by Theo Gottwald, July 16, 2013, 11:20:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

Ok, you have tried ADW Modula?
You have tried PowerBasic, Oxygen Basic, PureBasic, VS and others?
Whats your opinion on ADW Modula?
Write it here!

Charles Pegge


I like the separation of declaratice and procedural code. But the Pascal syntax is a bit verbose, and I don't think modules are a sufficient substitute for OOP. Am I missing something?

Theo Gottwald


José Roca

There are only 50 Windows API files translated and very outdated. There is no way of use the latest technologies without doing an awful ton of previous work.

Debuggers are rarely used by those that write clean and reusable code. Can be useful to those that use globals "à go-go".

John Spikowski

QuoteDebuggers are rarely used by those that write clean and reusable code.

My universal debugger.

PRINT "Got Here"


Patrice Terrier

Once again, so exotic  ???

Why the heck are you torturing yourself  ::)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Theo Gottwald

Ok, so we got some opinions here!
Thats great.
I must admit that until now i was unable to compile ANY working piece of code.
But it was the same with WINDEV.
It would take me more time to switch from the PowerBasic Paradigma.
;D

John Spikowski

Theo,

If you're looking for advice in your post PB days, I would recommend mastering C first before looking at anything else. Python would be a good secondary language to have under your belt with BASIC to relax with after a long day at the office.


Patrice Terrier

#8
QuoteBut it was the same with WINDEV.

Theo

There is no comparison, one is years ahead of all you have used until now, and PC-Soft is a big company making lot of profits, thus they can hire some of the most talented C++ french programmers.
Their WLanguage is realy close to the PB syntax, and PowerBASIC DLL work like a charm with it.

It is even possible for a SDK programmer to write plain procedural code with it.
Here is an example


//+--------------------------------------------------------------------------+
//|                                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
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge

Pascal was an antidote to the unstructured languages of the 60s and 70s. I think most contemporary languages have assimilated Pascal structure and modularity concepts.

Theo Gottwald

MY current standpoint is that even if PowerBasic would not be improved anymore, that the current compiler together with all the fine things we have here from Jose etc. are all I need for most tasks.
If it comes to x64 then i have to think about what to do, and currently i use PureBasic as it seems to work and i already mastered some of the obstacles it has.
WINDEV would definitely be worth learning, but anytime when i think "now i have the money to buy it", i get a taxes Bill from Angela Merkel (who has to pay rich american banks and their owners with my money).

John Spikowski

#11
QuoteWINDEV would definitely be worth learning, but anytime when i think "now i have the money to buy it"



[Added for completeness TG]
QuoteReminder: WinDev Express is a "limited" version of WinDev. This version enables you to discover the main features of WinDev.
To check all the features of WinDev, some examples of "WinDev commercial version" are supplied with this trial version.
Main limitations of the Express version
The performance of the applications developed with the Express version as well as some processes of the editors may be slowed down.
Some objects handled by WinDev Express are prefixed by "EXPRESS".
A project created with "WinDev commercial version" cannot be opened by WinDev Express.
A project or an element created with WinDev Express can be opened by "WinDev commercial version". To use the project (or the elements) of the Express version without inopportune messages, the project (or the elements) must be saved in "WinDev commercial version". For the project, an upgrade of the project may also be required ("Project .. Other .. Upgrade the project").
WinDev Express does not allow you to import the projects developed with the earlier versions.
The Source Code Manager (SCM), used to share and manage the resources (source code, windows, reports, ... ) is not available.
WinDev Express cannot be used in network by several developers. Only a single-computer use is allowed.
Note: A project created with an earlier Express version (WinDev 15 Express for example) can be opened and handled by WinDev Express.

Limitations of the Express version

Laurence Jackson

Quote from: Charles Pegge on July 19, 2013, 10:42:43 AM
Pascal was an antidote to the unstructured languages of the 60s and 70s. I think most contemporary languages have assimilated Pascal structure and modularity concepts.
Very well put.

Richard Koch

#13
modual allows generic and oop - and all of that is better then anything that PB has to offer. i hope i don't sound to pessimistic on PB, but i gave up on it. i think, that currently there are only two choices in this order x86/x64:

1.) modula -> mature and proven, excellent small code - realy fast, true fast debugger, huge code libray with anything one would like to have - crypt ..., oop, generics, easy to convert code, minimal number of keywords ..
2.) the dlanguage - all of the above and plenty more, but not mature! maybe in a year due to bad optimization, win integration ...

Theo Gottwald

Richard, what do you think about Jose's comment:

Quotehere are only 50 Windows API files translated and very outdated. There is no way of use the latest technologies without doing an awful ton of previous work.

Why is that API stuff there so outdated?