Subject Re: Assigning Values
From Andy Taylor <andy.taylor@which.net>
Date Sat, 14 Apr 2018 18:22:22 -0400
Newsgroups dbase.getting-started

Norman,

I take it you tried my code for completion of the save method.... and it produced no change in result?

In which case, lets check each datalink for effectiveness, it may be because you are using an automem
variable directly on a datalinked field in the rowset.  XML and OODML may be fighting...

Please amend your code as follows:

? m->tard, m->tarm, m->tars, "m->tard", "m->tarm", "m->tars"                
form.entryField428.value = m->tard
form.entryField429.value = m->tarm
form.entryField430.value = m->tars
form.area1.rowset.save()
? form.area1.rowset.fields["tard"].value , "tard"
? form.area1.rowset.fields["tarm"].value , "tarm"
? form.area1.rowset.fields["tars"].value , "tars"  

I'm also guessing that your field definition in the underlying table for TARS is numeric(6,5).
Note that the value stored in TARS was 18.56700 but m-tars was 18.56681
If the table definition for TARD and TARM is numeric(2,0) then maybe
20.00000 gets stored as "00" and 50.00000 gets stored as "00" using your direct rowset value method.
That's just a crazy supposition.... but without the tables and full code in front of me it's hard to guess.

Andy


> Thanks Andy,
> It seems form.area1.rowset.save() is not the problem.
> If I arbitrarily set m->tard = 40 and m->tarm = 30  rather than using the calculated m->tard and m->tarm
>  values the tard and tarm Entryfields immediately appear in the Form as expected.
>
> 20         54         18.56681 m->tard m->tarm m->tars
> 40 tard
> 30 tarm
> 18.56700 tars
>
> It makes absolutely no sense that the calculated m->tars value works and the calculated m->tard and m->tarm values appear as zeros.
> I think the WW2 era gremlins have returned!
>
> Thanks for any comment,   Norman
>
> Andy Taylor Wrote:
>
> > Norman,
> >
> > Unlikely that you've maxxed out on entryfields.
> > I might be able to suggest a different way of doing what you want... that form must be a monster (drop me an e-mail if you want).
> >
> > Having looked at your code I think it more likely that the rowset.save() method has not completed (because of the huge number of datalinks)
> >  before you start asking for the replaced values. Incidentally I assume the last three commands are really tard, tarm and tars instead of tard 3 times.
> >
> > Try using..
> > form.area1.rowset.save()
> > do until form.area1.rowset.modified = false
> >    _app.executemessages()
> > enddo
> > ? .... etc
> >
> > Of course that might give you an endless loop if there's a problem with the save... so perhaps a count on the loops with maximum value?
> > Andy
> >
> >
> > > This code changes a decimal angle to degrees minutes and seconds. On the Form.wfm the seconds, called tars, prints out  just fine in the tars Entryfield.
> > >
> > > However the decimal tard value and the minute tarm value show as zeros in their Entryfields as zero, which they are.
> > >  
> > > As you can  see from the printouts tard and tarm refuse to accept their assigned values.
> > >
> > > Can the program just be maxed out with too many Entryfields?
> > >
> > > Thanks for any comments, Norman Snowden
> > >
> > > with (this.ENTRYFIELD428)
> > >       dataLink = form.area1.rowset.fields["tard"]
> > >       height = 0.1667
> > >       left = 10.1458
> > >       top = 5.375
> > >       width = 0.34
> > >       picture = "99"
> > >       fontSize = 8.0
> > >       fontBold = true
> > >    endwith
> > >
> > >    this.ENTRYFIELD429 = new ENTRYFIELD(this)
> > >    with (this.ENTRYFIELD429)
> > >       dataLink = form.area1.rowset.fields["tarm"]
> > >       height = 0.1667
> > >       left = 10.52
> > >       top = 5.375
> > >       width = 0.32
> > >       picture = " 99"
> > >       fontSize = 8.0
> > >       fontBold = true
> > >    endwith
> > >
> > >    this.ENTRYFIELD430 = new ENTRYFIELD(this)
> > >    with (this.ENTRYFIELD430)
> > >       dataLink = form.area1.rowset.fields["tars"]
> > >       height = 0.1667
> > >       left = 10.875
> > >       top = 5.375
> > >       width = 0.5833
> > >       picture = "99.999"
> > >       fontSize = 8.0
> > >       fontBold = true
> > >    endwith
> > >
> > >    tcnvr = RTOD(Atan(m->yty/m->xtx))  && 03/16/2017                     
> > >         m->tard = INT(tcnvr)
> > >         m->tarm = INT((tcnvr - m->tard) * 60)
> > >         m->tars = ((((tcnvr - m->tard) * 60) - INT((tcnvr - m->tard) * 60))) * 60
> > >         ? m->tard, m->tarm, m->tars, "m->tard", "m->tarm", "m->tars"                
> > >         form.area1.rowset.fields["tard"].value = m->tard
> > >         form.area1.rowset.fields["tarm"].value = m->tarm
> > >         form.area1.rowset.fields["tars"].value = m->tars
> > >         form.area1.rowset.save()
> > >      ? form.area1.rowset.fields["tard"].value , "tard"
> > >         ? form.area1.rowset.fields["tard"].value , "tarm"
> > >         ? form.area1.rowset.fields["tard"].value , "tars"  
> > >           
> > >    
> > >         20         54         18.56681 m->tard m->tarm m->tars
> > >         0 tard
> > >         0 tarm
> > >         18.56700 tars
> > >    return