NetTalk Central

Author Topic: Open File Question  (Read 1536 times)

osquiabro

  • Hero Member
  • *****
  • Posts: 576
    • View Profile
    • Email
Open File Question
« on: February 17, 2020, 05:31:08 AM »
what is a best method in NT for open a File? p web.OpenFile(myfile) or Access:myfile.Open with Access:myfile.UseFile(), what is a difference if any issue?

Thanks..

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 711
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Open File Question
« Reply #1 on: February 17, 2020, 05:51:35 AM »
I try to use the p_web methods whenever possible.  However, I don't think it matters in the grand scheme of things.

p_web.OpenFile(SomeFile) is simply a call to Open(SomeFile,AccessMode) with error checking.

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.41
Clarion 11

Jane

  • Sr. Member
  • ****
  • Posts: 255
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Open File Question
« Reply #2 on: February 17, 2020, 09:12:03 AM »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10758
    • View Profile
Re: Open File Question
« Reply #3 on: February 17, 2020, 11:03:06 PM »
hah - was in the docs - thanks Jane :)

Personally I use the ABC methods directly in my own programs.

cheers
Bruce

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 711
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Open File Question
« Reply #4 on: February 18, 2020, 02:29:53 AM »
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.41
Clarion 11

osquiabro

  • Hero Member
  • *****
  • Posts: 576
    • View Profile
    • Email
Re: Open File Question
« Reply #5 on: June 19, 2022, 04:06:24 AM »
ok this post is old but again another question about this

Quote
"there is a slight performance gain when using the ABC file methods over the p_web methods."

why NT use a old code for this??

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10758
    • View Profile
Re: Open File Question
« Reply #6 on: June 19, 2022, 11:24:30 PM »
I'm not sure what you mean by "old code"?

The NetTalk templates generate calls to p_wem.OpenFile etc, and that in turn uses Access: methods if the program is ABC and regular Clarion calls for Legacy.

Cheers
Bruce

osquiabro

  • Hero Member
  • *****
  • Posts: 576
    • View Profile
    • Email
Re: Open File Question
« Reply #7 on: June 20, 2022, 03:22:35 AM »
i'm confused with this:

"Note that it is perfectly ok for you to use normal ABC file handling methods in your own hand-code. The file methods are included in the class to cater for non-ABC programs. there is a slight performance gain when using the ABC file methods over the p_web methods."

and OPEN(p_File,42h) in netweb.clw

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10758
    • View Profile
Re: Open File Question
« Reply #8 on: June 20, 2022, 09:20:01 PM »
ABC code is generated into WebHandler procedure. So see the OpenFile method in there - that will likely clear up your confusion.
The code in WebHander is the "derived class" - so overrides the code in netweb.clw (or supplements it if the parent method is called.)


osquiabro

  • Hero Member
  • *****
  • Posts: 576
    • View Profile
    • Email
Re: Open File Question
« Reply #9 on: June 21, 2022, 03:29:09 AM »
Thanks!