Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Proper functionality of @Leftback

Posted on 2006-06-26
13
Medium Priority
?
599 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
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 500 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

885 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