Solved

Proper functionality of @Leftback

Posted on 2006-06-26
13
587 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

751 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