Page 2 of 2
Posted: Thu Oct 22, 2009 8:00 am
by mwieder
It's been a while since I've had to mess with VB, but from memory:
runrev:
Code: Select all
put "def" into field "t1"
put "abc" before field "t1"
put "xyz" after field "t1"
Visual Basic:
Code: Select all
t1.text = "def"
t1.text = "abc" + t1.text
t1.text = t1.text + "xyz"
Posted: Thu Oct 22, 2009 11:21 pm
by urbaud
Hi wimeir,
Thank you for reminding me of the VB code. It too has been awhile since I dabbled in VB. I believe the VB code is more an example of concatenation. As you well know Rev has the ability to have numbers, text and calculations all within a variable. I don't believe VB can do that. VB would have to have separate variables for numbers and text otherwise it would produce a datatype error.
As you know Rev can do this:
Code: Select all
on mouseUp
put 1 into container
put 3 after container
put e after container
put 3+1 after container
put "dan" before container
put "XZ" after char 5 in container
put 4*5 after container
put " " after char 6 in container
put container into fld "l1"
end mouseUp
Output: dan13X Ze420
I have found the discussion about my declining balance problem and subsequent chunk expression discussion most helpful. I feel much more confident and knowledgeable about chunk expressions. I really appreciate your comments and suggestions. Also, if Andrew is reading this, thanks Andrew for your input.
Best Regards, Dan
Posted: Fri Oct 23, 2009 1:10 am
by mwieder
Dan-
You ain't seen nothing yet.
Try something like
Code: Select all
replace "Ze" with the quote & short name of me & quote in container
I used to think that, despite its drawbacks, Basic's main strength lay in string manipulation. But you really have to go way out of your way to code things in Basic that are powerful one-liners in rev: things like the replace function, substring management, the merge function, etc.
Posted: Fri Oct 23, 2009 1:13 am
by mwieder
...and by the way, the "sort field t1 descending" line was supposed to be applied *after* your original loop put things into the "wrong" order. A simple sort statement sets things aright afterwards...