| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| The code below gets a syntax error on the last line. The error message is: err10.2: Unexpected or unmatched END If I remove the "i" leaving just "End", the error goes away and the code runs correctly. This looks like a bug. That "End i" statement should match the "Do i over b.", no? a.1=123 a.2="imbedded blank" a.3=" leading & trailing blanks " a.4="!@#$%^&*()" a.5=" " a.6="a.6" a.7="." a.0=7 /* Display the indices and assign the values to b. */ Say; Say "These are the indices:" Do i=1 to a.0 /* Loop thru a.i */ Say "a."i"=|"a.i"|" /* Display the indices */ j=a.i /* Get the index in a simple variable */ b.j=a.i /* Assign the next b. value */ End i /* Display the values in b. using Do over */ Say; Say "These are all of the values in b.i using Do Over:" Do i over b. /* Loop thru b. using Do Over */ Say "b.|"i"|=|"b.i"|" End i |
|
#2
| |||
| |||
| No! Just use: do ..... end "Snotty Wafflelips" <Snotty@Wafflelips.unk> wrote in message news:4hp1b45fmepl4msakit1i8jpifbl3m7oma@4ax.com... > The code below gets a syntax error on the last line. > The error message is: > err10.2: Unexpected or unmatched END > > If I remove the "i" leaving just "End", the error goes away and the > code runs correctly. > > This looks like a bug. That "End i" statement should match the "Do i > over b.", no? > > > a.1=123 > a.2="imbedded blank" > a.3=" leading & trailing blanks " > a.4="!@#$%^&*()" > a.5=" " > a.6="a.6" > a.7="." > a.0=7 > > /* Display the indices and assign the values to b. */ > Say; Say "These are the indices:" > Do i=1 to a.0 /* Loop thru a.i */ > Say "a."i"=|"a.i"|" /* Display the indices */ > j=a.i /* Get the index in a simple variable */ > b.j=a.i /* Assign the next b. value */ > End i > > /* Display the values in b. using Do over */ > Say; Say "These are all of the values in b.i using Do Over:" > Do i over b. /* Loop thru b. using Do Over */ > Say "b.|"i"|=|"b.i"|" > End i |
|
#3
| |||
| |||
| On Tue, 26 Aug 2008 18:48:27 GMT, "Dan van Ginhoven" <danfan46@hotmail.com> wrote: >No! No, what? It's not a bug? >Just use: >do >.... >end I need to use "Do i Over x." to get all of the values assigned to that stem. If you meant just use: Do i over x. ... End That's what I am doing. But why does it get an error if I put the "i" on the End statement? >"Snotty Wafflelips" <Snotty@Wafflelips.unk> wrote in message news:4hp1b45fmepl4msakit1i8jpifbl3m7oma@4ax.com... >> The code below gets a syntax error on the last line. >> The error message is: >> err10.2: Unexpected or unmatched END >> >> If I remove the "i" leaving just "End", the error goes away and the >> code runs correctly. >> >> This looks like a bug. That "End i" statement should match the "Do i >> over b.", no? >> >> >> a.1=123 >> a.2="imbedded blank" >> a.3=" leading & trailing blanks " >> a.4="!@#$%^&*()" >> a.5=" " >> a.6="a.6" >> a.7="." >> a.0=7 >> >> /* Display the indices and assign the values to b. */ >> Say; Say "These are the indices:" >> Do i=1 to a.0 /* Loop thru a.i */ >> Say "a."i"=|"a.i"|" /* Display the indices */ >> j=a.i /* Get the index in a simple variable */ >> b.j=a.i /* Assign the next b. value */ >> End i >> >> /* Display the values in b. using Do over */ >> Say; Say "These are all of the values in b.i using Do Over:" >> Do i over b. /* Loop thru b. using Do Over */ >> Say "b.|"i"|=|"b.i"|" >> End i > |
|
#4
| |||
| |||
| Snotty Wafflelips wrote: > That's what I am doing. But why does it get an error if I put the "i" > on the End statement? Because you don't put anything after the "end". After Iterate, or leave, perhaps, but after "end", no. -- Steve Swift http://www.swiftys.org.uk/swifty.html http://www.ringers.org.uk |
|
#5
| |||
| |||
| Steve Swift wrote: > Snotty Wafflelips wrote: >> That's what I am doing. But why does it get an error if I put the "i" >> on the End statement? > > Because you don't put anything after the "end". After Iterate, or leave, > perhaps, but after "end", no. > > Not true. The End instruction has always allowed one to specify the name of the control variable on the matching DO. Originally, this only applied to the "DO i = xxx" form, but in ooRexx at least (the first implementation to have DO OVER), this also applied to the control variable specified on DO OVER. Reginald appears not to have implemented that, but only the Reginald author can determine whether that's a "bug" or a "working as designed" item. Rick |
|
#6
| |||
| |||
| On Wed, 27 Aug 2008 15:34:44 +0100, Steve Swift <Steve.J.Swift@gmail.com> wrote: >Snotty Wafflelips wrote: >> That's what I am doing. But why does it get an error if I put the "i" >> on the End statement? > >Because you don't put anything after the "end". After Iterate, or leave, >perhaps, but after "end", no. Not true. In the original VM Rexx, the syntax for any Do statement that had an index was: Do index = ... ...body of do loop... End index This allowed the interpreter to match the End with the right Do, a big help in debugging. There was some discussion in the interal Rexx architecture group about adding a "tag" parameter to all Do statements so that the End statement could be matched even if there was no index: Do forever tag=xyz ...body of do loop... End xyz This was not adopted. In my opinion, Do i Over stem does have an index and so should allow the index on the End statement. |
|
#7
| |||
| |||
| On Wed, 27 Aug 2008 10:45:04 -0400, Rick McGuire <object.rexx@gmail.com> wrote: >Steve Swift wrote: >> Snotty Wafflelips wrote: >>> That's what I am doing. But why does it get an error if I put the "i" >>> on the End statement? >> >> Because you don't put anything after the "end". After Iterate, or leave, >> perhaps, but after "end", no. >> >> >Not true. The End instruction has always allowed one to specify the >name of the control variable on the matching DO. Originally, this only >applied to the "DO i = xxx" form, Yep >but in ooRexx at least (the first >implementation to have DO OVER), this also applied to the control >variable specified on DO OVER. Reginald appears not to have implemented >that, but only the Reginald author can determine whether that's a "bug" >or a "working as designed" item. The choices are "bug" or "BAD" (Broken As Designed). ;-) The Reginald User Forum (http://nnnn.3322.org/?a=f&b=1) has not been down for at least a week and Jeff Glatt does not appear to be responding to questions here, either, so I guess we'll never know. It's too bad. I had such high hopes for a Rexx implementation with GUI tools, a modern IDE, and interfaces to database, ZIP, etc. Maybe I have to go back to VB. (sigh) |
|
#8
| |||
| |||
| Snotty Wafflelips wrote: > On Wed, 27 Aug 2008 15:34:44 +0100, Steve Swift > <Steve.J.Swift@gmail.com> wrote: > >> Snotty Wafflelips wrote: >>> That's what I am doing. But why does it get an error if I put the "i" >>> on the End statement? >> Because you don't put anything after the "end". After Iterate, or leave, >> perhaps, but after "end", no. > > Not true. In the original VM Rexx, the syntax for any Do statement > that had an index was: > > Do index = ... > ...body of do loop... > End index > > This allowed the interpreter to match the End with the right Do, a big > help in debugging. > > There was some discussion in the interal Rexx architecture group about > adding a "tag" parameter to all Do statements so that the End > statement could be matched even if there was no index: > > Do forever tag=xyz > ...body of do loop... > End xyz > > This was not adopted. This is available in ooRexx 3.2.o with the label keyword on DO instructions. This matches the syntax that Mike Cowlishaw used with his NetRexx implementation. Do label xyz forever ...body of the do loop End xyz The label option is also available on Select and simple Do blocks, which allows you to use the Leave instruction to break out of those as well. Rick > > In my opinion, Do i Over stem does have an index and so should allow > the index on the End statement. |
|
#9
| |||
| |||
| On Wed, 27 Aug 2008 08:46:17 -0700, Snotty Wafflelips <Snotty@Wafflelips.unk> wrote: <vctab45cebbu6ssred0jtmif2js4ldjti1@4ax.com> > ...and Jeff Glatt does not appear to be responding to questions here, either... Perhaps he's trying to decide if someone who bills him/her/itself as "Snotty Wafflelips" is serious. (change Arabic number to Roman numeral to email) |
|
#10
| |||
| |||
| On Thu, 28 Aug 2008 17:34:33 -0400, Frank Clarke <m5srexx@tampabay.rr.com> wrote: >On Wed, 27 Aug 2008 08:46:17 -0700, Snotty Wafflelips <Snotty@Wafflelips.unk> >wrote: ><vctab45cebbu6ssred0jtmif2js4ldjti1@4ax.com> > >> ...and Jeff Glatt does not appear to be responding to questions here, either... > >Perhaps he's trying to decide if someone who bills him/her/itself as "Snotty >Wafflelips" is serious. Have you been to his website? It's riddled with in-your-face comments and rough humor. It would be hard to imagine that he would be put off by a name. Do you find Snotty Wafflelips less serious than, say, "Frodo Baggins", "Nobody", "Top Spin", "LurfysMa", "Crazy Horse", "Elmer Fudd", "CyberSimian", or "sillyhat"? And that's just some of the names that have been used on this group. In any case, I doubt that my screen name caused his user forum page to be down for going on two weeks that I know of. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.