Solved

Proper functionality of @Leftback

Posted on 2006-06-26
13
573 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

759 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

20 Experts available now in Live!

Get 1:1 Help Now