Subject Re: modal form
From Gaetano <gaetanodd@hotmail.com>
Date Fri, 21 Aug 2020 09:08:07 +1000
Newsgroups dbase.getting-started


Hi Lee,

I think it was just a typo/oversight, your original code did not include
the "super::" portion. That's probably why it didn't work

function readModal
      this.modal = true    // set your modal flag
      //super::readModal() // calls the normal dBASE readModal method

      return readmodal()     // have seen this being the norm ---

the above last line was probably meant to read "return super::readmodal()"

I'll try that, thanks!

Cheers,
Gaetano.

On 20/08/2020 16:39, Lee Grant wrote:
> Gaetano,
>
> I've been working with the report Akshat, Mervyn and myself have been
> working on to print without user intervention and in the iteration that
> Akshat put together he used a different return, but near as I can figure
> these all work in an overridden method:
>
>> repath = _app.userDocumentsPath
>>  ssindx = rat("Documents\", repath)
>>  result = stuff(repath, ssindx + 10, len(repath) - ssindx + 10, "")
>>     //we know the length of the "Documents\" = 10, so now we get
>>     //the full string size and subtract the current path size
>>     //just past the Documents\ slash to insert the new filename
>>  // result = 'd:\examples\plus2019\'
>>  hardcodefile = result + "ProSheetMiles" +
>> dtos(date())+substr(time(),1,2)+substr(time(),4,2)+".pdf"
>>  form.outputFileName = hardcodefile
>>  form.output = 2
>>  //super::render() // this works with a simple return at the end
>>  return super::render()  //TESTSMILES2REPORT::render() // these work
>
> To note, originally the form.output and form.outputfilename had the
> variable r in front, but I had to change it because it errored that r
> had not been defined, which is something I have to figure out, since
> form IS variable R, I'm not sure why it's kicking that error, but the
> method is a being overridden on the form...so it kind of makes sense
> that it knows who it is (form) but not what (r) is. I think. :)
>
> Just an FYI.
>
> Lee
>
> On 8/19/2020 5:19 PM, Gaetano wrote:
>>
>> Hi Lee,
>>
>> I tried both codes, the super::readModal() option works, but "return
>> readModal()" produces the error "too few arguments, expecting at least
>> 1" while opening the form in the navigator pane or during compilation.
>>
>> I have Plus11 in case it matters.
>>
>> Cheers,
>> Gaetano.
>>
> <snip>