Normal Topic Linking to a web site (Read 4882 times)
Alec
Lanticans
*****
Offline



Posts: 200
Location: Ascot, England, UK
Joined: Nov 22nd, 2002
Linking to a web site
Feb 24th, 2004 at 10:32pm
Print Post Print Post  
To open a URL ("Uniform Resource Locator")  stored in a Sesame database, you would have programming which
would run @Shell( ). This would launch your web browser with the stored url passed as an argument separated by one space. @Shell is described in the PG on pages 111-113.

Example:
This is on-element-entry programming in the element named "URL" and contains the url of a website, eg http://www.lantica.com/Support/KBase/sesame_faq.html (you can omit the "http://" bit). It assumes your browser is Internet Explorer and that it is located as shown.


var IEpath as String
var IEfailure as Int
IEPath = @Chr(34) + "C:\Program Files\Internet Explorer\IEXPLORE.EXE" + @Chr(34)
// The @Chr(34) wraps double quotes around the pathname of Internet Explorer

IF url <>"" THEN
   IEfailure = @Shell(IEpath + " " + url)
IF NOT IEfailure = 0 THEN
   @Msg("Couldn't open web browser")
// @Shell returns a 0 if it is successful, a 1 if it fails

  

Alec
Back to top
IP Logged
 
Gordon_M
Member
Members
*
Offline


No personal text

Posts: 12
Location: Washington DC
Joined: Nov 23rd, 2002
Re: Linking to a web site
Reply #1 - Aug 8th, 2005 at 1:56pm
Print Post Print Post  
[quote author=Alec  link=1077661970/0#0 date=1077661970]var IEpath as String
var IEfailure as Int
IEPath = @Chr(34) + "C:\Program Files\Internet Explorer\IEXPLORE.EXE" + @Chr(34)
// The @Chr(34) wraps double quotes around the pathname of Internet Explorer

IF url <>"" THEN
  IEfailure = @Shell(IEpath + " " + url)
IF NOT IEfailure = 0 THEN
  @Msg("Couldn't open web browser")
// @Shell returns a 0 if it is successful, a 1 if it fails

[/quote]
In most cases, you can substitute "Start IExplore" for the entire IEPath, which is useful if dealing with different operating systems or where the system is not on C: drive.
The line would then be IEfailure - @Shell("Start IExplore " + url)
(Note there is a space after IExplore before the quotation mark.)
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Linking to a web site
Reply #2 - Aug 8th, 2005 at 2:07pm
Print Post Print Post  
If you use "@AsynchShell" you can use just the URL without specifying a browser - that way it will work with whatever browser the user has set as their default:
Code
Select All
var aa as int
aa = @ASynchShell("http://www.lantica.com")
 

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Gordon_M
Member
Members
*
Offline


No personal text

Posts: 12
Location: Washington DC
Joined: Nov 23rd, 2002
Re: Linking to a web site
Reply #3 - Aug 8th, 2005 at 2:21pm
Print Post Print Post  

Now, why didn't I think of that??
  
Back to top
 
IP Logged