Pablo Software Solutions Forum Index Pablo Software Solutions

 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Application variable problem

 
Post new topic   Reply to topic    Pablo Software Solutions Forum Index -> Quick 'n Easy Web Server
View previous topic :: View next topic  
Author Message
progeco



Joined: 15 Oct 2009
Posts: 3

PostPosted: Fri Apr 02, 2010 4:05 pm    Post subject: Application variable problem Reply with quote

Hi! I've a problem using Application variable; for example I configure Quick 'n Easy web server to process Global.asa so in that file I write:

Application("TEMP_FOLDER") = ucase(server.mappath("temp/"))

then in my asp file I use this code:

response.write Application("TEMP_FOLDER")

and the response is:

?:\FOLDER1\FOLDER2\

Pratically the first letter is wrong. In othe test that I made the first char was a random ASCII char and this char change every time I restart application, when global.asa is read. Any idea?

Thank' you
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 13 Apr 2005
Posts: 1472

PostPosted: Sat Apr 03, 2010 8:10 am    Post subject: Reply with quote

The 'Server' collection is not yet available on application startup, so the value will have a random value.

The 'Application_OnStart' is executed as the first command when the starts, before initializing everything else.
Back to top
View user's profile Send private message Send e-mail
progeco



Joined: 15 Oct 2009
Posts: 3

PostPosted: Tue Apr 06, 2010 7:02 am    Post subject: Reply with quote

Ok, I take a wrong example.
My problem is that if I set an Application variable inside Global.asa -> Application_OnStart like this:

Application("TEMP") = "D:\FOLDER1\FOLDER2\FOLDER3\TEMP"

when I try to use it, inside my first asp file using this instruction:

response.write Application("TEMP")

the result is:

?:\FOLDER1\FOLDER2\FOLDER3\TEMP

I also note than if I use Application("TEMP") in lowercase mode, sometimes the result is correct.

Thank' you
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 13 Apr 2005
Posts: 1472

PostPosted: Tue Apr 06, 2010 8:53 pm    Post subject: Reply with quote

Did you try this?
Code:
Dim strFolder
strFolder = Application("TEMP")
Response.Write strFolder


Note that it's always better to assign a collection value to a variable first..
Back to top
View user's profile Send private message Send e-mail
progeco



Joined: 15 Oct 2009
Posts: 3

PostPosted: Wed Apr 07, 2010 7:13 am    Post subject: Reply with quote

I try your code but nothing change.
I note that if I inizialize:

Code:
Application("TEMP") = "D:\FOLDER1\FOLDER2\FOLDER3\TEMP"


the result is

:\FOLDER1\FOLDER2\FOLDER3\TEMP

but if I use:

Code:
Application("TEMP") = "d:\FOLDER1\FOLDER2\FOLDER3\TEMP"


the result is correct.
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 13 Apr 2005
Posts: 1472

PostPosted: Thu Apr 08, 2010 6:55 am    Post subject: Reply with quote

It may be something in the Windows Scripting engine (which executes the ASP code), but I do not have any control over that behavior Confused
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Pablo Software Solutions Forum Index -> Quick 'n Easy Web Server All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SwiftBlue Theme created by BitByBit
Powered by phpBB © 2001, 2002 phpBB Group