Am I just having a brain fart? I have a situation where I have a field that needs to return just one space, or a value that has a space before and after it.
In the text ==> I am<field>going to the office. <-- notice no space between am, <field> and going
I want it to say if FALSE, then "I am *not* going to the office."
If true, then "I am going to the office."
If true, I'm simply RETURN(""); <-- This returns a blank space
If FALSE, I have tried:
RETURN(" " & ret & " ");
This returns "I am notgoing to the office". <-- Notice no blank space after "not"?
ret2=(" " & ret);
RETURN(Insert(ret2, 3, " "));
Still the same result. What's strange is, if I do a RETURN(Insert(ret2, *2*, " "));, then it returns "I am no tgoing to the office" <-- Notice the space between the "o" and the "t"?
Try this option, just a minor change to what Sruthi suggested. Just add space before and after the text which you want to add through script.
X = " "
X=" not "
INSERT Function: Try doing this, because space is also being calculated so including space it takes 4 chars and after 4th char it inserts space.
RETURN(Insert(ret, 4, " "));
Let me know your results.
Thank you but I am aware of that. I can't do that because this <field> is going to be used in many situations and I don't know if " going" is always the correct text that's coming next.
I will try that again today with my co-workers. I believe we tried that and it didn't work though. I'll let you guys know. thanks.
Trailing spaces are often removed from data. In your case, the easiest thing to do will be to use what is called the "hard space" character instead of a "real" space. This is key code ALT+0160. For all intent and purposes, it looks like a space and will print as a space, but since it is not technically the space (0032) character, it will not be trimmed from your projects. Just open the quotes, turn off the NUMLOCK and hold down the ALT key and type 0160 and then release the ALT key. This will add the hard space into your string. Then if you are like me, you will have to remember to turn the NUMLOCK back on.
" not "
I'm not sure how this will post into this message, but the example above is using hard space characters.
Edited by: user9976634 on Dec 5, 2012 12:52 PM