1. Newbie frustration with command_line()

I'm just now starting to play around with euphoria, and I tried tweaking some
sample programs to get a feel for it.

I'm having a bit of a problem with sending arguments via the command line. I
can't seem to get the command line function to work. if I have this code (which I
copied off this forum):
include get.e
sequence parm, fileName
atom vwait
   parm = command_line()
   if length(parm) > 2 then
      -- they entered a file name
      -- note that only the first name entered is used
      fileName = parm[3]
   else
      -- no file name
      fileName = "none"
   end if
puts(1, fileName)
vwait =wait_key()


I get "none" output to the console like I'd expect if I pass no command line
arguments...

but if I DO pas arguments, I still get none. (format cmdline.exw test test2 etc)

I tried sending the count to the console, but all I got (with and without
arguments) was this wierd smiley looking thing, but I have a feeling I was trying
to output something that wasn't in the right format on that one.

So, does any of this ring any bells for anyone? Thanks!

Oh yeah I'm using windows xp home

new topic     » topic index » view message » categorize

2. Re: Newbie frustration with command_line()

The code seems to be fine, what seems to be weird is that you wrote: format
cmdline.exw test test2

shouldn't that be: exw cmdline.exw test test2 ?

Also, try putting something after include.get like puts(1,"program started\n")
and in the end puts(1,"program ended") to see if it's getting executed.

On Mon, 05 Jul 2004 20:53:15 -0700
robby <guest at RapidEuphoria.com> wrote:

> 
> 
> posted by: robby <robby at prgalaska.com>
> 
> 
> I'm just now starting to play around with euphoria, and I tried tweaking some
> sample programs to get a feel for it.
> 
> I'm having a bit of a problem with sending arguments via the command line. I
> can't seem to get the command line function to work. if I have this code (which I
> copied off this forum):
> }}}
<eucode>
> include get.e
> sequence parm, fileName
> atom vwait
>    parm = command_line()
>    if length(parm) > 2 then
>       -- they entered a file name
>       -- note that only the first name entered is used
>       fileName = parm[3]
>    else
>       -- no file name
>       fileName = "none"
>    end if
> puts(1, fileName)
> vwait =wait_key()
> 
> </eucode>
{{{

> 
> I get "none" output to the console like I'd expect if I pass no command line
> arguments...
> 
> but if I DO pas arguments, I still get none. (format cmdline.exw test test2
> etc)
> 
> I tried sending the count to the console, but all I got (with and without
> arguments) was this wierd smiley looking thing, but I have a feeling I was trying
> to output something that wasn't in the right format on that one.
> 
> So, does any of this ring any bells for anyone? Thanks!
> 
> Oh yeah I'm using windows xp home

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

3. Re: Newbie frustration with command_line()

Yeah, IMMEDIATLY after posting that, I realized I was't putting the exw at the
beginning of the command line.

so now that I'm typing "exw cmdline.exw test test2" Everything is working great

Thanks a lot for the response! and please forgive my dumb newbie errors!

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

4. Re: Newbie frustration with command_line()

The reason you get that "weird smiley looking thing" is probably because you
uses puts() instead of print(). puts() is for literal sequences (think
put-string) and print() is for atoms and sequences of atoms. All of us
probably had an issue learning the difference when we started.

~Greg

----- Original Message -----
From: "robby" <guest at RapidEuphoria.com>
To: <EUforum at topica.com>
Sent: Monday, July 05, 2004 11:53 PM
Subject: Newbie frustration with command_line()


>
>
> posted by: robby <robby at prgalaska.com>
>
>
> I'm just now starting to play around with euphoria, and I tried tweaking
some sample programs to get a feel for it.
>
> I'm having a bit of a problem with sending arguments via the command line.
I can't seem to get the command line function to work. if I have this code
(which I copied off this forum):
> }}}
<eucode>
> include get.e
> sequence parm, fileName
> atom vwait
>    parm = command_line()
>    if length(parm) > 2 then
>       -- they entered a file name
>       -- note that only the first name entered is used
>       fileName = parm[3]
>    else
>       -- no file name
>       fileName = "none"
>    end if
> puts(1, fileName)
> vwait =wait_key()
>
> </eucode>
{{{

>
> I get "none" output to the console like I'd expect if I pass no command
line arguments...
>
> but if I DO pas arguments, I still get none. (format cmdline.exw test
test2 etc)
>
> I tried sending the count to the console, but all I got (with and without
arguments) was this wierd smiley looking thing, but I have a feeling I was
trying to output something that wasn't in the right format on that one.
>
> So, does any of this ring any bells for anyone? Thanks!
>
> Oh yeah I'm using windows xp home
>
>
>
>

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

5. Re: Newbie frustration with command_line()

robby wrote:
> 
<snit>
> 
> I tried sending the count to the console, but all I got (with and without
> arguments)
> was this wierd smiley looking thing, but I have a feeling I was trying to
> output something
> that wasn't in the right format on that one.

You tried sending the count as it's numeric value, 
instead of as a formatted string, so the screen displayed the charector
for that number. use printf(1,"%d",variable) to format the value.




--"ask about our layaway plan".
--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu