Solved

Proper functionality of @Leftback

Posted on 2006-06-26
13
577 Views
Last Modified: 2013-12-18
In the documentation of Lotus Notes 6.5.4 the description for entering a number as the second parameter for atLeftBack is as follows:
"
numToSkip
Number. Counting from right to left, the number of characters to skip. All the characters to the left of that number of characters are returned. If the number is negative, the entire string is returned.
"

However when used in Notes and given a negative number with @LeftBack, nothing is returned...  

So which is the proper functionality?

Thanks!
0
Comment
Question by:TheRookie32
  • 6
  • 5
  • 2
13 Comments
 
LVL 18

Expert Comment

by:marilyng
ID: 16985439
Here is a string

to return "Here"
@leftback(1;string; 4)

To return everying left of "string"
@leftback(1;string; "string")

I think.  Not at a notes computer, so can't tell you the exact syntax, I know there a start? (or maybe that's in script)

Is it:  Start, String, Number?
or just: String, Number?

I'm sure someone on a Notes Computer will pitch in if my syntax is wrong.

0
 
LVL 6

Author Comment

by:TheRookie32
ID: 16985497
Here's the whole article from the help file:
"
Returns the rightmost characters in a string.

Syntax:

@RightBack( stringToSearch ; numberOfChars )
@RightBack( stringToSearch ; subString )

Parameters:

stringToSearch - Text. The string whose rightmost characters you want to find.

numberOfChars - Number. Counting from left to right, the number of characters to skip. All the characters to the right of that number are returned.

subString - Text. A substring of stringToSearch. @RightBack returns all the characters to the right of subString.  It finds subString by searching stringToSearch from right to left.

Return value:
resultString - Text. The rightmost characters in stringToSearch. The number of characters returned is determined by either numberOfChars or subString.
"
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16985578
OK -

string:="Here is a string";

to return "Here"
@leftback(string; 4)

To return everying left of "string"
@leftback(string; "string")

This will return nothing:

@leftback(string; "Here")

this will return "Here "
@leftback(string; "is")

------------
You didn't get this when you tested?  It's the same as @Left ?  (or so I thought)
0
 
LVL 6

Author Comment

by:TheRookie32
ID: 16985762
No I am saying that the notes documentation states that when a negative number is passed for the numberofchars, the whole string should be returned...

But when actualy used, nothing is returned.

ie:  @LEFTBACK("What will i get?", -10)

according to notes documentation, the result should be:  What will i get?

What notes actually returns as the result:

(nothing)

So is the documentation wrong or is it a bug in notes 6.5.4?
0
 
LVL 14

Expert Comment

by:p_partha
ID: 16986943
HI Rookie32
In r5
numToSkip
Number. Counting from right to left, the number of characters to skip. All the characters to the left of that number of characters are returned.

In R6
numToSkip
Number. Counting from right to left, the number of characters to skip. All the characters to the left of that number of characters are returned. If the number is negative, the entire string is returned

But you are right, it doesn't return the entireString if the number is negative, if you have a condition where u want to return the entire string , just use the fieldname itself.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16987107
partha -- lol!!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Author Comment

by:TheRookie32
ID: 16987621
The reason i am asking is that I am creating a javascript library that with functions that mimic the behavior of the at @ functions in Notes, so i needed to know the exact behavior of each and what happens to them if you put in negatives, 0's, special characters etc...  (atLeft, at Right, at Middle etc...)
0
 
LVL 14

Expert Comment

by:p_partha
ID: 16987725
Rookie32,
Just google it you might find all the string functions, you might be reinventing the wheel...

Partha
0
 
LVL 6

Author Comment

by:TheRookie32
ID: 17014527
Bit late for that (and i did try googling them) as we are almost done.  It was also an excercise to get me better at javascript and it certainly helped me learn these functions better!  Did either of you decide which was the proper way for @LEFTBACK to behave when given a negative?  
0
 
LVL 18

Expert Comment

by:marilyng
ID: 17015380
It returns nothing.   Both @Rightback and @leftBack return nothing when the number is negative.  

But you're right in that the documentation says it should return everything.

I also need to find a back door... :)

string:="Here is a string";
to return "Here is a st"
@leftback(string; 4)

DUH!
0
 
LVL 6

Author Comment

by:TheRookie32
ID: 17019426
I dont really appreciate the "Duh" part of your comment as I know how @leftback and @rightback and all the rest function...

My question remains:

Is the documentation correct on the function returning the whole string if a negative number is passed, and this means the program has an error?

-or-

Is the documentation wrong and is should actually say "nothing is what should be returned when a negative number is passed"?  (as opposed to it saying the whole string is returned)

thanks!
0
 
LVL 18

Accepted Solution

by:
marilyng earned 125 total points
ID: 17021036
The "DUH,"  was for me.. I made stupid mistake when posting.   Apologies, didn't intend it for you.

The documentation seems wrong. It returns nothing when negative number is passed.
0
 
LVL 6

Author Comment

by:TheRookie32
ID: 17021175
Thats completely ok...  It is very easy to misread stuff which is typed.  (I had a friend who would get in arguments with his girlfriend for hours on IM when a phone call could have cleared up the mis-communication... but i digress.)  ;)

And thanks!  The tech writer needs to bashed for the mistake with this and his lack of useful examples in other areas.  ;)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now