|
| |||||||||
| Tags: code, flash file, html, internet explorer, javascript, vbscript |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| My VBScript code not working properly
I'm a complete newbie in VBScript, and there are lot of things that I am unaware of. I am developing an application that runs an HTML file offline. Now I want to transform each line of this text into a variable that Javascript can handle, also I need that HTML file to get the content of a txt file and send that value to a flash file loaded in the same HTML. I have successfully sent a Javascript variable to a flash file. To do the rest I'm trying to use a VBScript code that reads the content of an external text file and send to an HTML 'select' object. But due to some reason, it fails every time I run the HTML outside the desktop directory.
__________________ As you simplify your life, the laws of the universe will be simpler; solitude will not be solitude, poverty will not be poverty, nor weakness.Henry David Thoreau |
|
#2
| ||||
| ||||
| Re: My VBScript code not working properly
I am not able to get your question properly. How are you trying to run an HTML file offline.?? VBScript (VBS) is a Windows scripting language or also known as programming code that can be written as a text file and "executed" like an EXE file. A program such as Internet Explorer or the Windows Script Host carries out the instructions given in script code. Script is run by an interpreter. VBS can be used in several different ways. It originated as a webpage scripting language for Internet Explorer. It will be better if you provide your code.! |
|
#3
| ||||
| ||||
| Re: My VBScript code not working properly
Thanks for sparing your precious time. I am written this code : Code: <html>
<script Language="VBScript">
sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
Sub Window_OnLoad
ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile _
(sCurPath+"\lol.txt", ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Set objOption = Document.createElement("OPTION")
objOption.Text = strLine
objOption.Value = strLine
FileContent.Add(objOption)
Loop
objFile.Close
End Sub
</SCRIPT>
<body>
<select size="5" name="FileContent" style="width:250"></select>
</body>
</html>
__________________ As you simplify your life, the laws of the universe will be simpler; solitude will not be solitude, poverty will not be poverty, nor weakness.Henry David Thoreau |
|
#4
| ||||
| ||||
| Re: My VBScript code not working properly
You have written the code as Code: sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") Code: sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName("C:\")
__________________ The FIFA Manager 2009 PC Game |
|
#5
| ||||
| ||||
| Re: My VBScript code not working properly
Changing your path of your file that you are trying to Run should isolate the problem. You can try to use the code as suggested by the 'opaper'. Maybe changing the path can solve your problem. Since a path is complete and unambiguous if it provides a complete reference from the root of the specified drive. A complete path can only end with a path separator character (\) if it specifies the root folder of a mapped drive. You will also have to keep this in mind. If the problem persists, feel free to post again with proper and detailed information.
__________________ Grand Theft Auto 4 PC Video Game |
|
#6
| ||||
| ||||
| Re: My VBScript code not working properly
I would like to tell you the common uses for VBScript, that include the following :
|
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "My VBScript code not working properly" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PS 3 redeem code is not working properly for ‘Dead Island Bloodbath Arena‘ | Kungfu Pandey | Video Games | 4 | 31-12-2011 12:23 PM |
| Tabpanel code not working properly in real software? | singham2011 | Software Development | 5 | 30-07-2011 08:12 AM |
| How to add VBScript code in a page | Aahlaadith | Software Development | 6 | 30-11-2010 12:38 AM |
| This device is not present, is not working properly, or does not have all its drivers installed. (code 24) | McGrawh | Operating Systems | 3 | 02-07-2009 12:10 PM |
| Error Code 31: DVD drive not working properly | Lord | Operating Systems | 3 | 03-03-2009 06:14 PM |