1. IDE - declarations and so on?

Please excuse what may be a silly question from a newcomer to 
Euphoria...

How do I declare global variables in a program being developed using 
IDE.EXW v 0.10.2?

The situation is this: I want to use a variable to hold the results of a 
directory listing: this is called on entry to the program (in what is 
currently called Window1_onOpen() ), and will be needed by various other 
procedures within the program.  Euphoria objects if I try to declare it 
as global within the procedure, and I can't find anywhere else within 
the IDE to declare it.  If I edit the .exw file to include a global 
declaration, the edit is lost any time I use the IDE to create any other 
procedure.

It's probably obvious, really, but I'm stumped at the moment!
-- 
------------------                          -------------------------
|\avid Aldred   /  David at aldred.demon.co.uk  \   Nottingham, England
|/             --------------------------------

new topic     » topic index » view message » categorize

2. Re: IDE - declarations and so on?

----- Original Message -----
From: <david at aldred.demon.co.uk>
Subject: IDE - declarations and so on?
> Please excuse what may be a silly question from a newcomer to
> Euphoria...
>
> How do I declare global variables in a program being developed using
> IDE.EXW v 0.10.2?
>
> The situation is this: I want to use a variable to hold the results of a
> directory listing: this is called on entry to the program (in what is
> currently called Window1_onOpen() ), and will be needed by various other
> procedures within the program.  Euphoria objects if I try to declare it
> as global within the procedure, and I can't find anywhere else within
> the IDE to declare it.  If I edit the .exw file to include a global
> declaration, the edit is lost any time I use the IDE to create any other
> procedure.
>
> It's probably obvious, really, but I'm stumped at the moment!
> --

While working on your main window, right click anywhere, select Code Editor,
and then pull down the right-hand box (usually says onClick, or something.
At the top of the list, you'll find (General)
Select that, and anything you type will be put at the top of the file.
global sequence mydir = (whatever)

Regards,
Irv

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

3. Re: IDE - declarations and so on?

In message <0.1700008810.707860666-212058698-990382156 at topica.com>, Irv 
Mullins <irvm at ellijay.com> writes

>From: <david at aldred.demon.co.uk>
>> How do I declare global variables in a program being developed using
>> IDE.EXW v 0.10.2?
>>
>> It's probably obvious, really, but I'm stumped at the moment!
>> --
>
>While working on your main window, right click anywhere, select Code Editor,
>and then pull down the right-hand box (usually says onClick, or something.
>At the top of the list, you'll find (General)
>Select that, and anything you type will be put at the top of the file.
>global sequence mydir = (whatever)

Thanks: that works nicely!

Now can I ask another - if I want to have the program fill a multi-line 
edit control with a number of lines of text, how do I do it?  Putting in 
the text lines concatenated with '\n' or '\r' or even both just makes 
blobs appear!

-- 
------------------                          -------------------------
|\avid Aldred   /  David at aldred.demon.co.uk  \   Nottingham, England
|/             --------------------------------

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

4. Re: IDE - declarations and so on?

In message <0.1700008810.1007970733-212058698-990500263 at topica.com>, 
Brian Broker <bkb at cnw.com> writes
>
>try "/r/n"

Thanks.  They seem to have turned those two round for this control, 
don't they?  I don't think I've ever seen /r/n rather than /n/r used 
before!
-- 
------------------                          -------------------------
|\avid Aldred   /  David at aldred.demon.co.uk  \   Nottingham, England
|/             --------------------------------

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

5. Re: IDE - declarations and so on?

----- Original Message -----
From: <david at aldred.demon.co.uk>
To: "EUforum" <EUforum at topica.com>
Subject: Re: IDE - declarations and so on?
> Thanks.  They seem to have turned those two round for this control,
> don't they?  I don't think I've ever seen /r/n rather than /n/r used
> before!

Actually David, Carriage-Return/New-Line is the normal sequence and has been
since before computers were around. The reason is that in the days of
mechanical output devices such as teletype machines, the #0D (ascii-13)
control command was sent to the device to "return the carriage", that is the
print head, back to the left hand edge of the paper. While it was travelling
back to the left edge, the #0A (ascii-10) control command was sent to the
device to move the paper up one line. This was done to optimise the output
speed. If it was done the other way round, linefeed then carriage return,
the device would move the paper up one line (a fast operation) and then move
the carriage (a slow operation) and the device would block printing until
the carriage was settled again. In fact, some printers would not block, so
printing would commence while the carriage was still travelling back to the
start of the next line - not a desirable thing.

So, Microsoft, trying not to be inovative I suppose, programmed MS-DOS
screen handling to emulate a teletype device. A #0D will move the cursor to
the left hand edge of the screen, and a #0A will move the cursor down one
line, scolling up if its at the bottom of the screen. They applied this
convention to text files to simplify the device driver when display text
files. The Unix creators decided that only a #0A is required to denote the
end of a text line and left it up to the device drivers to do the correct
thing in manipulating the display of text. As most Unixes were using dumb
terminals, which also emulated teletypes, the Unix device drivers would
automatically output a #0D just before sending the #0A from the text file to
the terminal (or printer).

To make things worse, Microsoft has some Windows controls using a simple #0A
(message box for example) and other still needing the CRLF sequence.

------
Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

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

6. Re: IDE - declarations and so on?


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

Search



Quick Links

User menu

Not signed in.

Misc Menu