Subject Re: Variable used for the field in code?
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Thu, 16 Nov 2023 09:25:22 -0800
Newsgroups dbase.getting-started

On 11/16/2023 8:52 AM, charlie wrote:
> Is it possible to do something like below?  grd is a variable that I am trying to insert in the field code??
>
> form.spinboxestv1.value = val(co.fields["'grd'"].value)
>
> If it is possible, how will you do this?  The code i tried fails.


This needs to be a string, so use the plus sign to concatenate things,
try this:

form.spinboxestv1.value = val(co.fields["+grd+"].value)

(About to take my wife to the doctor, so no testing time ... can't
guarantee it)

Ken

--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm