Re: text into a tabstopped field
Robert, Richard, Mark, et al: Seriously though, this should be corrected. I am reminded that in Foxpro a plus + can add two numbers AND concatenate 2 strings. Try if x is a number then... Disambiguation then becomes a simple matter of if both x and y are numbers then add them, otherwise concatenate them. Perhaps Foxpro has stronger variable typing than xTalk. 123 and 456 are strings AND numbers in Revolution; so would Foxpro syntax like 123 + 456 resolve to 579 or 123456? -- Rob Cozens CCW, Serendipity Software Company And I, which was two fooles, do so grow three; Who are a little wise, the best fooles bee. from The Triple Foole by John Donne (1572-1631) ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: text into a tabstopped field
Ah hah!! Just as I expected! There IS ambiguity in Transcript... err Revolution!!! ;-) Seriously though, this should be corrected. I am reminded that in Foxpro a plus + can add two numbers AND concatenate 2 strings. How is this the same you ask? Because in both cases the same thing turns out to mean different things based upon context, which means I cannot make a code converter that works 100%. No computer language should even mean 2 different things using one convention. (Anyone at Runrev listening?) Bob Sneidar IT Manager Logos Management Calvary Chapel CM Major Caveat! the item in Rev does not always mean what you may think it should. The number of items in a,b,c,d,e,f,g is 7 The number of items in a,b,c,d,e,f, is 6 The number of items in a,b,c,d,e,, is 6 The number of items in a,, is 6 It is the same with cr's (lines) The trailing comma is not counted as delimiting an empty item. This is true. And it's also worth noting that this might surprise you when using negative indices. So as well as Jims counting examples, get item -1 of a,b, -- returns b whereas when getting and setting items by positive index get item 3 of a,b, -- returns empty (as you'd expect) put a,b, into tLine put d into item 4 of tLine -- leaves tLine as: a,b,,d Best, Mark ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: text into a tabstopped field
Robert Sneidar wrote: Ah hah!! Just as I expected! There IS ambiguity in Transcript... err Revolution!!! ;-) Seriously though, this should be corrected. I am reminded that in Foxpro a plus + can add two numbers AND concatenate 2 strings. How is this the same you ask? Because in both cases the same thing turns out to mean different things based upon context, which means I cannot make a code converter that works 100%. No computer language should even mean 2 different things using one convention. (Anyone at Runrev listening?) There's a striking relevance between the first and last sentence here -- if intended, quite clever. :) The solution is the same for both: before attempting to convert tokens, the context of each instance must be taken into account. With +, this means both operands need to be checked to see if they evaluate to numbers (the is a number operator is good for that). Determining the extents of the expressions which comprise each operand may be difficult or easy, depending on the flexibility of FoxPro (it's been many years since I've programmed in it so I no longer recall). With Transcript, it means every sentence containing it must be read and evaluated by a human to ensure that translating the token won't introduce ambiguity. The popular solution seems simpler: most folks in the Rev community just continue to use Transcript for clarity. :) -- Richard Gaskin Managing Editor, revJournal ___ Rev tips, tutorials and more: http://www.revJournal.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: text into a tabstopped field
Robert- Monday, August 21, 2006, 9:22:19 AM, you wrote: Seriously though, this should be corrected. I am reminded that in Foxpro a plus + can add two numbers AND concatenate 2 strings. How is this the same you ask? Because in both cases the same thing turns out to mean different things based upon context, which means I cannot make a code converter that works 100%. Try if x is a number then... Disambiguation then becomes a simple matter of if both x and y are numbers then add them, otherwise concatenate them. ...and if you think reusing the plus sign is bad, you should see what Ruby does with punctuation... -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: text into a tabstopped field
On 8/19/06 6:52 PM, Mark Smith [EMAIL PROTECTED] wrote: set the itemDelimiter to tab put someInfo into item 2 of line n of fld someField On the other hand, if you're making many updates at once and the field contains a lot of data, it might be more efficient to put the field into a variable, update the variable and then put the variable back into the field. Major Caveat! the item in Rev does not always mean what you may think it should. The number of items in a,b,c,d,e,f,g is 7 The number of items in a,b,c,d,e,f, is 6 The number of items in a,b,c,d,e,, is 6 The number of items in a,, is 6 It is the same with cr's (lines) The trailing comma is not counted as delimiting an empty item. This will throw off you updating algorithm. One answer is to fill a far-right dummy column with '1' or something to insure that you will be updating properly. you could use [a very fast loop for Rev] set the itemdel to tab get fld dbTabList repeat for each line LNN in it put LNN into newLine put 1 into item 20 of newLine --insures 20 tabs minimum put newLine cr after newTabList end repeat filter newTabList without empty Jim Ault Las Vegas On 20 Aug 2006, at 02:33, Mark MacKenzie wrote: Hello. I need to put a DB query result into a RunRev stack field which has tabstops at 62,123,282,467,606,822,911. I don't wish to just put the query result into the field as this overwrites all current information in that field. I just want to update portions of this field. For example I would like to put some information in field SomeField between its first and second tabstops. In some cases the query result would be a single number while in other cases it could be a short phrase. I am stumped. Regards Mark MacKenzie Past Ink Publishing ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: text into a tabstopped field
On 20 Aug 2006, at 09:19, Jim Ault wrote: Major Caveat! the item in Rev does not always mean what you may think it should. The number of items in a,b,c,d,e,f,g is 7 The number of items in a,b,c,d,e,f, is 6 The number of items in a,b,c,d,e,, is 6 The number of items in a,, is 6 It is the same with cr's (lines) The trailing comma is not counted as delimiting an empty item. This is true. And it's also worth noting that this might surprise you when using negative indices. So as well as Jims counting examples, get item -1 of a,b, -- returns b whereas when getting and setting items by positive index get item 3 of a,b, -- returns empty (as you'd expect) put a,b, into tLine put d into item 4 of tLine -- leaves tLine as: a,b,,d Best, Mark ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: text into a tabstopped field
On Aug 20, 2006, at 4:21 AM, Mark Smith wrote: The number of items in a,b,c,d,e,f,g is 7 The number of items in a,b,c,d,e,f, is 6 The number of items in a,b,c,d,e,, is 6 The number of items in a,, is 6 It is the same with cr's (lines) The trailing comma is not counted as delimiting an empty item. This is true. And it's also worth noting that this might surprise you when using negative indices. So as well as Jims counting examples, get item -1 of a,b, -- returns b whereas when getting and setting items by positive index get item 3 of a,b, -- returns empty (as you'd expect) put a,b, into tLine put d into item 4 of tLine -- leaves tLine as: a,b,,d If you think of the delimiter as being after the data, then this makes sense. The 'tween delimiter notion fails. The delimiter after also allows both representation of a single empty item distinct from an empty list of items. The comma operator doesn't support this notion very well, put a loop with 'put it comma after stuff' does. On the other hand I think the following is awkward and others might feel it make sense: put item 3 of (1,2 lf 3,4) ==4 It seems the line end should be an item delimiter along with whatever the current delimiter character is. Dar ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
text into a tabstopped field
Hello. I need to put a DB query result into a RunRev stack field which has tabstops at 62,123,282,467,606,822,911. I don't wish to just put the query result into the field as this overwrites all current information in that field. I just want to update portions of this field. For example I would like to put some information in field SomeField between its first and second tabstops. In some cases the query result would be a single number while in other cases it could be a short phrase. I am stumped. Regards Mark MacKenzie Past Ink Publishing ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: text into a tabstopped field
set the itemDelimiter to tab put someInfo into item 2 of line n of fld someField On the other hand, if you're making many updates at once and the field contains a lot of data, it might be more efficient to put the field into a variable, update the variable and then put the variable back into the field. Best, Mark On 20 Aug 2006, at 02:33, Mark MacKenzie wrote: Hello. I need to put a DB query result into a RunRev stack field which has tabstops at 62,123,282,467,606,822,911. I don't wish to just put the query result into the field as this overwrites all current information in that field. I just want to update portions of this field. For example I would like to put some information in field SomeField between its first and second tabstops. In some cases the query result would be a single number while in other cases it could be a short phrase. I am stumped. Regards Mark MacKenzie Past Ink Publishing ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution