![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have some code with statements like: what="sometable" use (what) select * from (what) select * from othertable into cursor (what) ? &what..somecolumn Is it possible to get rid of that & use? I would like to write ? (what).somecolumn but that is not legal syntax and ? what->somecolumn is not valid because what is not a object. Sincerely, Gene Wirchenko Computerese Irregular Verb Conjugation: I have preferences. You have biases. He/She has prejudices. |
#3
| |||
| |||
|
|
Try with: ?EVALAUTE(what+"."+SomeColumn) HTH ----------------------- Espartaco Palma SysOp www.PortalFox.com Mexico Gene Wirchenko wrote: I have some code with statements like: what="sometable" use (what) select * from (what) select * from othertable into cursor (what) ? &what..somecolumn Is it possible to get rid of that & use? I would like to write ? (what).somecolumn but that is not legal syntax and ? what->somecolumn is not valid because what is not a object. Sincerely, Gene Wirchenko Computerese Irregular Verb Conjugation: I have preferences. You have biases. He/She has prejudices. |
#4
| |||
| |||
|
|
"Esparta Palma" <espartaQUITAESTOPRIMERO (AT) softhome (DOT) net> wrote in message news:uLR6Ef%235EHA.2600 (AT) TK2MSFTNGP09 (DOT) phx.gbl... Gene Wirchenko wrote: I have some code with statements like: what="sometable" use (what) select * from (what) select * from othertable into cursor (what) ? &what..somecolumn Is it possible to get rid of that & use? I would like to write ? (what).somecolumn but that is not legal syntax and ? what->somecolumn is not valid because what is not a object. Try with: ?EVALAUTE(what+"."+SomeColumn) |
|
You could also use the scatter function SELECT (What) SCATTER NAME loRecord MEMO ?loRecord.SomeColumn The scatter to array is also possible, but the fields names are lost because the values are placed inside an array. SCATTER MEMVAR can also be used. |
|
Another posibility is not specifying the alias: SELECT (What) ?SomeColumn This works provided you 're absolutely sure the alias is selected as the current alias. Point of warning is to have some kind of naming convention so that the field value isn't mixed up with an existing variable (the field has the precedence unless you're using the 'm.'-prefix) |
#5
| |||
| |||
|
|
I have some code with statements like: what="sometable" use (what) use (what) alias Mydbffile |
|
select * from (what) select * from othertable into cursor (what) select * ... into cursor mydbf ? &what..somecolumn Is it possible to get rid of that & use? I would like to write ? (what).somecolumn but that is not legal syntax and ? what->somecolumn is not valid because what is not a object. Sincerely, Gene Wirchenko Computerese Irregular Verb Conjugation: I have preferences. You have biases. He/She has prejudices. |
#6
| |||
| |||
|
|
I have some code with statements like: what="sometable" use (what) select * from (what) select * from othertable into cursor (what) ? &what..somecolumn Is it possible to get rid of that & use? I would like to write ? (what).somecolumn but that is not legal syntax and ? what->somecolumn is not valid because what is not a object. Sincerely, Gene Wirchenko Computerese Irregular Verb Conjugation: I have preferences. You have biases. He/She has prejudices. |
#7
| |||
| |||
|
|
I have some code with statements like: what="sometable" use (what) use (what) alias what |
|
select * from (what) select * from othertable into cursor (what) select * ... into cursor what ? &what..somecolumn ? what.somecolumn |
|
Is it possible to get rid of that & use? I would like to write ? (what).somecolumn but that is not legal syntax and ? what->somecolumn is not valid because what is not a object. Sincerely, Gene Wirchenko Computerese Irregular Verb Conjugation: I have preferences. You have biases. He/She has prejudices. |
#8
| |||
| |||
|
|
"Sietse Wijnker" <sietse.wijnker (AT) ATsw-software (DOT) nl> wrote: "Esparta Palma" <espartaQUITAESTOPRIMERO (AT) softhome (DOT) net> wrote in message news:uLR6Ef%235EHA.2600 (AT) TK2MSFTNGP09 (DOT) phx.gbl... Gene Wirchenko wrote: I have some code with statements like: what="sometable" use (what) select * from (what) select * from othertable into cursor (what) ? &what..somecolumn Is it possible to get rid of that & use? I would like to write ? (what).somecolumn but that is not legal syntax and ? what->somecolumn is not valid because what is not a object. Try with: ?EVALAUTE(what+"."+SomeColumn) The idea is to have short easy-to-use reference. Putting two or more of those in a statement would make it nearly unreadable. Even one is not a picnic. (I have used this approach in the past.) You could also use the scatter function SELECT (What) SCATTER NAME loRecord MEMO ?loRecord.SomeColumn The scatter to array is also possible, but the fields names are lost because the values are placed inside an array. SCATTER MEMVAR can also be used. I realised that I left something out from my OP. I am trying to get one easy-to-use reference. Because many of my uses require a character string, it has to be that, but that one that needs an object reference currently must have &. Another posibility is not specifying the alias: SELECT (What) ?SomeColumn This works provided you 're absolutely sure the alias is selected as the current alias. Point of warning is to have some kind of naming convention so that the field value isn't mixed up with an existing variable (the field has the precedence unless you're using the 'm.'-prefix) No, I can not guarantee that. This use is in exactly those cases where I may be dealing with more than one table or cursor at once. I think I have found a chink in VFP syntax. Sincerely, Gene Wirchenko Computerese Irregular Verb Conjugation: I have preferences. You have biases. He/She has prejudices. |
![]() |
| Thread Tools | |
| Display Modes | |
| |