Who can make the longest Hello world program?

For everything that's not in any way related to PureBasic. General chat etc...
DriakTravo
Enthusiast
Enthusiast
Posts: 346
Joined: Fri Oct 10, 2003 12:42 am
Location: Tampa,FL,USA
Contact:

Who can make the longest Hello world program?

Post by DriakTravo »

Im bored, Who can make the longest, most complicated Hello world program?
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

I'll let you know next year when I'm finished writing it :lol:
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
DriakTravo
Enthusiast
Enthusiast
Posts: 346
Joined: Fri Oct 10, 2003 12:42 am
Location: Tampa,FL,USA
Contact:

Post by DriakTravo »

really? is it possible to make one that long?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it! proof it!
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

I guess this counts due to the un-necessary complexity of the frankinsteins monster that is the Win32 API! :twisted:

Code: Select all

;===========================================================================
;-PROCEDURES
;===========================================================================

;Window callback
Procedure WindowCallback(hWnd, Message, wParam, lParam) 
    Select Message
        Case #WM_CLOSE
            UnregisterClass_("WindowClass", GetModuleHandle_(#NULL))
            Destroywindow_(hWnd)
            ProcedureReturn 0
        Case #WM_DESTROY
            UnregisterClass_("WindowClass", GetModuleHandle_(#NULL))
            PostQuitMessage_(0)
            ProcedureReturn 0
        Case #WM_PAINT
            hDC.l = GetDC_(hWnd)
                GetClientRect_(hWnd, @WindowSize.RECT)
                hFont.l = CreateFont_(230, 22, 0, 0, #FW_BLACK, 0, 0, 0, #DEFAULT_CHARSET, #OUT_DEFAULT_PRECIS, #CLIP_DEFAULT_PRECIS , #PROOF_QUALITY, #DEFAULT_PITCH, "Times New Roman")
                SelectObject_(hDC, hFont)
                DrawText_(hDC, "Hello World", -1, @WindowSize, #DT_SINGLELINE | #DT_CENTER | #DT_VCENTER)
            ReleaseDC_(hWnd, hDC)
    EndSelect
    Result = DefWindowProc_(hWnd, Message, wParam, lParam) 
    ProcedureReturn Result
EndProcedure

;Window class
WindowClass.WNDCLASS
Classname.s = "WindowClass"
WindowClass\style = #CS_HREDRAW | #CS_VREDRAW
WindowClass\lpfnWndProc = @WindowCallback()
WindowClass\cbClsExtra = 0
WindowClass\cbWndExtra = 0
WindowClass\hInstance = GetModuleHandle_(#NULL)
WindowClass\hIcon = LoadIcon_(#NULL, #IDI_APPLICATION)
WindowClass\hCursor = LoadCursor_(#NULL, #IDC_ARROW)
WindowClass\hbrBackground = GetStockObject_(#WHITE_BRUSH)
WindowClass\lpszMenuName = #NULL
WindowClass\lpszClassName = @Classname
RegisterClass_(WindowClass)

;===========================================================================
;-GEOMETRY
;===========================================================================

;Calculate the window position to display it centrally
ScreenWidth.l = GetSystemMetrics_(#SM_CXSCREEN)
ScreenHeight.l = GetSystemMetrics_(#SM_CYSCREEN)
WindowWidth.l = 300
WindowHeight.l = 200
WindowXPosition.l = (ScreenWidth / 2) - (WindowWidth / 2)
WindowYPosition.l = (ScreenHeight/ 2) - (WindowHeight/ 2)

;Open a window 
hWnd.l = CreateWindowEx_(0, "WindowClass", "Hello World", #WS_VISIBLE | #WS_OVERLAPPEDWINDOW | #WS_SIZEBOX , WindowXPosition, WindowYPosition, WindowWidth, WindowHeight, 0, 0, GetModuleHandle_(#NULL), 0) 

;===========================================================================
;-MAIN LOOP
;===========================================================================

If hWnd
    While Getmessage_(Message.MSG, 0, 0, 0)
        TranslateMessage_(Message)
        DispatchMessage_(Message)
    Wend
EndIf
--Kale

Image
Post Reply