Subject Re: calculated entryfield value
From Gaetano De Luisi <gaetanodd@hotmail.com>
Date Thu, 16 Jul 2020 22:21:17 -0400
Newsgroups dbase.getting-started


nevermind, I found that STR() has a default length of 10, with the 2 characters used by "11", that accounts for the 8 spaces...

Gaetano De Luisi Wrote:

> I have qa form that has some default entryfield values that can be updated by the user. THe initial value of one entryfield uses the values of those other entryfields. To set the value of this calculated field, I use the form's onOpen event as follows:
>
> function form_onOpen()
>       this.entrytime1.value=this.entrystarttime.value+"-";
>                         +str((val(this.entrystarttime.value)+val(this.entryruntime.value)))
>       return
>
> The value of entrystarttime is 9, the value of runtime is 2, so I am trying to display "9-11".
>  
> The value of entrytime1 gets set as expected, however I have a formatting issue. Instead of getting "9-11" I get "9-        11" (with 8 spaces).
>
> What do I need to do to get rid of the spaces? I tried to use trim() but it didn't change anything.
>
> Thanks!