Hot Topic (More than 10 Replies) Field Templates? (Read 2245 times)
DocBones
Member
*
Offline


No personal text

Posts: 2
Joined: Feb 20th, 2004
Field Templates?
Feb 20th, 2004 at 7:04pm
Print Post Print Post  
Are field templates supported in Sesame and if so how, are they created?
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Field Templates?
Reply #1 - Feb 20th, 2004 at 7:49pm
Print Post Print Post  
If you are referring to things like automatically formatting  a phone number as it is entered you would use Sbasic programming in an element exit or element immediate change. Here is an example of the telephone number field formatting code that also checks to validate the amount of digits and notify the user if something is incorrect.

just substitute your element name for mine named homephone.

// Formats Telephone Number

var vHPhone as String    
var vNewHPhone As String 
var vhphonecount
var vhpnentered

     Vhpnentered = @num(HomePhone)
     // Writeln(Vhpnentered)
     
     vhphonecount = @num(@len(vhpnentered))
     //writeln(vhphonecount)

If vhphonecount = "10"


{
     @color(HomePhone,0,7)
     vHPhone = @Num(HomePhone)
     vNewHPhone = "(" + @Left(vHPhone, 3) + ") " + @Mid(vHPhone, 4, 3) + "-" + @Right(vHPhone, 4)
     HomePhone = vNewHPhone 
}
else
{
     @color(HomePhone,7,1)
     @msgbox("The Telephone Number needs to be Exactly 10 Digits", "The numbers you entered " +
     @num(Homephone),"is : " + Vhphonecount + " Digits Please check Home Telephone and Re-enter")
     // Goto HomePhone 
}   
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
DocBones
Member
*
Offline


No personal text

Posts: 2
Joined: Feb 20th, 2004
Re: Field Templates?
Reply #2 - Feb 20th, 2004 at 8:01pm
Print Post Print Post  
I actually was wanting something more like in q&a such as (###) ###-####. I hope it is easier than the programming as previously listed.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Field Templates?
Reply #3 - Feb 20th, 2004 at 8:31pm
Print Post Print Post  
Field templates, as they exist in Q&A, are not implemented in this version of Sesame. If there is sufficient demand for this feature, it may be added to future versions.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Field Templates?
Reply #4 - Feb 20th, 2004 at 8:39pm
Print Post Print Post  
Quote:
I actually was wanting something more like in q&a such as (###) ###-####. I hope it is easier than the programming as previously listed.



Sbasic is really simple.

It grows on you and before you know it, It is as easy to use as Q&As  logic was but it is a billion times more powerful.

I apologize if my example was overwhelming.

I just get so excited that not only can I format the element but with a drop more effort I can validate the correctness give a message to the user and turn the element red to bring attention to the element.

If you just want the formatting I believe this will work


HomePhone = "(" + @Left(HomePhone, 3) + ") " + @Mid(HomePhone, 4, 3) + "-" + @Right(HomePhone, 4)
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
GJK
Junior Member
**
Offline


Felix qui potuit rerum
cognoscere causas

Posts: 80
Location: Kankakee. Il
Joined: Apr 22nd, 2003
Re: Field Templates?
Reply #5 - Feb 20th, 2004 at 9:28pm
Print Post Print Post  
I'm with "Bones" I would like the flexibility of just being able to tell the time and not to have to build a watch...so to speak.

But for those who like and need to build watches I think the flexibility would be great! 8)
  
Back to top
 
IP Logged
 
josebetzy
Member
*
Offline


Hmmm. How? Cómo?

Posts: 33
Location: Las Piedras, Puerto Rico
Joined: Dec 15th, 2003
Re: Field Templates?
Reply #6 - Feb 21st, 2004 at 2:22am
Print Post Print Post  
BOBSCOTT
I tried out your code, but nothing. Yes, I did substitute the element name for mine. Yes, it is on exit. I saved it, reconciled it. Should I be able to test and see this code, or any code immediately in Preview? Its obvious I am doing something wrong.

By the way, this type of coding examples is much needed, especially the very common ones. By the way how would you calculate age.

  

Jose L. Muñoz
Back to top
 
IP Logged
 
Brett_in_Australia
Member
*
Offline


Having a nice nap under
a tree sounds good to
me

Posts: 14
Location: Australia
Joined: Feb 20th, 2004
Re: Field Templates?
Reply #7 - Feb 21st, 2004 at 2:41am
Print Post Print Post  
Quote:
Field templates, as they exist in Q&A, are not implemented in this version of Sesame. If there is sufficient demand for this feature, it may be added to future versions.


Well add me to the list of users that would like this feature added !!! Smiley
  
Back to top
IP Logged
 
LindyR
Member
*
Offline


Thanks Lanticans!!

Posts: 16
Location: Beaverton Oregon
Joined: Dec 15th, 2003
Re: Field Templates?
Reply #8 - Feb 21st, 2004 at 4:00am
Print Post Print Post  
Quote:
Well add me to the list of users that would like this feature added !!! Smiley


ME TOO!!  ME TOO!!
  

Lindy Robertson&&Beaverton Oregon
Back to top
AIM AIM  
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Field Templates?
Reply #9 - Feb 21st, 2004 at 6:49am
Print Post Print Post  
Quote:
By the way, this type of coding examples is much needed, especially the very common ones. By the way how would you calculate age.  



var vYears as Int
var vMonths as Int
var vDays as Int
var vBirthdate as date = Birthdate
var VAge as string
vDays = @date - vBirthdate
vYears = vDays/365.25
vMonths = vDays/30

If vDays >= 365 then
     {
           vAge = @str (vYears) + " Years"
          If @Int (vYears) = 1 then
           vAge = @Replace (vAge, "Years", "Year")
     }
Else if vDays >= 30 and vDays < 365 then      
     {
           vAge = @str (vMonths) + " Months"
        If @Int (vMonths) = 1 then
           vAge = @Replace (vAge, "Months", "Month")
     }
Else if vDays < 30 then
     {
           vAge = @str (vDays) + " Days"
        If @Int (vDays) = 1 then
           vAge = @Replace (vAge, "Days", "Day")
     }
Age = Vage




« Last Edit: Feb 21st, 2004 at 8:27am by Bharat_Naik »  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Field Templates?
Reply #10 - Feb 21st, 2004 at 1:57pm
Print Post Print Post  
Quote:
ME TOO!!  ME TOO!!



The irony here is that when we were working the initial requirements spec for Sesame, the overwhelming user response was that input templates were a pain - too restrictive, and extremely unpopular with users.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Field Templates?
Reply #11 - Feb 21st, 2004 at 2:11pm
Print Post Print Post  
Bob_Scott and Bharat,

These would be a great start to the new Programming Examples Board.  Grin
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Victor
Member
*
Offline


No personal text

Posts: 1
Location: Panama
Joined: Jan 25th, 2004
Re: Field Templates?
Reply #12 - Feb 24th, 2004 at 10:19pm
Print Post Print Post  
add me to the list of users that would like this feature added
  
Back to top
 
IP Logged
 
drgregory
Member
*
Offline


No personal text

Posts: 9
Joined: Jan 17th, 2004
Re: Field Templates?
Reply #13 - Feb 25th, 2004 at 6:34am
Print Post Print Post  
I would also like to have the templets.  The users may not like it but in some cases it needs to be required.
  
Back to top
 
IP Logged