The + is a combination function used in Rbase when defining variables.  It is 
also the default 
continuation character.  They are two completely separate functions.   

In setting variables if I want to "add" two text values, I have to tell Rbase 
what the two values 
are, what to do with them and how I want them processed.   The + signs tells 
Rbase I am
adding two values together.  

For example:
Set var vText1 = "This is a Text variable"   -- establishes a variable with a 
text type 
Set var vText2 = "and it works well"  --same type of command as the above.

Set var vCombined = (.vText1 + .vText2)  --combines the two text variables into 
one without an added space
between.  vCombined now equals "This is a Text variableand it works well"  

Note that there are no spaces between the two values when combined!

However:
Set var vCombined = (.vText1 & .vText2)
The value of vCombined is now "This is a Text variable and it works well"

The + and & variable functions allow you to tell Rbase what and how you want 
multiple variables 
to be combined.  The + does not insert a space, while the & does insert a space 
between the values.

However, + is also the default continuation character, meaning that if it is 
used as the last character
of a command line, then Rbase will continue the command to the next line.

Example:

R:>Project temp TempTab +
from MainTable +
using all +
where CustID >= 100   

Rbase will process the above as one single line command if this is ran in a 
command file.

Now, if you are defining a long variable and have to move to the next line, you 
may have two + signs.
The first will tell Rbase that you are combining values into one variable and 
the second will tell it that
the command line is continuing to the next line.

Example:

Set var vText1 = ('A text string is being added ' + +
 ' to a second text string and then ' +  +
' a third')

The first + in each line is telling Rbase to add the text strings together 
without spaces added and the 
second + is telling Rbase the command is continuing to the next line.  In this 
case, I added the spacing
at the first of each text string myself.  I could have used & +  and Rbase 
would have added a space in
for me.

Hope that helps.
-Bob


----- Original Message ----- 
  From: Michael J. Sinclair 
  To: RBASE-L Mailing List 
  Sent: Sunday, December 13, 2009 7:43 PM
  Subject: [RBASE-L] - Help with syntax, why do i need ' + .vstartdrive + '


  Hi All,
  I hope this it not too basic of a question. I got some help with a plugin 
that needed to change one parameter by having that parameter replaced with a 
variable. I now understand that I have to turn the whole command into a string 
and then use an &variable to fire the command string. So far so good. What I 
don't understand is why I need to have a "+" sign before and after the variable 
inside quotes. How does rbase interpret, |path_name ' + .vstartdrive + ' +   ??

  Why not just |path_name .vstartdrive +

  or 

  Why not |path_name '.vstartdrive' +

  What do the two extra "+" signs do??

  --this works just fine, I just don't know why it works.....
  SET V vstartdrive = .vfromdrive
  SET VAR vcommand = ('PLUGINS LoadDirectoryName.rbl vfromdrive +
  |fullpath on +
  |TITLE where are the unfiled docs? +
  |path_name ' + .vstartdrive + ' +
  |delete_button on +
  |context_menus on +
  |read_only off +
  |ole_drag on +
  |ole_drop on +
  |create_folder_icon on +
  |delete_folder_icon on')
  &vcommand

  Thanks!
  Mike

Reply via email to