Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Proper functionality of @Leftback

Posted on 2006-06-26
13
Medium Priority
?
595 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

718 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