- [CPC] Standard In , Standard Out and all theother I/O stuff

From: L <"L">
Date: Fri, 13 Jul 2007 23:40:55 -0700

----boundary-LibPST-iamunique-1050172872_-_-
Content-type: text/plain

> Various other compilers are sometimes recommended. Whatever the merits
> of particular compilers, it's truly unfortunate if one has to change
> to Zonnon for .NET or FPC to read a keystroke or display a character,
> BB to create a native-code graphic Windows application, maybe something
> else for Linux or Mac, and back to BB to use .DLLs from another language.
> The problem, of course, is that every one of these is a different
> language. This fragmentation can limit the usefulness of all these
> languages.

Well Freepascal supports bsd/linux/win32/Mac and offers consistent language
throughout the tools and the operating systems it supports. It even supports
Delphi code and turbo pascal code.. meaning that one can take a delphi source
file or turbo pascal source file and compile it in the compiler.

The problem I have with fpc/delphi is that some of the developers are smoking
certain drugs that cause them to think everything should be one giant monolithic
EXE, and others are taking LSD which causes them to think that Classes are a
gospel/religion/bible that we should follow. Component pascal developers, seem
to be intelligent folks, on the other hand. FPC is still powerful, and I will
always use it, even if they are on drugs (they are from Netherlands) but my
point is that I'm also heavily interested in Oberon and component Pascal too.
I've been reading some articles and it is like you folks are reading my minds..
for example just finished reading one of Wojtek's PDF files, and just finished
reading some statement in the documentation saying "classes are not gospel
religion that we should follow". Again, it is like you folks are reading my
mind. That is why, I'm not just going to use FPC.. because Oberon/component
pascal peaks my interest.


> So, just in case someone has the urge to write an I/O module, does anyone
> know anything about what is involved? For example, Lars, you said you

> wrote one for FPC from the winapi. Is that code relevant and available?

Looking at the stdout code I toyed with months ago for FPC, it seems that it
really isn't that hard to wrap the winAPI stdout routines into a very simple
component pascal function that accepts a string as a parameter. This isn't so
much the problem.. the problem is that BlackBox itself isn't really capable at
this point of utilizing stdout, because from what I remember reading, it
requires hex editing the Exe in order to launch DevLinked exe's as a console
mode app? Is this still applicable in 1.6? But still, this isn't the end of the
world. It's not as if it can't be worked on and patched.

One thing we (cgi developers) came across when toying with the stdout for
freepascal was that the MSDN/Microsoft win api documentation has a bug/issue in
it. While doing CGI programming, we came across an issue with regards to how
much of a buffer the winapi stdout routines will accept. It is only 32000 or
65000 from what I remember, and to be extra cautious it is wise to build the
stdout functions so that they prevent a buffer bigger than 32000 being sent in
to the winapi function. The issue was the MSDN docs stated something wrong or
incorrect.. or they didn't state anything at all. I confirmed this by finding an
Apache developer who had the same issue.. he tried to send in a buffer and it
got truncated, and he wondered why since the docs didn't say it would get
truncated at that amount. Just FYI so when we implement the routines for
blackbox, we don't end up with these problems.

Also, I tried launching the blackbox exe from the command line and my command
line just launches blackbox and the prompt exits, while blackbox stays open..
i.e. the command line window doesn't hold its state, it seems to launch blackbox
as if it was forking it separately and then killing the command line. The
problem is, that existing DLL's don't write anything to STDOUT if I load them
into blackbox. I just read an old mailing list post from Wojtek many months ago
and he said he was having issues with a C library that was trying to write to
STDOUt when he loaded it into blackbox. Someone suggested that blackbox.exe be
launched from the command line. When I launch it from the command line.. well
like I said the prompt just exits and blackbox exe runs fine.. but the command
line doesn't hold its state. Wojtek.. what did you end up finding out, with
regards to your C dll's trying gain access to stdout once loaded into the BB
ide?

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy

----boundary-LibPST-iamunique-1050172872_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwID4gVmFyaW91cyBvdGhlciBjb21waWxlcnMgYXJ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