1. Hello All!

Hello All!

I've been one of those "eavesdroppers" on the list for quite a while, and
after great angst concerning my inability to speak to large crowds, I'm going
for it!  My participation may be little spotty, as I'm in the process of
moving to Amarillo, Texas, but I'll join whenever I can.

As far as where my programming knowledge base lies ... well, you are reading
the words of a time traveler!  I've been away from computers for about 10
years, and while I've done a lot of catching up, I'm still way back there,
especially when it comes to windows.  And I must say that you folks have been
responsible for much of the "getting modern" I have done over that past four
or five months.

One small comment I would like to make, for what it's worth.  There has been
some dissension as of late about the "fights" that happen on the list, and
indeed about folks slamming Euphoria on a Euphoria mailing list.  I suggest
that these "fights" are probably the best thing that can happen for Euphoria,
because it provides proof that the language is growing.  It may be getting
stretch marks here and there, and Mr. Craig may not want his favorite son to
grow up too fast, but it is growing nevertheless.  Take for instance this
argument about "namespaces."  Now then, to prove my backwaterness, I must
confess that I have no clue what a "namespace" is, other than the little box
on the sticker that reads "My name is ..."  But the carrying on about
namespaces has assured, even if it is not currently evident, that namespaces
will be addressed at some point in the future, and dealt with as the majority
demands.  I would hope that such discussion, even if it does get momentarily
bitter, is never shunned, because that would be very detrimental to
Euphoria's cause.  And, to be completely honest, much of what I've learned
about the programming world of 2000 I've gleaned from the information shot
around in such "heated discussions."

Soon I'll be going to school to re-learn the art of programming, and I hope
that Euphoria will be mainstreamed by then, yet not lose those
characteristics which make it such an incredibly useful language, especially
for time-warped types such as yours truly.

Alright, there's my blurb.  Currently I am working on two projects:  a
database for a homeless shelter here in town, as well as an IDE for Euphoria,
a monumental task to say the least.  The IDE has taken the back burner here
for a bit, as I need to get the database finished before I leave, as a gift
to the shelter's manager for the help they gave me a few years back.

My question is:  when printing from an MLE using Mr. Cuny's win32lib.ew, what
should I end each "string" with in order to get the printer to perform a line
feed?  I've tried several combinations of \r\n, but without success.  I have
e-mailed Mr. Cuny; however, because my Internet skills are very shaky, that
letter may have ended up with a Mr. Cuny in Paraguay!  I am using an IBM
Proprinter II at the moment.  If one of you fine ladies and gentlemen could
answer this infantile question for me, it would truly be appreciated.

Finally, since my machine isn't technically "hooked up" to the Internet, I
must use the facilities at the public library.  Therefore, my responses may
take a day or two, but rest assured I will write back.

Once again, thank you all for aiding in my education.  I look forward to
participating as much as my knowledge will allow.


God Bless and Blessed Be,






Travis Beaty
King of the Castle and Lord of the Lair,
and he's got his wife's permission to say
so ...

______________________________________________________
Get your free web-based email at http://www.xoom.com
Birthday? Anniversary? Send FREE animated greeting
cards for any occasion at http://greetings.xoom.com

new topic     » topic index » view message » categorize

2. Re: Hello All!

Travis Beaty wrote:

> when printing from an MLE using Mr. Cuny's win32lib.ew,
> what should I end each "string" with in order to get the
> printer to perform a line feed?

No, that's the wrong approach. Imagine that the printer is a bitmap: you
have to position the string on the page at a specific location. Take a look
at how GENERIC.EXW works. The untested code I've hacked together should give
you some idea how it works.

Hope this helps!

-- David Cuny

  integer charsPerLine, linesPerPage
  sequence fontSize, printerSize


  if getPrinter() then
    -- pick a fixed width font
    setFont( Printer, "Courier New", 10, Normal )

    -- get the font metrics
    fontSize = getFontSize( Printer )

    -- get the size of a printer page
    printerSize = getExtent( Printer )

    -- how many characters can fit on a line?
    charsPerLine = floor(printerSize[1]/fontSize[1])

    -- how many lines can fit on a page?
    linesPerPage = floor(printerSize[2]/fontSize[2])

    -- start up the document
    if startDoc( "My Print Job" ) then

      -- top of page
      line = 0

      -- print until text is empty
      while length( text ) do

        -- get a line of text
        if length( text ) < charsPerLine then
            -- get remaining text
            lineOfText = text
            text = ""

        else
            -- get one line of text
            lineOfText = text[1..charsPerLine]

            -- remove from remaining text
            text = text[charsPerLine+1..length(text)]

        end if

        -- position text on page
        setPosition( Printer, 0, line*fontSize[2] )

        -- write the text
        wPuts( Printer, lineOfText )

        -- move down one line
        line += 1

        -- at bottom of page?
        if line > linesPerPage then
          -- print page
          if not endPage() then
            exit
          end if

          -- start a new page
          if not startPage() then
            exit
          end if

          -- reset counter
          line = 0

        end if

      end while

    end if

    -- end of document
    endDoc()

    -- release the printer
    releasePrinter()

  end if

new topic     » goto parent     » topic index » view message » categorize

3. Hello All!

Hello All!

I am working on a Euphoria IDE and I was
wondering if I could get your help with a couple
of menial problems.

