# Writefile API inside same procedure

**URL:** <https://clarionhub.com/t/writefile-api-inside-same-procedure/7967>\
**Category:** questions\
**Tags:** winapi\
**Created:** [February 28, 2025, 11:02am UTC](https://clarionhub.com/t/writefile-api-inside-same-procedure/7967 "2025-02-28T11:02:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![vitesse](https://clarionhub.com/user_avatar/clarionhub.com/vitesse/32/837_2.png) [@vitesse](https://clarionhub.com/u/vitesse)\
**Post date:** [February 28, 2025, 11:38pm UTC](https://clarionhub.com/t/writefile-api-inside-same-procedure/7967/4 "2025-02-28T23:38:50Z")

</div>

> [@Daniel1](#):
>
> but I don’t know how to write result to stdOut

two thoughts:

1. have a look at this thread and use -11 for STD\_OUTPUT\_HANDLE

> [@Using WriteConsoleA from a Clarion application](https://clarionhub.com/t/using-writeconsolea-from-a-clarion-application/1734):
>
> Today I was inspired to respond to a [StackOverflow question](https://stackoverflow.com/questions/49221612/generate-output-to-commandline) and pulled this example together from pieces I found on the newsgroup slight_smile Compile the program, run it from a command line and mash the button! PROGRAM HANDLE EQUATE(UNSIGNED) DWORD EQUATE(ULONG) BOOL EQUATE(BYTE) VOID EQUATE(LONG) LPVOID EQUATE(ULONG) LPDWORD EQUATE(ULONG) ATTACH\_PARENT\_PROCESS EQUATE(-1) STD\_OUTPUT\_HANDLE EQUATE(-11) MAP MODULE('API') AttachConsole(DWORD dw…

or

1. consider using OddJob

[https://www.capesoft.com/accessories/OddJobsp.htm](https://www.capesoft.com/accessories/OddJobsp.htm)

“Provides the ability to write data to a process’ StdIn, and read from the StdOut - allowing communication with command line processes such as servers, compilers, script interpreters (such as PHP, Python and so on), etc.”

---

_[View the full topic](https://clarionhub.com/t/writefile-api-inside-same-procedure/7967)._
