Advertisement

07.10.2008 at 12:12PM PDT, ID: 23555059
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

VB Script - Error: Unterminated string constant / Code: 800A0409

Asked by mgjust in VB Script

Hello,
Could someone please help me with these errors in my VBScript?

In the code I attached below I get this error when executed:

Line: 23
Char: 96
Error: Unterminated string constant
Code: 800A0409
Source: Microsoft VBScript compilation error

But if I change:

myFile.WriteLine("SUITABILITY IMAGE FOR SIMULATION 1      :    c2_mce_" & mynumber & ")

to

myFile.WriteLine("SUITABILITY IMAGE FOR SIMULATION 1      :    c2_mce_" & mynumber)

I get this error:

Line: 48
Char: 6
Error: Expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error

Thanks,
MJStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
DIM fso, myFile
for mynumber = 75 to 407
        Set fso = CreateObject("Scripting.FileSystemObject")
        Set myFile = fso.CreateTextFile("C:\temp\temp2\" & mynumber & ".gmd", True)
        if mynumber < 100 then mynumber = "0" & mynumber
        myFile.WriteLine("***************************************************************")
        myFile.WriteLine("* THIS FILE CONTAINS THE VALUES OF THE PARAMETERS REQUIRED    *")
        myFile.WriteLine("* FOR THE GEOMOD MODULE, WHICH AUTOMATICALLY IS GENERATED IN  *")
        myFile.WriteLine("* IDRISI. STRONGLY RECOMMEND REEDITING IN IDRISI IF NECESSARY.*")
        myFile.WriteLine("***************************************************************")
        myFile.WriteLine("")
        myFile.WriteLine("TIME TO BEGIN GEOMOD, INCLUSIVE         :    2001")
        myFile.WriteLine("TIME TO END GEOMOD, INCLUSIVE           :    2016")
        myFile.WriteLine("TIME STEP IN TIME UNITS                 :    1")
        myFile.WriteLine("")
        myFile.WriteLine("# NEIGHBORS AWAY TO SEARCH,0=NO NIBBLE  :    1")
        myFile.WriteLine("WRITE DEBUG OUTPUT TO LOG FILE,YES=1    :    0")
        myFile.WriteLine("NAME OF STRATA/MASK IMAGE               :    N/A")
        myFile.WriteLine("NAME OF INITIAL LANDUSE IMAGE           :    gr_lc_01b_" & mynumber & "_fp")
        myFile.WriteLine("DO ENVIR. IMPACT ANALYSIS? 1=YES, 0=NO  :    0")
        myFile.WriteLine("CMP/READ SUITABILITY SCORES(0=CP,1=RD)  :    1")
        myFile.WriteLine("NUMBER OF RUNS ONCE                     :    1")
        myFile.WriteLine("SUITABILITY IMAGE FOR SIMULATION 1      :    c2_mce_" & mynumber & ")
        myFile.WriteLine("DO VALIDATION ANALYSIS? 1=YES, 0=NO     :    0")
        myFile.WriteLine("SINCE NO VALIDATION IMAGE, LANDUSE CHANGE INFO READ FROM FOLLOWS:")
        myFile.WriteLine("LANDUSE STATE 1       LANDUSE STATE 2")
        myFile.WriteLine("RGNVAL          REGION NAME    # CELLS      BEGIN        END      BEGIN        END")
        myFile.WriteLine("     1             Region 1     294276     152838     140000      78439      91277")
       Set objFSO2 = CreateObject("Scripting.FileSystemObject")
       Set objFile = objFSO2.OpenTextFile("c:\temp\temp2\gemodpixels.txt", ForReading)
 
       Const ForReading = 1
 
       Dim arrFileLines()
       i = 0
       Do Until objFile.AtEndOfStream
       Redim Preserve arrFileLines(i)
       arrFileLines(i) = objFile.ReadLine
      myFile.WriteLine(arrFileLines(i))
      i = i + 1
      Loop
      objFile.Close
      myFile.WriteLine("")
      myFile.WriteLine("# OF TIMES OF OUTPUT BESIDE END TIME    :    0")
      myFile.WriteLine("NAME OF OUTPUT LANDUSE IMAGE            :    delete_test")
        
      myFile.Close
next mynumber
end sub
[+][-]07.10.2008 at 01:15PM PDT, ID: 21976957

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: VB Script
Sign Up Now!
Solution Provided By: DarkoLord
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.10.2008 at 01:21PM PDT, ID: 21977011

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.10.2008 at 01:22PM PDT, ID: 21977025

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 03:51PM PDT, ID: 21978053

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628