Re: [Oorexx-users] OK, what am I doing wrong? Question about the Directory Function

2016-02-03 Thread Rony G. Flatscher
Hi there,

not being an English native speaker the text seems to be very clear! :-)

Here a rexxtry-session on a German Windows with all three usages:

D:\Dokumente und Einstellungen\Administrator>rexxtry
REXX-ooRexx_4.2.1(MT)_32-bit 6.04 15 Sep 2015
  rexxtry.rex lets you interactively try REXX statements.
Each string is executed when you hit Enter.
Enter 'call tell' for a description of the features.
  Go on - try a few...Enter 'exit' to end.
*dir=directory()*/;say "["dir"]"/
/[D:\Dokumente und Einstellungen\Administrator]/
  ... rexxtry.rex on WindowsNT
*dir=directory("directory_that_does_not_exist")*/;say "["dir"]"/
/[]/
  ... rexxtry.rex on WindowsNT
*dir=directory("d:\Dokumente und Einstellungen")/;/*/say "["dir"]"/
/[d:\Dokumente und Einstellungen]/
  ... rexxtry.rex on WindowsNT
exit

  * The first usage returns the current directory,
  * the second usage supplies a non-existing-directory, which causes an empty 
string to be returned,
indicating that no change of the current directory took place,
  * the third usage supplies an existing directory, to which a switch occurs, 
returning the now
(new) current directory.

HTH,

---rony


On 02.02.2016 23:10, Jon Wolfers wrote:
> Hi Bertram,
>
> Yes, this looks like a bug of some sort.  The manual I have gives the 
> description as you quote,
> but then the example that follows immediately after clearly does not expect 
> the same behaviour.
>
> I would say that this is a documentation bug as the documentation lists two 
> different behaviours
> which can't both be right, and the code only displays one of these behaviours.
>
> FWIW, I have been using this function wrongly for over a decade and for some 
> unfathomable reason
> it has not yet caused a problem.  This is probably because I set (& then 
> ineffectively pop) the
> directory wherever it is critical.
>
> Unless anyone has further wisdom on this one of us should raise a bug report.
>
> Jon
>
> On 2 February 2016 at 21:44, Bertram Moshier  > wrote:
>
> Hi,
>
> I'm confused about the directory function both in its usage and 
> documentation.
>
> The documentation reads:
>
> Returns the current directory, changing it to /newdirectory/ if 
> an argument is
> supplied and the named directory exists. If /newdirectory/ is not 
> specified, the name
> of the current directory is returned. Otherwise, an attempt is 
> made to change to the
> specified /newdirectory/. If successful, the name of the 
> /newdirectory/ is returned;
> if an error occurred, null is returned.
>
>
> The opening sentence looks to be clear.  The directory function will:
>
>  1. Obtain the current directory and
>  2. Change to a new directory (assuming it exist).
>
> The second sentence is also clear.  If you don't include an argument, 
> you'll get the name of
> the current directory and no attempt to change to a new directory will 
> occur.
>
> What I don't understand are the last two sentences and how they relate to 
> the first two
> sentences.  They seem in conflict.
>
> "Otherwise"  OK, otherwise to not having an argument (e.g. new 
> directory), sure, it is what
> occurs in the opening sentence IF the directory exists.
>
> */_
> _/*
> */_All right, instead of analyzing the documentation maybe a simpler way 
> to ask/say all this
> is:_/*
> */_
> _/*
>
> *_HOW DO I GET THE DIRECTORY FUNCTION TO OPERATE AS DESCRIBED IN THE 
> OPENING SENTENCE?
>  __The given is the directory specified by newdirectory does exists._*
>
>
> Basically what I would like is to code:
>
> Current_Directory = directory(New_Directory)
>
> and when New_Directory exists I get the Current Directory, if the New 
> Directory doesn't exists
> I get null.
>
> It is how I read the opening sentence to the Directory function.
>
> What I am seeing though, is either the new directory or null and never 
> the current directory,
> as described in the opening sentence.
>
>
>
>
> What am I trying to do is write a very simple function to:
>
>  1. State (like FSSTATE in CMS) the existence of a directory (new 
> directory).
>  2. If it exists, cool, return and depending upon arguments leave the 
> directory as either the
> new directory or the caller's current directory. 
>  3. If it does not exist, then make the new directory, return, and like 
> #2 leave the directory
> per arguments.
>
>
>
> *Yes, I can code based upon the behavior I'm seeing, but I'd like to 
> understand how to get
> Rexx to behave as described in the opening sentence, PLEASE and Thank 
> You.*
>
>
> 
> 

Re: [Oorexx-users] OK, what am I doing wrong? Question about the Directory Function

2016-02-03 Thread Rony G. Flatscher
Hi Jon,

On 03.02.2016 16:07, Jon Wolfers wrote:
> The confusion arises with the very first phrase "Returns the current 
> directory".
ah, I see!

> If your working directory is 'c:\old_Directory' and both that and 
> 'c:\new_directory' exist 
>
> then I would expect
>
> pwd = directory('c:\new_directory')
>
> to set pwd to 'c:\old_Directory', not 'c:\new_directory'
>
> I hope that clarifies things a bit.
Yes, sometimes it seems it is good not to be a native English speaker! ;)

Best regards

---rony

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users


Re: [Oorexx-users] OK, what am I doing wrong? Question about the Directory Function

2016-02-03 Thread Jon Wolfers
Hi Rony,

The confusion arises with the very first phrase "Returns the current
directory".

If your working directory is 'c:\old_Directory' and both that and
'c:\new_directory' exist

then I would expect

pwd = directory('c:\new_directory')

to set pwd to 'c:\old_Directory', not 'c:\new_directory'

I hope that clarifies things a bit.

Jon

On 3 February 2016 at 13:28, Rony G. Flatscher 
wrote:

> Hi there,
>
> not being an English native speaker the text seems to be very clear! :-)
>
> Here a rexxtry-session on a German Windows with all three usages:
>
> D:\Dokumente und Einstellungen\Administrator>rexxtry
> REXX-ooRexx_4.2.1(MT)_32-bit 6.04 15 Sep 2015
>   rexxtry.rex lets you interactively try REXX statements.
> Each string is executed when you hit Enter.
> Enter 'call tell' for a description of the features.
>   Go on - try a few...Enter 'exit' to end.*dir=directory()**;say 
> "["dir"]"**[D:\Dokumente und Einstellungen\Administrator]*
>   ... rexxtry.rex on 
> WindowsNT*dir=directory("directory_that_does_not_exist")**;say "["dir"]"**[]*
>   ... rexxtry.rex on 
> WindowsNT*dir=directory("d:\Dokumente und Einstellungen");**say 
> "["dir"]"**[d:\Dokumente und Einstellungen]*
>   ... rexxtry.rex on WindowsNT
> exit
>
>
>- The first usage returns the current directory,
>- the second usage supplies a non-existing-directory, which causes an
>empty string to be returned, indicating that no change of the current
>directory took place,
>- the third usage supplies an existing directory, to which a switch
>occurs, returning the now (new) current directory.
>
> HTH,
>
> ---rony
>
>
>
> On 02.02.2016 23:10, Jon Wolfers wrote:
>
> Hi Bertram,
>
> Yes, this looks like a bug of some sort.  The manual I have gives the
> description as you quote, but then the example that follows immediately
> after clearly does not expect the same behaviour.
>
> I would say that this is a documentation bug as the documentation lists
> two different behaviours which can't both be right, and the code only
> displays one of these behaviours.
>
> FWIW, I have been using this function wrongly for over a decade and for
> some unfathomable reason it has not yet caused a problem.  This is probably
> because I set (& then ineffectively pop) the directory wherever it is
> critical.
>
> Unless anyone has further wisdom on this one of us should raise a bug
> report.
>
> Jon
>
> On 2 February 2016 at 21:44, Bertram Moshier 
> wrote:
>
>> Hi,
>>
>> I'm confused about the directory function both in its usage and
>> documentation.
>>
>> The documentation reads:
>>
>> Returns the current directory, changing it to *newdirectory* if an
>>> argument is supplied and the named directory exists. If *newdirectory* is
>>> not specified, the name of the current directory is returned. Otherwise, an
>>> attempt is made to change to the specified *newdirectory*. If
>>> successful, the name of the *newdirectory* is returned; if an error
>>> occurred, null is returned.
>>>
>>
>> The opening sentence looks to be clear.  The directory function will:
>>
>>1. Obtain the current directory and
>>2. Change to a new directory (assuming it exist).
>>
>> The second sentence is also clear.  If you don't include an argument,
>> you'll get the name of the current directory and no attempt to change to a
>> new directory will occur.
>>
>> What I don't understand are the last two sentences and how they relate to
>> the first two sentences.  They seem in conflict.
>>
>> "Otherwise"  OK, otherwise to not having an argument (e.g. new
>> directory), sure, it is what occurs in the opening sentence IF the
>> directory exists.
>>
>>
>> *All right, instead of analyzing the documentation maybe a simpler way to
>> ask/say all this is:*
>>
>> *HOW DO I GET THE DIRECTORY FUNCTION TO OPERATE AS DESCRIBED IN THE
>> OPENING SENTENCE?  The given is the directory specified by newdirectory
>> does exists.*
>>
>>
>> Basically what I would like is to code:
>>
>> Current_Directory = directory(New_Directory)
>>
>> and when New_Directory exists I get the Current Directory, if the New
>> Directory doesn't exists I get null.
>>
>> It is how I read the opening sentence to the Directory function.
>>
>> What I am seeing though, is either the new directory or null and never
>> the current directory, as described in the opening sentence.
>>
>>
>>
>>
>> What am I trying to do is write a very simple function to:
>>
>>1. State (like FSSTATE in CMS) the existence of a directory (new
>>directory).
>>2. If it exists, cool, return and depending upon arguments leave the
>>directory as either the new directory or the caller's current directory.
>>3. If it does not exist, then make the new directory, return, and
>>like #2 leave the directory per arguments.
>>
>>
>>
>> *Yes, I can 

Re: [Oorexx-users] Need help reading,writing to a "com" port

2016-02-03 Thread Les Koehler
Bill,

Where is the advertisement after your signature coming from?

Les

On 2/2/2016 11:47 AM, Bill Turner, WB4ALM wrote:
> This has been cross-posted to "ooRexxUsers" and "ooRexx-devel"
> ==
> I am now a volunteer and am associated with a County Emergency
> Operations Center, and I need to put some "very old" radio
> equipment back into service...
>
> ...some of which likes to communicate with a computer via an RS-232
> connection.  Since most modern computers do not have RS-232 ports
> anymore, I have purchased an RS-232 USB adapter cable.
>
> I am finding that my knowledge on how to use ooRexx to communicate
> with an RS-232 port is VERY limited...
> ...and I am having problems making it work.
>
> 1. I will be using this equipment with Windows 10 and with Linux.
>  My primary test environment is Linux: Ubuntu 14.04 with Cinammon
>  (Don't like UNITY!)
> 2. ooRexx 4.2 on all systems.
> 3. The USB cable shows up as  /dev/ttyUSB0  under Linux
>  and as  COM1  under windows.
> 4. The external equipment works in a half-duplex mode.
>  You send it a command and it responds with an answer.
>  The "commands" are formatted in a manner very similiar to
>  the old Hayes modem commands, I.E.
>   "AT" followed by a command text followed by a carriage return
>   (all upper case!)
>
>
> I know that the hardware works, since I can use "minicom" on Linux
> to communicate with the external device, which only supports
> 300 or 1200 baud, 8-bits no-parity or 7-bits even/odd parity.
>
>
> Questions:
> 1. Is there a way to specify port speed, parity, etc. from INSIDE
>  the ooRexx routine?
>
>  Under Linux, I can use "stty" externally, but can not invoke it
>  internally from the ooRexx routine because the change is not
>  maintained for the remainder of the duration of the rexx exec.
>  (apparently this is an Enviromental/Shell issue... ???)
>
> 2. More importantly, does anybody have a simple read/write ooRexx
>  sample that can talk to a com port? (I beleive that stream IO
>  and charin/charout are required. Lineout doesn't seem to
>  transmit anything, but charout does.)
>
>  I can get my routine to transmit, but I do not seem to be able
>  to receive any data.
>
>  Normal use:  I send a command like "ATRT" , and it responds
>   with a 6-digit message and a  or .
>
>
> 3. I know that data is being transmited, because I can see the
>  "flashing lights" on my rs-232 test adapter. I think, however,
>  that the speed or parity might be wrong, as the remote device
>  does not seem to be responding.
>
>  As I said, the remote device uses commands that start with "AT"
>  like those used in the old Hayes modems, and it will respond
>  with either a "0"  or possibly a 4 to 8 character message and
>  a  when it recognizes a command request.
>
> 4. any help would be appreciated.
>
> /s/ Bill Turner, wb4alm
>
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
> ___
> Oorexx-users mailing list
> Oorexx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-users
>

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users


[Oorexx-users] (no subject)

2016-02-03 Thread Bertram Moshier
Hi Jon,

.
> I would say that this is a documentation bug as the documentation lists
> two different behaviours which can't both be right, and the code only
> displays one of these behaviors.


I think my earlier email about find a VM/CMS example went though, but in
case it didn't (I sent it from a tablet).  I found an example in my old
notes, while at Cray Research, Inc, of using it as:

Current_Dir = directory(New_Dir)  where New_Dir was a valid location.

I also think I successfully used this coding using classic Rexx under OS/2
Warp, but have yet to find my old OS/2 Warp drives.

As all implementations of the language should match and VM/CMS, OS/2 Warp,
MVS, etc all came earlier, I'd say the documentation and code both are off
in their own ways.  The documentation needs to be clear, obviously.  Also
the implementation should allow functions, such as the directory, to
function the same regardless.

Would this be two bug reports or one for two areas?

Bert.
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users


Re: [Oorexx-users] OK, what am I doing wrong? Question about the Directory Function

2016-02-03 Thread Jon Wolfers
Hi Bertram,

Shouldn't all versions of Rexx functions work the same, unless otherwise
> noted?


Compatibility is something we value, and I doubt that this was done
deliberately or even recently.

Having said that, I would guess that changing the functionality at this
point would probably break far more people's current code than leaving it
as it is and bringing the documentation in line with the reality.

Jon

On 3 February 2016 at 17:05, Bertram Moshier 
wrote:

> FYI / BTW:  I went back to some Rexx programs I wrote on the VM systems we
> used at Cray Research, Inc and found
>
> Current_Dir = directory (New_Dir)  where New_Dir was a valid directory.
>
> Shouldn't all versions of Rexx functions work the same, unless otherwise
> noted?   I think it also worked on classic Rexx using OS/2 Warp, but have
> yet to find my OS/2 Warp drives to verify it.
>
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
> ___
> Oorexx-users mailing list
> Oorexx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-users
>
>
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users


Re: [Oorexx-users] OK, what am I doing wrong? Question about the Directory Function

2016-02-03 Thread Jon Wolfers
I've had a look at the code and I have searched back in the repository as
far as I could.

Both the windows and linux directory bif return look to work the same way.

If a directory is passed they attempt to change to it
If they fail they return a null string else they discover the current
directory and return it.

Although the code has been updated a few times since Feb 2007, the logic
there was the same then as now.


\main\trunk\interpreter\platform\windows\ExternalFunctions.cpp
\main\trunk\interpreter\platform\unix\ExternalFunctions.cpp


On 3 February 2016 at 18:22, Jon Wolfers  wrote:

> Hi Bertram,
>
> Shouldn't all versions of Rexx functions work the same, unless otherwise
>> noted?
>
>
> Compatibility is something we value, and I doubt that this was done
> deliberately or even recently.
>
> Having said that, I would guess that changing the functionality at this
> point would probably break far more people's current code than leaving it
> as it is and bringing the documentation in line with the reality.
>
> Jon
>
> On 3 February 2016 at 17:05, Bertram Moshier 
> wrote:
>
>> FYI / BTW:  I went back to some Rexx programs I wrote on the VM systems
>> we used at Cray Research, Inc and found
>>
>> Current_Dir = directory (New_Dir)  where New_Dir was a valid directory.
>>
>> Shouldn't all versions of Rexx functions work the same, unless otherwise
>> noted?   I think it also worked on classic Rexx using OS/2 Warp, but have
>> yet to find my OS/2 Warp drives to verify it.
>>
>>
>> --
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
>> ___
>> Oorexx-users mailing list
>> Oorexx-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/oorexx-users
>>
>>
>
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users