Normal Topic Thiselement with Time question (Read 852 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Thiselement with Time question
Aug 19th, 2008 at 3:44pm
Print Post Print Post  
I have a series of command buttons with the label set to 2000 2030 2100 2130 2200 etc

I am using the thiselement technique I often use to take the command buton label info and return that value to an element. In this case I have a element named bedtime bound to type time.

If I type 2000 in the element it converts properly to 8:00 however when I use the thiselement technique it ends up with the wrong time (see code below)

I also tried wrapping the thiselement in tonumber and totime but still no good. I then stepped through the process with
var Vwhat as int
Vwhat = thiselement
writeln(vwhat)
bedtime = @tonumber(vwhat)

It writeln the correct number, but when it got returned to the bedtime element it was interpreted wrong again.

Can you point out the errors of my way? Thanks



If  bedtime  = ""

Then
     {
           bedtime =  thiselement
           
           GotoTabPage(LE45, 12)            

     }

else
     
           If @Askuser("Berlin question 10 is set to  ", bq10,"Do you want to replace it with " + thiselement +"?")
Then
                 {      
           bedtime = thiselement
           
           GotoTabPage(LE45, 12)      
            
                 }
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Thiselement with Time question
Reply #1 - Aug 19th, 2008 at 4:28pm
Print Post Print Post  
The programming below should return what you are after.

Code
Select All
var vWhat as String
     vWhat = ThisElement

covert = @ToTime(ThisElement)
 



You will also want to relabel your command buttons so 2000 is 20:00.
  
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Thiselement with Time question
Reply #2 - Aug 26th, 2008 at 4:30pm
Print Post Print Post  
This is an interesting topic, so I'm curious.  Ben, what is vWhat used for in your programming?  And what is covert?
  

**
Captain Infinity
Back to top
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Thiselement with Time question
Reply #3 - Aug 26th, 2008 at 7:41pm
Print Post Print Post  
In my programming, vWhat is not actually used beyond holding the value of ThisElement. The element named 'covert' is a text element bound to a time field... and was meant to say 'convert'.
  
Back to top
IP Logged