The first involves printing to the printer using
win32lib.ew.  I have an older dot-matrix printer
(IBM Proprinter II).  The goal is to get the
information out of an MleEdit and sent it to this
printer.  When I try this using wPuts(), the
printer appears to "misinterpret" the \r\n
and "prints" them as small rectangular boxes.  I
have tried quite a few combinations of \r and/or
\n, and none of them seem to work, yet the
printer works just fine with say, Microsoft Word,
for instance.  Any ideas?  This is driving me up
the wall ...

The second question involves the maximum capacity
of the MleEdit.  From some of the literature I've
read, I got the impression that the MleEdit's
max. capacity was 32k.  However, I'm having
problems with the Mle in my program when it gets
to 29k.  This is how I'm calculating the size of
what's in the Mle in k:

AmountK = floor(length(getText(mleTextEditor)) /
1024)

Using this formula, the MleEdit appears to "lock
up" around 29k, at which point it will not allow
you to put in any additional information.  Is the
math wrong?  What is the capacity of an Mle in
bytes?

Thank you,


Travis Beaty
Claude, Texas

Travis Beaty
Claude, Texas


"The man who grabs the cat by the tail
learns 44% faster than the person who
stands back and watches." -- Mark Twain

______________________________________________________
Get your free web-based email at http://www.xoom.com
Birthday? Anniversary? Send FREE animated greeting
cards for any occasion at http://greetings.xoom.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: Hello All!

Travis Beaty wrote:

> The goal is to get the information out
> of an MleEdit and sent it to this printer.

Take a look at GENERIC.EXW; it does exactly what you are describing.

> When I try this using wPuts(), the printer
> appears to "misinterpret" the \r\n and "prints"
> them as small rectangular boxes.

The character you are getting is a 'nonexistant in font' character. The
process of printing on a printer is the same as printing text into a window.
You can't use \n or \r; you have to format the text yourself. That means:

 - breaking the text into '\n' delimited paragraphs
 - removing the non-printing '\n' characters
 - breaking the paragraphs into page-wide lines
 - placing the lines on the page

Obviously, you need to know the size of the page and the size of the font to
determine how much text can fit on a page.

You can use getSize() to determine the size of the page.

If you are using a fixed width font, you can use getFontSize to find the
width and height of the font. If you are using a variable width font, you'll
have to use getTextExtent to find the width of a string. In that case, it
might be cheapest to build a lookup table of the character widths.


> The second question involves the maximum
> capacity of the MleEdit.

I was under the impression that the maximum is 32K, but I can't confirm it.
If you are empirically measuring 29K, you must be right.

Hope this helps!

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

5. Re: Hello All!

Hello, Travis.

I think the only way to bypass this barier is to use RichEdit32.dll
instead of
MleEdit !

I'm working to on a Source editor for Euphoria, but i've choosen to
build it
with another langage: witch compile and make little executables !
It's < 64K for now, and does some good things i think.
You can have more explanations on it into the archived ML of this
month. A new text editor...

see you !

Dominique Bodin.

Travis Beaty wrote:

> Hello All!
>
> I am working on a Euphoria IDE and I was
> wondering if I could get your help with a couple
> of menial problems.
>
> The first involves printing to the printer using
> win32lib.ew.  I have an older dot-matrix printer
> (IBM Proprinter II).  The goal is to get the
> information out of an MleEdit and sent it to this
> printer.  When I try this using wPuts(), the
> printer appears to "misinterpret" the \r\n
> and "prints" them as small rectangular boxes.  I
> have tried quite a few combinations of \r and/or
> \n, and none of them seem to work, yet the
> printer works just fine with say, Microsoft Word,
> for instance.  Any ideas?  This is driving me up
> the wall ...
>
> The second question involves the maximum capacity
> of the MleEdit.  From some of the literature I've
> read, I got the impression that the MleEdit's
> max. capacity was 32k.  However, I'm having
> problems with the Mle in my program when it gets
> to 29k.  This is how I'm calculating the size of
> what's in the Mle in k:
>
> AmountK = floor(length(getText(mleTextEditor)) /
> 1024)
>
> Using this formula, the MleEdit appears to "lock
> up" around 29k, at which point it will not allow
> you to put in any additional information.  Is the
> math wrong?  What is the capacity of an Mle in
> bytes?
>
> Thank you,
>
> Travis Beaty
> Claude, Texas
>
> Travis Beaty
> Claude, Texas
>
> "The man who grabs the cat by the tail
> learns 44% faster than the person who
> stands back and watches." -- Mark Twain
>
> ______________________________________________________
> Get your free web-based email at http://www.xoom.com
> Birthday? Anniversary? Send FREE animated greeting
> cards for any occasion at http://greetings.xoom.com

new topic     » goto parent     » topic index » view message » categorize

6. Re: Hello All!

"Cuny, David@DSS" wrote:

> Travis Beaty wrote:
>
> > The second question involves the maximum
> > capacity of the MleEdit.
>
> I was under the impression that the maximum is 32K, but I can't confirm it.
> If you are empirically measuring 29K, you must be right.

The 32k limit, if I recall correctly, includes the line terminator characters,
which accounts for the perceived discrepancy.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Hello All!

...sorry about the repeat, folks, but since it came up...again.
Anyone lamenting the 32k. limits of MLE's in win32 should look up:
limiting user-entered text, and
em_setlimittext
in win32.hlp
....it seems that a simple message can, at least, double this to 64k.
[ ...untested win32lib example ]
constant
EM_SETLIMITTEXT=197
integer junk

Haven't tried it, but....if it works blink
Wolf

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu