I would like to know if there is a mechanism to be able to access OOREXX
variables by name / to bind REXX variables to a third party program. I have
created my own version of Pipelines that I want to develop a VAR stage for; so
that I can use it in a OOREXX script/program. Any suggestions would be
My development can be found here: www.tenfiftytwo.co.uk/pipelines
OK - after a great deal of re-structuring (and I must acknowledge the pivitol
help by J. Johnson and his execllent implementation of PC-Pipelines) I have
been able to develop the VAR, STEM and ARRAY stages and to implement an
initial 'alpha - possibly' version of Pipelines for ooRexx. It is - to be
honest - limited in it's emulation of CMS Pipelines (and for all you CMS
Pipelines aficianados - the best I have right now).
If you would be interested in giving it a knock around - test it to
destruction ( provide feedback on what is good and what is not) please let me
know. I'll send you the link.
A quick question. What is the difference between these two examples?
'mycommand with lots',
'and lots', / a comment /
/ a comment /
The first example is just fine .. however the second example results in the
truncation of mycommand at the start of the comment. Any pointers would be
I have returned to Pipelines after a very long time away..and I have a new question.
Is the following array definition legal? and if not, should it be flagged up by the interpreter as illegal?
myarray. = .array~new(4)
I ask, as currently it is not flagged as an illegal array name, and further on down the line, it appears that when trying to update an element in myarray. (programmatically through your API);
RexxObjectPtr p = pExitContext->GetContextVariable( pszName )
appears to return a pointer to stem object (the API seems to consider the period in the variable name to signify that it is a stem) and not an array object. And then, a subsequent call to update the modified element in the array;
pExitContext->ArrayPut( ( RexxArrayObject ) p, str, nIndex )
causes a protection exception.
Any help or pointers would be appreciated.
The presence of the trailing period does indeed tell the API to look up the stem variable, which is why you are getting a stem object back. Your name should not have a period because the array object reference is stored in the variable "MYARRAY". The protection exception is occurring because you are passing a non-array object reference to ArrayPut.
Thanks Rick I understand that, and the example was deliberate. The reason I ask is that I wanted to avoid the need to validate both ooRexx stem and array names from within Pipelines. I was hoping that ooRexx would flag up an invalid assignment before it ever reached my code.
Does that mean that I will have to implement my own ooRexx variable name validation routines to be sure of handing what the user is free to create/assign?
That is a valid assignment in ooRexx, it is setting the default value for the stem myArray. to the newly created array.
You can try implementing your own variable checking, but I believe a better approach would be to use the APIs IsArray() and IsStem() to verify that you got an instance of the expected object type back from the variable and use that to raise an error. In fact, there is no requirement that a stem object be stored in a stem variable, so it would be nice if your STEM stage accepted simple variables as well. As long are the variable returned a stem object instance, that will work.
Thanks Rick. I am just trying to cover all my bases and rationalise what the user 'perceives' to be being created and assigned and to provide meaning errors in Pipelines when handing ooRexx variables. I do realise that it is valid a statement - I guess that I just need to accept that someone might actually want to create assigments that might ordinarily seem bonkers - they are the user afterall and I cannot anticipate everything..
Ill look at using the IsArray() and IsStem()
Log in to post a comment.