p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP 3.0 (http://p2p.wrox.com/forumdisplay.php?f=27)
-   -   Chapter 10 Enhanced File Info Display exercise err (http://p2p.wrox.com/showthread.php?t=3153)

ssn651 August 25th, 2003 12:13 PM

Chapter 10 Enhanced File Info Display exercise err
 
I get an error of "expect statement" when trying to load the Enhanced File Info Display exercise code from Chapter 10 on pg 400. Any guidance you may be able to give would be greatly appreciated.

John

Imar August 25th, 2003 02:59 PM

Hi John,

Can you post the offending code? I don't have the book here so it's hard to guess what the problem is (other then suggesting that you should "add a statement" somewhere ;) )

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.

ssn651 August 25th, 2003 03:07 PM

Here is the code, filedetails.asp, of the exercise and below it the code which is needed for it to work.

<%Option Explicit%>

<%
    Dim strFDPathInfo, strFDPhysicalPath
    strFDPathInfo = Request.ServerVariables("PATH_INFO")
    strFDPhysicalPath = Sever.MapPath(strFDPathInfo)
    Dim objFDFSO, objFDFile
    Set objFDFSO = CreateOject("Scripting.FileSystemObject")
    Set objFDFile = objFDFSO.GetFile(strFDPhysicalPath)
%>

<P>

<DIV STYLE= "font-size:11; font-family: Verdana; ">
File Name: <B><%= strFDFile.Name &></B><BR>
Server Path: <B><%= strFDPathInfo %></B><BR>
Physical Path: <B><%= objFDFile.Path %></B><BR>
File Size: <B><%= objFDFile.size %></B><BR>
Date Created: <B><%= objFDFile.DateCreated %></B><BR>
Date Last Mofdified: <B><%= objFDFile.DateLastMofdified %></B><BR>
Date Last Accessed: <B><%= objFDFile.DateLastAccessed %></B><BR>
</DIV>

this is the file which has the include statement which refers to the code above.

John

Imar August 25th, 2003 03:26 PM

Hi John,

Is this the source from the book?? If not, you have a serious typing problem..... ;)

1. Sever should be Server
2. CreateOject should be CreateObject
3. The &> should be %>
4. You define objFDFile as a reference to a file, and then try to use strFDFile to write out its name.
5. DateLastMofdified should be DateLastModified

If this code isn't directly from the book (which I can hardly imagine) did you at least spend 1 or 2 seconds trying to find out the errors yourself, or did you start posting to this forum right away????


Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.

ssn651 August 26th, 2003 12:07 PM

Thank you very much for pointing out the type-o's. I had checked the file that I downloaded for Wrox download site and had gotten the same message of "Expected statement", so I had not throughly check the code I had entered for type-o's. I have corrected my type-o's and still am getting the above error message. FYI, I have spent several hours trying to find out why I am getting this message. I have done searches on the net to try to find more info about the message in hope of finding out what it is referring to without success. If you have any insight as to what the error is referring to I would appreciate any info you may have.

For your future consideration, I would like to suggest you check out all the facts before you make assumptions, because you probably are well aware of what assume means.

John

Imar August 26th, 2003 02:02 PM

Well, excuse me..... Isn't inquiring (see second quote) not part of checking out all the facts?????

Imar


Quote:

quote:For your future consideration, I would like to suggest you check out all the facts before you make assumptions, because you probably are well aware of what assume means.

Quote:

quote:If this code isn't directly from the book (which I can hardly imagine) did you at least spend 1 or 2 seconds trying to find out the errors yourself, or did you start posting to this forum right away????
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.

pgtips August 27th, 2003 03:30 AM

Are you sure you corrected all the typos? I pasted that bit of code into an ASP page, changed the typos, and it worked just fine.

FYI, the "expected statement" error message is just a variation on "syntax error", it just means that asp doesn't understand the code you've written.

If you still can't get it to work, post the whole page here (I don't have the book either) and we'll get to the bottom of it.

BTW you can't blame Imar for his response, those typos were shouting at you!

hth
Phil

ssn651 August 27th, 2003 09:48 AM

I found the problem after absolutely verifying that there were no type-o's, I even replaced the code from wrox's file and still got the error. It was the file, it must have gotten corrupted somehow, i.e. bad spot on the disk or something. When I deleted my original file, which contained the copied code and was still failing, and replaced it with a copy of the wrox file it worked.

Thanks for letting me know what the Expected statement message was indicating.

John

Imar August 27th, 2003 10:35 AM

Thank you. That's what I thought too. I am more than willing to help and I am usually friendly while doing that, but if things are too obvious I wonder whether people just take these lists as easy problem solvers without the need to think for themselves.

John, the fact that "hours have been spent" searching for a solution wasn't obvious from the first post, so I easily put you in the "lazy category" for the obvious reasons. Judged too soon. My bad. Sorry.

Imar


Quote:

quote:BTW you can't blame Imar for his response, those typos were shouting at you!
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


All times are GMT -4. The time now is 02:07 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.