Forums › Forums › SIMPOL Programming › printform1 selectkey problem
- This topic has 3 replies, 2 voices, and was last updated 11 years, 1 month ago by Michael.
- AuthorPosts
- April 5, 2013 at 5:45 pm #206Jean ValleeParticipant
Trying to use printform1.selectkey but am getting an error 16 – wrong type. It only has 4 parameters but I’ve had no success trying to determine which one it’s complaining about. dring datasrc datasrc =@ app.datasources integer e; e = 0 printform1 pf pf =@ openprintform1(“bldgform.sxp”, defpagewidth = 215900, defpageheight = 279400, defnumberformat = “999999.00”, defdateformat = “mm/0d/yyyy”, deftimeformat = “hh:mm”, datelocale = ds, numericlocale = ns, datasources = datasrc, error = e) anyvalue pn pn = me!PrmtTnum.control.text type(db1index)pfi pfi =@ setidx_PrmtTNum(appw) app.bFound = .false // no errors to here // this statement raises the error 16 pf =@ pf.selectkey(pn, pfi, found=app.bFound, e) Both pn and pfi are valid objects of the correct type so what else could it be? Jean Vallee
April 8, 2013 at 6:16 pm #2212MichaelKeymasterOn 05/04/2013 18:45, JV wrote:
> Trying to use printform1.selectkey but am getting an error 16 – wrong type.
>
> It only has 4 parameters but I've had no success trying to determine
> which one it's complaining about.
>
> dring datasrc
> datasrc =@ app.datasources
> integer e; e = 0
>
> printform1 pf
>
> pf =@ openprintform1("bldgform.sxp", defpagewidth = 215900,
> defpageheight = 279400, defnumberformat = "999999.00",
> defdateformat = "mm/0d/yyyy", deftimeformat = "hh:mm", datelocale = ds,
> numericlocale = ns, datasources = datasrc, error = e)
>
> anyvalue pn
> pn = me!PrmtTnum.control.text
>
> type(db1index)pfi
> pfi =@ setidx_PrmtTNum(appw)
>
> app.bFound = .false
> // no errors to here
>
> // this statement raises the error 16
> pf =@ pf.selectkey(pn, pfi, found=app.bFound, e)You are attempting to assign the dataform1record object to a printform1 variable. This was probably not what you intended.
> Both pn and pfi are valid objects of the correct type so what else could
> it be?It is the return value where the type error is occurring.
Ciao, Neil
April 8, 2013 at 9:29 pm #2219Jean ValleeParticipantOn 4/8/2013 2:16 PM, Neil Robinson wrote:
> On 05/04/2013 18:45, JV wrote:
>> Trying to use printform1.selectkey but am getting an error 16 – wrong type.
>>
>> It only has 4 parameters but I've had no success trying to determine
>> which one it's complaining about.
>>
>> dring datasrc
>> datasrc =@ app.datasources
>> integer e; e = 0
>>
>> printform1 pf
>>
>> pf =@ openprintform1("bldgform.sxp", defpagewidth = 215900,
>> defpageheight = 279400, defnumberformat = "999999.00",
>> defdateformat = "mm/0d/yyyy", deftimeformat = "hh:mm", datelocale = ds,
>> numericlocale = ns, datasources = datasrc, error = e)
>>
>> anyvalue pn
>> pn = me!PrmtTnum.control.text
>>
>> type(db1index)pfi
>> pfi =@ setidx_PrmtTNum(appw)
>>
>> app.bFound = .false
>> // no errors to here
>>
>> // this statement raises the error 16
>> pf =@ pf.selectkey(pn, pfi, found=app.bFound, e)
>
> You are attempting to assign the dataform1record object to a printform1 variable. This was probably not what you intended.
>
>> Both pn and pfi are valid objects of the correct type so what else could
>> it be?
>
> It is the return value where the type error is occurring.
>
> Ciao, Neil
>
Yes it was. I want the printform to select the record displayed in the
dataform1 and print it.
If I cannot assign the value of a dataform1 object to a printform1
variable via an anyvalue type variable, what can I use instead?April 10, 2013 at 11:25 am #2220MichaelKeymasterOn 08/04/2013 22:29, JV wrote:
> On 4/8/2013 2:16 PM, Neil Robinson wrote:
>> On 05/04/2013 18:45, JV wrote:
>>> Trying to use printform1.selectkey but am getting an error 16 – wrong type.
>>>
>>> It only has 4 parameters but I've had no success trying to determine
>>> which one it's complaining about.
>>>
>>> dring datasrc
>>> datasrc =@ app.datasources
>>> integer e; e = 0
>>>
>>> printform1 pf
>>>
>>> pf =@ openprintform1("bldgform.sxp", defpagewidth = 215900,
>>> defpageheight = 279400, defnumberformat = "999999.00",
>>> defdateformat = "mm/0d/yyyy", deftimeformat = "hh:mm", datelocale = ds,
>>> numericlocale = ns, datasources = datasrc, error = e)
>>>
>>> anyvalue pn
>>> pn = me!PrmtTnum.control.text
>>>
>>> type(db1index)pfi
>>> pfi =@ setidx_PrmtTNum(appw)
>>>
>>> app.bFound = .false
>>> // no errors to here
>>>
>>> // this statement raises the error 16
>>> pf =@ pf.selectkey(pn, pfi, found=app.bFound, e)
>>
>> You are attempting to assign the dataform1record object to a printform1 variable. This was probably not what you intended.
>>
>>> Both pn and pfi are valid objects of the correct type so what else could
>>> it be?
>>
>> It is the return value where the type error is occurring.
>>
>> Ciao, Neil
>>
> Yes it was. I want the printform to select the record displayed in the
> dataform1 and print it.
> If I cannot assign the value of a dataform1 object to a printform1
> variable via an anyvalue type variable, what can I use instead?
>That isn't a problem, but you are going about it in a very roundabout way. I would try this:
pf.setmasterrecord(df.masterrecord.record, error=e)
Where pf is the printform1 that you opened and df is the dataform1 that you wish to use the record from. You can have more than
one form sharing the same record object concurrently. Once you have assigned it, call pf.print(…).Ciao, Neil
- AuthorPosts
- You must be logged in to reply to this topic.