Normal Topic ASCII Text Equivalents (Read 1122 times)
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
ASCII Text Equivalents
Nov 3rd, 2005 at 11:29am
Print Post Print Post  
Hi -

It seems to me that in Q&A, we could work with ASCII text equivalents (and use them in retrieve specs) ... although I don't remember how.  I believe we had to press the alt and F10 keys and then enter the code.

In any event, I would like to know whether we can work with ascii code equivalents in Sesame.

Suppose for example, I want to enter a "Registered trademark sign" ® in a field in a database (ASCII code equivalent & #174).  Can I do this (other than copying and pasting it, which I know I can do)?

In a like manner, suppose I want to create a retrieve spec for my phone number fields to search for any fields that might contain a "letter"  (& #065 through & #090 for Capital letters or & #097 through & #122 for small letters), can I do this?

Note:  In the actual ASCII equivalent there would be no space between the & and #; however, I had to do it here so that it wasn't replaced with the letter it represents   Roll Eyes

Also (especially in the event it is not possible) is there a way to force programming for @instr to be case sensitive?  For example, the name of my company is Silver sOlutionS of Tampa, Inc. (since I wanted emphasis placed on the letters SOS).   IF someone were to enter Silver Solutions of Tampa, Inc., I would want programming to force a change (in the word Solutions) from So to sO and from ns to nS.  (I know that I could replace EVERY instance of silver solutions (no matter how it is entered) with Silver sOlutionS; however, I am just curious whether I could "test" for the case condition.

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: ASCII Text Equivalents
Reply #1 - Nov 3rd, 2005 at 3:30pm
Print Post Print Post  
Hello Spencer,

For the special characters there is a chart in the FAQ at http://www.lantica.com/Support/KBase/sesame_faq.html that shows how to make them

For the search, I believe something like ">a & <zzzzzzz" (without the quotes) would work. I could be wrong about this.

You can loop through a string and use @Asc() to see what a character is and the case of that character. So you can see if the 9th character of 'Silver sOlutionS of Tampa, Inc' is a 111 instead of a 79.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: ASCII Text Equivalents
Reply #2 - Nov 3rd, 2005 at 5:22pm
Print Post Print Post  
Hi Ray -

The information you gave me was very helpful for most of my concerns.  Your response also led me to Appendix 4 of the Programming Guide which provides a wealth of additional helpful information.

Unfortunately, I am still having problems with the retireve spec and if I could get more difinitive help on that point, it would be appreciated.

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: ASCII Text Equivalents
Reply #3 - Nov 4th, 2005 at 7:36pm
Print Post Print Post  
Hello Spencer,

Two ways, that I can think of right now, you can make that retrieve spec. I'm sure there are others.

1. Retrieve all your records. Run a Mass Update on them. The mass update parses out the phone number field and looks for any alpha characters. If none are found then it removes the record from the result set. Is some Alpha characters are found then if advances to the next record.

2. A programmed retrieve spec with 26 @Instr() calls in it. One for each letter in the alphabet.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: ASCII Text Equivalents
Reply #4 - Nov 5th, 2005 at 1:36am
Print Post Print Post  
Ray -

I'm not sure about how to do the mass update and, in any event, I think I would be uncomfortable with that.

I had already realized that I could use a programmed retrieve spec with 26 calls but was trying to avoid all that labor.

That's why I was hoping I could do a programmed retrieve spec referring to the ascii codes
  >= 65 and  <=90  or
  >= 97 and <= 122
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: ASCII Text Equivalents
Reply #5 - Nov 5th, 2005 at 2:23pm
Print Post Print Post  
To find if there are letters in a LE (a telephone number, for example), you can put:

Code
Select All
..a..;..b..;..c..;..d..;..e..;..f..;..g..;..h..;..i..;..j..;..k..;..l..;..m..;..n..;..o..;..p..;..q..;..r..;..s..;..t..;..u..;..v..;..w..;..x..;..y..;..z..
 



in the retrieve spec LE (please note that the above should all be on one line, not broken into two lines!). Or your can use on open retrieve spec programming and use:

Code
Select All
var aa as int
var str as string

str = ""
for aa = 0 to 25
	str = str + ".." + @chr(97 + aa) + "..;"
next
zip = str
 

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: ASCII Text Equivalents
Reply #6 - Nov 5th, 2005 at 4:17pm
Print Post Print Post  
Mark -

The first suggestion works just fine.  Although there are 6 fields involved, it is easy enough to copy and paste the spec into each field, using the Search Option of "meet any restriction."

I was, however, thinking of something along the lines of your second suggestion.  I can follow the code except for the last line because I don't see where "Zip" comes in.  I would appreciate knowing what this means.

Also, I have not tried it but assume it will work (your say-so is good enough for me).  But I was also wondering why I would have to use it in "on retrieve spec open."

I thought we could use programming for retrieve specs by enclosing the code in French Curly Braces {} and putting it in the appropriate layout element.  That's a feature I am eager to start focusing on.

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: ASCII Text Equivalents
Reply #7 - Nov 5th, 2005 at 5:08pm
Print Post Print Post  
Quote:
Mark -

The first suggestion works just fine.  Although there are 6 fields involved, it is easy enough to copy and paste the spec into each field, using the Search Option of "meet any restriction."

Be careful when cutting and pasting from the forum, in that the forum software can insert linefeeds and spaces that you do not want.
Quote:
I was, however, thinking of something along the lines of your second suggestion.  I can follow the code except for the last line because I don't see where "Zip" comes in.  I would appreciate knowing what this means.

Its the LE name of the LE I was using (in Customers.db) to test the spec. Use the appropriate LE names from your form in its place.
Quote:
Also, I have not tried it but assume it will work (your say-so is good enough for me).  But I was also wondering why I would have to use it in "on retrieve spec open."

I thought we could use programming for retrieve specs by enclosing the code in French Curly Braces {} and putting it in the appropriate layout element.  That's a feature I am eager to start focusing on.

On retrieve spec open programming runs when the retrieve spec opens and includes the entire SBasic language. You can use it to write into the retrieve spec form itself. It is often used to make retrieve specs dynamic based on information that has already been collected. For example, if you want a user named "Bob" to search for last names that only start with "A", you could write a retrieve spec open program that checks which user is logged in:
Code
Select All
if(@User = "Bob")
{
  LastName = "A.."
}
 


When Bob opens the retrieve spec form, the program will run, it will check if this is Bob, and if it is, it will write "A.." into the LastName LE on the retrieve spec form. If Bob then hits F10, Sesame will search for records that have a LE "LastName" that starts with the letter "A".

In short, its a way to create retrieve specs dynamically.

Retrieve programming (in the curly braces), on the other hand, is a subset of SBasic and must result in an expression. It is sent from client to the server, where it is run by the actual data engine on the server for each record. There , the expression is either checked for "truthfulness" (i.e.: "{MyField = YourField}"), or it is checked against a field in each record (i.e.: "={YourField}", placed in the MyLE LE). The important things to remember about retrieve spec programs is that thery are run on the server for each record, that they use field names as opposed to LE names, and that there are two legal syntaxes: ={expression}, that checks the field it appears in against the result of the expression, and {expression} that simply checks if the expression is true.

So if you have a date LE, you could put:
Code
Select All
={@Date}
 


in that LE and it will check the field against the current date. Or you could put:
Code
Select All
{MyDateField = @Date}
 


in any LE, and the engine will check the field "MyDateField" against today's date.
Quote:
Thanks!

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged