# How to Create a Hand Coded Project using the IDE?

**URL:** <https://clarionhub.com/t/how-to-create-a-hand-coded-project-using-the-ide/7056>\
**Category:** questions\
**Tags:** handcode, ide\
**Created:** [March 26, 2024, 12:01pm UTC](https://clarionhub.com/t/how-to-create-a-hand-coded-project-using-the-ide/7056 "2024-03-26T12:01:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [March 27, 2024, 10:13pm UTC](https://clarionhub.com/t/how-to-create-a-hand-coded-project-using-the-ide/7056/4 "2024-03-27T22:13:39Z")

</div>

I have what some call a “[Scratch Program](https://devblogs.microsoft.com/oldnewthing/20050422-08/?p=35813)” 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.

```auto
    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.

> <https://gist.github.com/CarlTBarnes/87e1b615288409b86b7f7af4488e8dbd>

* * *

There’s also these scratch programs for writing Reports

> <https://gist.github.com/CarlTBarnes/29f78a2ca43813e83489dc62a4d5e0c0>
>
> There are more than three files. show original

* * *

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

> **[GitHub - CarlTBarnes/StringTheory-Tools: StringTheory tools BigBangTheory, Scratch Theory,...](https://github.com/CarlTBarnes/StringTheory-Tools?tab=readme-ov-file#Scratch-Theory)**
>
> StringTheory tools BigBangTheory, Scratch Theory, Split Theory and Write Theory to assist in writing, testing and debugging ST code. Similar Bang String class for non-ST.

---

_[View the full topic](https://clarionhub.com/t/how-to-create-a-hand-coded-project-using-the-ide/7056)._
