oorexx-rfes

Feature Requests item #3493280, was opened at 2012-02-24 09:33
Message generated for change (Tracker Item Submitted) made by wdashley
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interpreter
Group: v4.2.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David Ashley (wdashley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Enhancement to rexx.cpp
Initial Comment:
This is mostly aimed at the *nix environment but it might be useful for the Windows environment as well.
In the past we a discussed how the command line invocation of rexx limits the ability of the interpreter to properly give the list of original command line arguments to the interpreter since they will be converted to a single string argument. This sometimes causes problems since the C argument processing can process the arguments in unexpected ways.
What I propose to resolve this problem is to add a new command line option (like -a) that would cause the rexx.cpp to create multiple arguments to be passed to the interpreter, one for each shell/C command line argument. In this way you can force copies of the processed shell/C arguments to the interpreter without any "interpretation" of those arguments needed by the script itself.
If the option is not provided then the single argument string would be processed normally.
David Ashley
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701

Feature Requests item #3493280, was opened at 2012-02-24 09:33
Message generated for change (Comment added) made by wdashley
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interpreter
Group: v4.2.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David Ashley (wdashley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Enhancement to rexx.cpp
Initial Comment:
This is mostly aimed at the *nix environment but it might be useful for the Windows environment as well.
In the past we a discussed how the command line invocation of rexx limits the ability of the interpreter to properly give the list of original command line arguments to the interpreter since they will be converted to a single string argument. This sometimes causes problems since the C argument processing can process the arguments in unexpected ways.
What I propose to resolve this problem is to add a new command line option (like -a) that would cause the rexx.cpp to create multiple arguments to be passed to the interpreter, one for each shell/C command line argument. In this way you can force copies of the processed shell/C arguments to the interpreter without any "interpretation" of those arguments needed by the script itself.
If the option is not provided then the single argument string would be processed normally.
David Ashley
----------------------------------------------------------------------
>Comment By: David Ashley (wdashley)
Date: 2012-03-02 11:58
Message:
I added the *nix version of what believe woll work for this. Please let me
know what you think. If this is acceptable I can code a windows version and
we can discuss that.
David Ashley
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701

Feature Requests item #3493280, was opened at 2012-02-24 09:33
Message generated for change (Comment added) made by jfaucher
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interpreter
Group: v4.2.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David Ashley (wdashley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Enhancement to rexx.cpp
Initial Comment:
This is mostly aimed at the *nix environment but it might be useful for the Windows environment as well.
In the past we a discussed how the command line invocation of rexx limits the ability of the interpreter to properly give the list of original command line arguments to the interpreter since they will be converted to a single string argument. This sometimes causes problems since the C argument processing can process the arguments in unexpected ways.
What I propose to resolve this problem is to add a new command line option (like -a) that would cause the rexx.cpp to create multiple arguments to be passed to the interpreter, one for each shell/C command line argument. In this way you can force copies of the processed shell/C arguments to the interpreter without any "interpretation" of those arguments needed by the script itself.
If the option is not provided then the single argument string would be processed normally.
David Ashley
----------------------------------------------------------------------
>Comment By: jfaucher (jfaucher)
Date: 2012-03-07 00:10
Message:
I would prefer to not depend on a user decision to have access to the C
array.
Is it possible to pass both the string and the array to RexxStart ?
That would ensure that legacy code still works, even if the option -a
activated (assuming -a will have an impact on arg(), parse arg, use arg).
Don't know yet how we could access to the array from a Rexx script, but I
have a use case in incubator/DocMusings/transformxml which illustrates the
need.
transformdir.rex and transformfile.rex are two scripts which can be called
from the command line.
transformfile.rex can also be called from transformdir.rex, which passes
arguments "normally", i.e. not as a string.
When the call type is "COMMAND", then the string is splitted in chunks by a
utility which try to manages the whitespaces and quotes as the C runtime.
Otherwise the array of arguments is used as-is.
Assuming the option -a is implemented, I suppose I can receive an array of
more than one element when the call type is "COMMAND".
The code below will support this case, but it remains the case when the
array contains exactly one item. I will need an additional info to decide
if I have to call String2Args or not.
-------------------
parse source . callType me
arguments = .Arguments~new(callType, arg(1,"array"))
::class CommonArguments
::method init
use strict arg callType, arguments -- always an array
select
when callType == "COMMAND" & arguments~items == 1 then self~args =
String2Args(arguments[1])
when callType == "SUBROUTINE" & arguments~items == 1 &
arguments[1]~isA(.array) then self~args = arguments[1]
otherwise self~args = arguments
end
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-02 11:58
Message:
I added the *nix version of what believe woll work for this. Please let me
know what you think. If this is acceptable I can code a windows version and
we can discuss that.
David Ashley
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701

Feature Requests item #3493280, was opened at 2012-02-24 09:33
Message generated for change (Comment added) made by wdashley
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interpreter
Group: v4.2.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David Ashley (wdashley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Enhancement to rexx.cpp
Initial Comment:
This is mostly aimed at the *nix environment but it might be useful for the Windows environment as well.
In the past we a discussed how the command line invocation of rexx limits the ability of the interpreter to properly give the list of original command line arguments to the interpreter since they will be converted to a single string argument. This sometimes causes problems since the C argument processing can process the arguments in unexpected ways.
What I propose to resolve this problem is to add a new command line option (like -a) that would cause the rexx.cpp to create multiple arguments to be passed to the interpreter, one for each shell/C command line argument. In this way you can force copies of the processed shell/C arguments to the interpreter without any "interpretation" of those arguments needed by the script itself.
If the option is not provided then the single argument string would be processed normally.
David Ashley
----------------------------------------------------------------------
>Comment By: David Ashley (wdashley)
Date: 2012-03-07 09:54
Message:
I added a new file that changes the rexx.cpp program to use the 4.0 API for
executing the interpreter. This allows the oportunity to set a variable in
the .local environment ("syscargs") that is a Rexx Array that contains the
C arguments from the command line. With this convention your program would
receive the notmal single argument but have the C command line arguments
available from the .local environment.
----------------------------------------------------------------------
Comment By: jfaucher (jfaucher)
Date: 2012-03-07 00:10
Message:
I would prefer to not depend on a user decision to have access to the C
array.
Is it possible to pass both the string and the array to RexxStart ?
That would ensure that legacy code still works, even if the option -a
activated (assuming -a will have an impact on arg(), parse arg, use arg).
Don't know yet how we could access to the array from a Rexx script, but I
have a use case in incubator/DocMusings/transformxml which illustrates the
need.
transformdir.rex and transformfile.rex are two scripts which can be called
from the command line.
transformfile.rex can also be called from transformdir.rex, which passes
arguments "normally", i.e. not as a string.
When the call type is "COMMAND", then the string is splitted in chunks by a
utility which try to manages the whitespaces and quotes as the C runtime.
Otherwise the array of arguments is used as-is.
Assuming the option -a is implemented, I suppose I can receive an array of
more than one element when the call type is "COMMAND".
The code below will support this case, but it remains the case when the
array contains exactly one item. I will need an additional info to decide
if I have to call String2Args or not.
-------------------
parse source . callType me
arguments = .Arguments~new(callType, arg(1,"array"))
::class CommonArguments
::method init
use strict arg callType, arguments -- always an array
select
when callType == "COMMAND" & arguments~items == 1 then self~args =
String2Args(arguments[1])
when callType == "SUBROUTINE" & arguments~items == 1 &
arguments[1]~isA(.array) then self~args = arguments[1]
otherwise self~args = arguments
end
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-02 11:58
Message:
I added the *nix version of what believe woll work for this. Please let me
know what you think. If this is acceptable I can code a windows version and
we can discuss that.
David Ashley
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701

Feature Requests item #3493280, was opened at 2012-02-24 09:33
Message generated for change (Comment added) made by jfaucher
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interpreter
Group: v4.2.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David Ashley (wdashley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Enhancement to rexx.cpp
Initial Comment:
This is mostly aimed at the *nix environment but it might be useful for the Windows environment as well.
In the past we a discussed how the command line invocation of rexx limits the ability of the interpreter to properly give the list of original command line arguments to the interpreter since they will be converted to a single string argument. This sometimes causes problems since the C argument processing can process the arguments in unexpected ways.
What I propose to resolve this problem is to add a new command line option (like -a) that would cause the rexx.cpp to create multiple arguments to be passed to the interpreter, one for each shell/C command line argument. In this way you can force copies of the processed shell/C arguments to the interpreter without any "interpretation" of those arguments needed by the script itself.
If the option is not provided then the single argument string would be processed normally.
David Ashley
----------------------------------------------------------------------
>Comment By: jfaucher (jfaucher)
Date: 2012-03-07 11:20
Message:
Thanks ! I find it's a good idea to pass the array like that.
Tested in my sandbox under Puppy.
Works good, after these little changes :
...
rxcargs = pgmThrdInst->NewArray(1);
...
pgmThrdInst->DirectoryPut(dir, rxcargs, "SYSCARGS");
...
rc = 0;
if (result != NULL) pgmThrdInst->ObjectToInt32(result, &rc);
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-07 09:54
Message:
I added a new file that changes the rexx.cpp program to use the 4.0 API for
executing the interpreter. This allows the oportunity to set a variable in
the .local environment ("syscargs") that is a Rexx Array that contains the
C arguments from the command line. With this convention your program would
receive the notmal single argument but have the C command line arguments
available from the .local environment.
----------------------------------------------------------------------
Comment By: jfaucher (jfaucher)
Date: 2012-03-07 00:10
Message:
I would prefer to not depend on a user decision to have access to the C
array.
Is it possible to pass both the string and the array to RexxStart ?
That would ensure that legacy code still works, even if the option -a
activated (assuming -a will have an impact on arg(), parse arg, use arg).
Don't know yet how we could access to the array from a Rexx script, but I
have a use case in incubator/DocMusings/transformxml which illustrates the
need.
transformdir.rex and transformfile.rex are two scripts which can be called
from the command line.
transformfile.rex can also be called from transformdir.rex, which passes
arguments "normally", i.e. not as a string.
When the call type is "COMMAND", then the string is splitted in chunks by a
utility which try to manages the whitespaces and quotes as the C runtime.
Otherwise the array of arguments is used as-is.
Assuming the option -a is implemented, I suppose I can receive an array of
more than one element when the call type is "COMMAND".
The code below will support this case, but it remains the case when the
array contains exactly one item. I will need an additional info to decide
if I have to call String2Args or not.
-------------------
parse source . callType me
arguments = .Arguments~new(callType, arg(1,"array"))
::class CommonArguments
::method init
use strict arg callType, arguments -- always an array
select
when callType == "COMMAND" & arguments~items == 1 then self~args =
String2Args(arguments[1])
when callType == "SUBROUTINE" & arguments~items == 1 &
arguments[1]~isA(.array) then self~args = arguments[1]
otherwise self~args = arguments
end
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-02 11:58
Message:
I added the *nix version of what believe woll work for this. Please let me
know what you think. If this is acceptable I can code a windows version and
we can discuss that.
David Ashley
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701

Feature Requests item #3493280, was opened at 2012-02-24 09:33
Message generated for change (Comment added) made by wdashley
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interpreter
Group: v4.2.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David Ashley (wdashley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Enhancement to rexx.cpp
Initial Comment:
This is mostly aimed at the *nix environment but it might be useful for the Windows environment as well.
In the past we a discussed how the command line invocation of rexx limits the ability of the interpreter to properly give the list of original command line arguments to the interpreter since they will be converted to a single string argument. This sometimes causes problems since the C argument processing can process the arguments in unexpected ways.
What I propose to resolve this problem is to add a new command line option (like -a) that would cause the rexx.cpp to create multiple arguments to be passed to the interpreter, one for each shell/C command line argument. In this way you can force copies of the processed shell/C arguments to the interpreter without any "interpretation" of those arguments needed by the script itself.
If the option is not provided then the single argument string would be processed normally.
David Ashley
----------------------------------------------------------------------
>Comment By: David Ashley (wdashley)
Date: 2012-03-12 11:49
Message:
I added a Windows version of the new rexx.cpp. I do not have a Windows
machine available at the moment so could someone try this out for me? It
should work exactly the same as the *nix version.
----------------------------------------------------------------------
Comment By: jfaucher (jfaucher)
Date: 2012-03-07 11:20
Message:
Thanks ! I find it's a good idea to pass the array like that.
Tested in my sandbox under Puppy.
Works good, after these little changes :
...
rxcargs = pgmThrdInst->NewArray(1);
...
pgmThrdInst->DirectoryPut(dir, rxcargs, "SYSCARGS");
...
rc = 0;
if (result != NULL) pgmThrdInst->ObjectToInt32(result, &rc);
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-07 09:54
Message:
I added a new file that changes the rexx.cpp program to use the 4.0 API for
executing the interpreter. This allows the oportunity to set a variable in
the .local environment ("syscargs") that is a Rexx Array that contains the
C arguments from the command line. With this convention your program would
receive the notmal single argument but have the C command line arguments
available from the .local environment.
----------------------------------------------------------------------
Comment By: jfaucher (jfaucher)
Date: 2012-03-07 00:10
Message:
I would prefer to not depend on a user decision to have access to the C
array.
Is it possible to pass both the string and the array to RexxStart ?
That would ensure that legacy code still works, even if the option -a
activated (assuming -a will have an impact on arg(), parse arg, use arg).
Don't know yet how we could access to the array from a Rexx script, but I
have a use case in incubator/DocMusings/transformxml which illustrates the
need.
transformdir.rex and transformfile.rex are two scripts which can be called
from the command line.
transformfile.rex can also be called from transformdir.rex, which passes
arguments "normally", i.e. not as a string.
When the call type is "COMMAND", then the string is splitted in chunks by a
utility which try to manages the whitespaces and quotes as the C runtime.
Otherwise the array of arguments is used as-is.
Assuming the option -a is implemented, I suppose I can receive an array of
more than one element when the call type is "COMMAND".
The code below will support this case, but it remains the case when the
array contains exactly one item. I will need an additional info to decide
if I have to call String2Args or not.
-------------------
parse source . callType me
arguments = .Arguments~new(callType, arg(1,"array"))
::class CommonArguments
::method init
use strict arg callType, arguments -- always an array
select
when callType == "COMMAND" & arguments~items == 1 then self~args =
String2Args(arguments[1])
when callType == "SUBROUTINE" & arguments~items == 1 &
arguments[1]~isA(.array) then self~args = arguments[1]
otherwise self~args = arguments
end
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-02 11:58
Message:
I added the *nix version of what believe woll work for this. Please let me
know what you think. If this is acceptable I can code a windows version and
we can discuss that.
David Ashley
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701

Feature Requests item #3493280, was opened at 2012-02-24 09:33
Message generated for change (Comment added) made by jfaucher
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interpreter
Group: v4.2.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David Ashley (wdashley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Enhancement to rexx.cpp
Initial Comment:
This is mostly aimed at the *nix environment but it might be useful for the Windows environment as well.
In the past we a discussed how the command line invocation of rexx limits the ability of the interpreter to properly give the list of original command line arguments to the interpreter since they will be converted to a single string argument. This sometimes causes problems since the C argument processing can process the arguments in unexpected ways.
What I propose to resolve this problem is to add a new command line option (like -a) that would cause the rexx.cpp to create multiple arguments to be passed to the interpreter, one for each shell/C command line argument. In this way you can force copies of the processed shell/C arguments to the interpreter without any "interpretation" of those arguments needed by the script itself.
If the option is not provided then the single argument string would be processed normally.
David Ashley
----------------------------------------------------------------------
>Comment By: jfaucher (jfaucher)
Date: 2012-03-12 15:52
Message:
Tested under win32 (winXP).
Two changes to let compile :
old: #include <oorexx.h>
new: #include <oorexxapi.h>
old: LONG rc;
new: INT rc;
Then it works good.
I don't have a win64 to test.
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-12 11:49
Message:
I added a Windows version of the new rexx.cpp. I do not have a Windows
machine available at the moment so could someone try this out for me? It
should work exactly the same as the *nix version.
----------------------------------------------------------------------
Comment By: jfaucher (jfaucher)
Date: 2012-03-07 11:20
Message:
Thanks ! I find it's a good idea to pass the array like that.
Tested in my sandbox under Puppy.
Works good, after these little changes :
...
rxcargs = pgmThrdInst->NewArray(1);
...
pgmThrdInst->DirectoryPut(dir, rxcargs, "SYSCARGS");
...
rc = 0;
if (result != NULL) pgmThrdInst->ObjectToInt32(result, &rc);
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-07 09:54
Message:
I added a new file that changes the rexx.cpp program to use the 4.0 API for
executing the interpreter. This allows the oportunity to set a variable in
the .local environment ("syscargs") that is a Rexx Array that contains the
C arguments from the command line. With this convention your program would
receive the notmal single argument but have the C command line arguments
available from the .local environment.
----------------------------------------------------------------------
Comment By: jfaucher (jfaucher)
Date: 2012-03-07 00:10
Message:
I would prefer to not depend on a user decision to have access to the C
array.
Is it possible to pass both the string and the array to RexxStart ?
That would ensure that legacy code still works, even if the option -a
activated (assuming -a will have an impact on arg(), parse arg, use arg).
Don't know yet how we could access to the array from a Rexx script, but I
have a use case in incubator/DocMusings/transformxml which illustrates the
need.
transformdir.rex and transformfile.rex are two scripts which can be called
from the command line.
transformfile.rex can also be called from transformdir.rex, which passes
arguments "normally", i.e. not as a string.
When the call type is "COMMAND", then the string is splitted in chunks by a
utility which try to manages the whitespaces and quotes as the C runtime.
Otherwise the array of arguments is used as-is.
Assuming the option -a is implemented, I suppose I can receive an array of
more than one element when the call type is "COMMAND".
The code below will support this case, but it remains the case when the
array contains exactly one item. I will need an additional info to decide
if I have to call String2Args or not.
-------------------
parse source . callType me
arguments = .Arguments~new(callType, arg(1,"array"))
::class CommonArguments
::method init
use strict arg callType, arguments -- always an array
select
when callType == "COMMAND" & arguments~items == 1 then self~args =
String2Args(arguments[1])
when callType == "SUBROUTINE" & arguments~items == 1 &
arguments[1]~isA(.array) then self~args = arguments[1]
otherwise self~args = arguments
end
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-02 11:58
Message:
I added the *nix version of what believe woll work for this. Please let me
know what you think. If this is acceptable I can code a windows version and
we can discuss that.
David Ashley
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701

Feature Requests item #3493280, was opened at 2012-02-24 09:33
Message generated for change (Comment added) made by wdashley
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interpreter
Group: v4.2.0
>Status: Pending
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: David Ashley (wdashley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Enhancement to rexx.cpp
Initial Comment:
This is mostly aimed at the *nix environment but it might be useful for the Windows environment as well.
In the past we a discussed how the command line invocation of rexx limits the ability of the interpreter to properly give the list of original command line arguments to the interpreter since they will be converted to a single string argument. This sometimes causes problems since the C argument processing can process the arguments in unexpected ways.
What I propose to resolve this problem is to add a new command line option (like -a) that would cause the rexx.cpp to create multiple arguments to be passed to the interpreter, one for each shell/C command line argument. In this way you can force copies of the processed shell/C arguments to the interpreter without any "interpretation" of those arguments needed by the script itself.
If the option is not provided then the single argument string would be processed normally.
David Ashley
----------------------------------------------------------------------
>Comment By: David Ashley (wdashley)
Date: 2012-03-15 08:04
Message:
Implemented in SVN rev 7671 and 7672.
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-15 08:04
Message:
This RFE has been examined, and has been determined to be inline with
the goals of the ooRexx language. This is not a commitment that this
feature will be implemented, but this will remain open until someone in
the ooRexx community chooses to implement the feature.
Any committer who wishes to work on this feature should assign the
feature to themselves when they begin. Any non-committer who wishes to
work on this should indicate their interest by adding a comment to the
RFE.
----------------------------------------------------------------------
Comment By: jfaucher (jfaucher)
Date: 2012-03-12 15:52
Message:
Tested under win32 (winXP).
Two changes to let compile :
old: #include <oorexx.h>
new: #include <oorexxapi.h>
old: LONG rc;
new: INT rc;
Then it works good.
I don't have a win64 to test.
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-12 11:49
Message:
I added a Windows version of the new rexx.cpp. I do not have a Windows
machine available at the moment so could someone try this out for me? It
should work exactly the same as the *nix version.
----------------------------------------------------------------------
Comment By: jfaucher (jfaucher)
Date: 2012-03-07 11:20
Message:
Thanks ! I find it's a good idea to pass the array like that.
Tested in my sandbox under Puppy.
Works good, after these little changes :
...
rxcargs = pgmThrdInst->NewArray(1);
...
pgmThrdInst->DirectoryPut(dir, rxcargs, "SYSCARGS");
...
rc = 0;
if (result != NULL) pgmThrdInst->ObjectToInt32(result, &rc);
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-07 09:54
Message:
I added a new file that changes the rexx.cpp program to use the 4.0 API for
executing the interpreter. This allows the oportunity to set a variable in
the .local environment ("syscargs") that is a Rexx Array that contains the
C arguments from the command line. With this convention your program would
receive the notmal single argument but have the C command line arguments
available from the .local environment.
----------------------------------------------------------------------
Comment By: jfaucher (jfaucher)
Date: 2012-03-07 00:10
Message:
I would prefer to not depend on a user decision to have access to the C
array.
Is it possible to pass both the string and the array to RexxStart ?
That would ensure that legacy code still works, even if the option -a
activated (assuming -a will have an impact on arg(), parse arg, use arg).
Don't know yet how we could access to the array from a Rexx script, but I
have a use case in incubator/DocMusings/transformxml which illustrates the
need.
transformdir.rex and transformfile.rex are two scripts which can be called
from the command line.
transformfile.rex can also be called from transformdir.rex, which passes
arguments "normally", i.e. not as a string.
When the call type is "COMMAND", then the string is splitted in chunks by a
utility which try to manages the whitespaces and quotes as the C runtime.
Otherwise the array of arguments is used as-is.
Assuming the option -a is implemented, I suppose I can receive an array of
more than one element when the call type is "COMMAND".
The code below will support this case, but it remains the case when the
array contains exactly one item. I will need an additional info to decide
if I have to call String2Args or not.
-------------------
parse source . callType me
arguments = .Arguments~new(callType, arg(1,"array"))
::class CommonArguments
::method init
use strict arg callType, arguments -- always an array
select
when callType == "COMMAND" & arguments~items == 1 then self~args =
String2Args(arguments[1])
when callType == "SUBROUTINE" & arguments~items == 1 &
arguments[1]~isA(.array) then self~args = arguments[1]
otherwise self~args = arguments
end
----------------------------------------------------------------------
Comment By: David Ashley (wdashley)
Date: 2012-03-02 11:58
Message:
I added the *nix version of what believe woll work for this. Please let me
know what you think. If this is acceptable I can code a windows version and
we can discuss that.
David Ashley
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3493280&group_id=119701