| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Has the ability to assign the same value to several variables been added to ooRexx anywhere along the way? My bet is no (on the basis that I tend to lose all bets, and I want to lose this one). So instead of: A=1; B=1 I could use something like: A,B = 1 I get around this using the mechanism: Parse value 1 1 with A B /* But it's not very elegant */ /* And doesn't handle blanks */ -- Steve Swift http://www.swiftys.org.uk/swifty.html http://www.ringers.org.uk |
|
#2
| |||
| |||
| Steve Swift wrote: > Has the ability to assign the same value to several variables been added > to ooRexx anywhere along the way? My bet is no (on the basis that I tend > to lose all bets, and I want to lose this one). > > So instead of: > A=1; B=1 > > I could use something like: > A,B = 1 > > I get around this using the mechanism: > > Parse value 1 1 with A B /* But it's not very elegant */ > /* And doesn't handle blanks */ > But this DOES handle blanks: Parse value 'two words' with A 1 B 1 C |
|
#3
| |||
| |||
| On Sat, 31 May 2008 08:44:37 +0100, Steve Swift <Steve.J.Swift@gmail.com> wrote: >Has the ability to assign the same value to several variables been added >to ooRexx anywhere along the way? My bet is no (on the basis that I tend >to lose all bets, and I want to lose this one). Let's see. You are betting against this feature having been added because (a) you want the feature added, (b) you tend to lose all best, and (c) you believe that whatever cosmic force it is that casues you to lose bets is powerful enough to cause the feature to materialize because you bet against it. Right? How often does this strategy work for you? >So instead of: >A=1; B=1 > >I could use something like: >A,B = 1 How about a=1; b=a? >I get around this using the mechanism: > >Parse value 1 1 with A B /* But it's not very elegant */ > /* And doesn't handle blanks */ Ugh & yuck. Now I know why you lose so many bets. ;-) |
|
#4
| |||
| |||
| > I could use something like: > A,B = 1 > varList = "A B" Do While varList ^= '' Parse var varList nextVar varList Interpret nextVar " = 1" End |
|
#5
| |||
| |||
| In <Xns9AAF9C591C6A5myport2000yahoocom@127.0.0.1>, on 05/31/2008 at 02:22 PM, Porter Smith <my_port_2000@yahoo.com> said: >varList = "A B" >Do While varList ^= '' > Parse var varList nextVar varList > Interpret nextVar " = 1" >End Why use interpret when value() will do the job? -- Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel> Unsolicited bulk E-mail subject to legal action. I reserve the right to publicly post or ridicule any abusive E-mail. Reply to domain Patriot dot net user shmuel+news to contact me. Do not reply to spamtrap@library.lspace.org |
|
#6
| |||
| |||
| Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid> wrote in news:4841f08b$1$fuzhry+tra$mr2ice@news.patriot.net : > In <Xns9AAF9C591C6A5myport2000yahoocom@127.0.0.1>, on 05/31/2008 > at 02:22 PM, Porter Smith <my_port_2000@yahoo.com> said: > >>varList = "A B" >>Do While varList ^= '' >> Parse var varList nextVar varList >> Interpret nextVar " = 1" >>End > > Why use interpret when value() will do the job? > Because I didn't think of it? ![]() |
|
#7
| |||
| |||
| Three Lefts wrote: > How about a=1; b=a? Yes, that will be better than what I have right now, which is: DT.0 = 5 DV.0 = 5 Whenever I change the 5 to a 6, I have to change both, and it causes problems if I forget. >> Parse value 1 1 with A B /* But it's not very elegant */ /* And doesn't handle blanks */ > Ugh & yuck. Now I know why you lose so many bets. ;-) The original challenge was to set two variables in one statement, during the early days of REXX development. It might have come from MFC, but I have no way to confirm this. -- Steve Swift http://www.swiftys.org.uk/swifty.html http://www.ringers.org.uk |
|
#8
| |||
| |||
| In article <48455de8@news.greennet.net>, Steve Swift <Steve.J.Swift@gmail.com> wrote: >Yes, that will be better than what I have right now, which is: > DT.0 = 5 > DV.0 = 5 >Whenever I change the 5 to a 6, I have to change both, and it causes >problems if I forget. For your specific case (not in general) I would suggest: DT.0 = 5 DV.0 = DT.0 -- Rich Greenberg N Ft Myers, FL, USA richgr atsign panix.com + 1 239 543 1353 Eastern time. N6LRT I speak for myself & my dogs only. VM'er since CP-67 Canines:Val, Red, Shasta & Casey (RIP), Red & Zero, Siberians Owner:Chinook-L Retired at the beach Asst Owner:Sibernet-L |
|
#9
| |||
| |||
| On Mon, 2 Jun 2008 15:37:09 +0000 (UTC), Rich Greenberg wrote: > In article <48455de8@news.greennet.net>, > Steve Swift <Steve.J.Swift@gmail.com> wrote: > >>Yes, that will be better than what I have right now, which is: >> DT.0 = 5 >> DV.0 = 5 >>Whenever I change the 5 to a 6, I have to change both, and it causes >>problems if I forget. > > For your specific case (not in general) I would suggest: > > DT.0 = 5 > DV.0 = DT.0 Or, : |Changeable_Value = 5 : : : |DT.0 = Changeable_Value : : : |DV.0 = Changeable_Value Jonesy -- Marvin L Jones | jonz | W3DHJ | linux 38.24N 104.55W | @ config.com | Jonesy | OS/2 *** Killfiling google posts: <http://jonz.net/ng.htm> |
|
#10
| |||
| |||
| Rich Greenberg schrieb: > In article <48455de8@news.greennet.net>, > Steve Swift <Steve.J.Swift@gmail.com> wrote: > >> Yes, that will be better than what I have right now, which is: >> DT.0 = 5 >> DV.0 = 5 >> Whenever I change the 5 to a 6, I have to change both, and it causes >> problems if I forget. > > For your specific case (not in general) I would suggest: > > DT.0 = 5 > DV.0 = DT.0 > That is not was he will. DT.0 = 5 DV.0 = DT.0 DT.0 = 6 say DV.0 DT.0 and you can see that DV.0 = 5 , not 6 ! Pit |
![]() |
| 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.