How to Create a Hand Coded Project using the IDE?

Hello Everyone,

Using the Clarion IDE, in my case C11, how does one create a fresh, clean, hand coded project?

Once created, what is the proper way to compile it?

I’ve never done it and I’m interested in knowing more about it.

Thank you.

1 Like

Hi @donridley ,

It’s very easy :slight_smile:

Create a new solution using the Win32 EXE option

Then compile with this button:

Mark

4 Likes

Ah, that’s what I assumed but wanted to make sure.

Plus, I wanted this question documented for the future.

Thank you!!!

1 Like

I have what some call a “Scratch Program” to paste in as a framework for a quick start.

Below is the “lite” one.

Note it begins by calling the MAIN() procedure. One thing I like to do is always write code in a Procedure; otherwise, all the variables are Global / Static and not quite the same as typical.

    PROGRAM  !Scratch Lite program by Carl Barnes - Version 9/1/2022 - Download https://git.io/JtPKE
    INCLUDE('TplEqu.CLW')
    INCLUDE('KeyCodes.CLW')
    MAP
Main        PROCEDURE()
DB          PROCEDURE(STRING DebugMessage)
      MODULE('api')
        OutputDebugString(*CSTRING cMsg),PASCAL,DLL(1),RAW,NAME('OutputDebugStringA')
      END
    END
    CODE
    MAIN()
    RETURN
!----------------------------
Main   PROCEDURE

Window WINDOW('Scratch '),AT(,,400,200),CENTER,GRAY,IMM,SYSTEM,STATUS,FONT('Segoe UI',9),RESIZE
        BUTTON('Button1'),AT(155,180),USE(?Button1)
        BUTTON('Button2'),AT(206,180),USE(?Button2)
    END

    CODE
    OPEN(WINDOW)
    0{PROP:text}=clip(0{PROP:text}) &' - Library ' & system{PROP:LibVersion,2} &'.'& system{PROP:LibVersion,3}
    ACCEPT
        CASE EVENT()
        OF EVENT:OpenWindow 
        OF EVENT:CloseWindow
        OF EVENT:PreAlertKey
        OF EVENT:AlertKey
        OF EVENT:Timer
        END
        CASE ACCEPTED()
!        OF ?Button1
!        OF ?Button2
        END
        CASE FIELD()
!        OF ?Button1
!        OF ?Button2
        END
    END
    CLOSE(WINDOW)
   
!===============================
DB   PROCEDURE(STRING xMessage)
Prfx EQUATE('Scratch: ')
sz   CSTRING(SIZE(Prfx)+SIZE(xMessage)+1),AUTO
  CODE 
  sz  = Prfx & CLIP(xMessage)
  OutputDebugString( sz )

Below GIST link has a few more Scratch Programs. Like one with a LIST on the Window because sometimes you want to test some LIST code. Its a File:Queue loaded from a Directory() of the Windows Temp folder so it has data.


There’s also these scratch programs for writing Reports


There’s this one for generating a quick Scratch Program to write and test StringTheory code:

5 Likes

Great examples thank you carl…

The accept loop provides a low level control loop that higher wired GUI apps like Csharp dont seem to allow with out a higher degree of difficulty?

That control provided by the accept loop for automation control selection and macro development seems to be underappreciated…

In addition to what the others have posted, here is what you need to add to the project if you want to include ABC classes:

 ! Single EXE or Data DLL Exporting ABC Classes:
 !   _ABCDllMode_=>0;_ABCLinkMode_=>1
 !
 ! For DLL dependent EXEs and DLLs :
 !   _ABCDllMode_=>1;_ABCLinkMode_=>0

I put something like this in the headers of my .inc class files with whatever needs to be set for those classes if I need to whip up a quick project for testing or whatever.