How to call a HTML file with anchoring

Just starting out? Need help? Post your questions and find answers here.
SkyManager
Enthusiast
Enthusiast
Posts: 339
Joined: Tue Jan 30, 2007 5:47 am
Location: Hong Kong

How to call a HTML file with anchoring

Post by SkyManager »

Hello, could anybody show me how to do this?
I want to call up a local hard-disk HTML file in a web browser and position to an anchoring ID

HTML file :

Code: Select all

<HTML><BODY>
TEST
<a href='aaa'>TEST-AAA</a><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<a href='bbb'>TEST-BBB</a><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<a href='ccc'>TEST-CCC</a><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
</BODY></HTML>
I have tried to RunProgram with parameter but failed

Code: Select all

file:///c:/test.help#ccc
User avatar
AndrewM
User
User
Posts: 39
Joined: Wed Nov 06, 2013 3:55 am
Location: Australia

Re: How to call a HTML file with anchoring

Post by AndrewM »

Not sure but my URL's start with

Code: Select all

file://localhost/C:/
.
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: How to call a HTML file with anchoring

Post by Perkin »

are you including the full filename before the hash

test.help.html#ccc
%101010 = $2A = 42
User avatar
Kiffi
Addict
Addict
Posts: 1504
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: How to call a HTML file with anchoring

Post by Kiffi »

test.html:

Code: Select all

<HTML><BODY>
TEST
<a name='aaa' href='#aaa'>TEST-AAA</a><br /><div style="height:1000px"></div>
<a name='bbb' href='#bbb'>TEST-BBB</a><br /><div style="height:1000px"></div>
<a name='ccc' href='#ccc'>TEST-CCC</a><br /><div style="height:1000px"></div>
</BODY></HTML>
PureBasic-Code:

Code: Select all

RunProgram([PathToYourBrowser], "c:/test.html#ccc", "")
Greetings ... Kiffi
Hygge
User avatar
AndrewM
User
User
Posts: 39
Joined: Wed Nov 06, 2013 3:55 am
Location: Australia

Re: How to call a HTML file with anchoring

Post by AndrewM »

This might not be the best place to ask but is there a good example of writing out a html text file on the PB site that is data driven. I gave up using ms-access reports long ago and write VBA procedures that export html. They look like Rhtml which is written in Ruby. I am just wondering if there are any styles and conventions in PB? Another question that is more closely related to this tread would be is it possible to create a lump of html text in a text variable and pass this to the browser control instead of pointing the browser control at a saved text file?
User avatar
Kiffi
Addict
Addict
Posts: 1504
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: How to call a HTML file with anchoring

Post by Kiffi »

AndrewM wrote:is it possible to create a lump of html text in a text variable and pass this to the browser control instead of pointing the browser control at a saved text file?

Code: Select all

SetGadgetItemText(YourBrowserGadget, #PB_Web_HtmlCode, YourHtml.s)
Greetings ... Kiffi
Hygge
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Re: How to call a HTML file with anchoring

Post by utopiomania »

Code: Select all

RunProgram([PathToYourBrowser], "c:/test.html#ccc", "")
Thanks Kiffy
Post Reply