PDA

View Full Version : Unrecoverable Parse Error


chaoconnor
04-07-2004, 10:51 AM
Good morning!

I'm trying to parse a text file that contains a list of database object names. The process works fine till it reaches a write to text file step and then I get the following errror:

Building project step 'Create RawAll.sql File'...
Step default property 'Filename' = 'C:\Temp\RAW_SQL.txt'
Error expanding macros in property Text: <Error parsing macros: Unrecoverable Parse Error at position 919 - expecting percent_sign>
Step 'Create RawAll.sql File' failed
Build ended.


What's so perplexing is the MARCO that fails is different each time. For instance, one time I may have successfully parsed 100 file names, the next I may only get 20, etc. The list of names does not change, it's been the same since I started.

Any ideas? Thank you!

kinook
04-07-2004, 11:16 AM
Whatever is in the Text field of the failing step contains a lone percent sign (%) character. Percent signs (i.e. %MACROX%) in a step field are interpreted by VBP as a macro name to be expanded as its value; to insert an actual percent char, double percents are used (%%).

It's not clear exactly how this field is being initialized in your case, but if you're reading the contents of a file which may contain such characters, you can use the vbld_GetFileContents system function (added in version 5.2) to double up any special characters so they will be interpreted as literals by VBP.

chaoconnor
04-07-2004, 11:19 AM
That was my first thought as well, but there are no % signs in the text file it's reading from, nor does that explain why it works for a file name one time, but then may fail on it the next.

Does vbld_GetFileContents replace vbld_AddDelimValue "FILE_LIST", f.ReadLine() I've been using?

Thank you!

kinook
04-07-2004, 11:44 AM
Not sure then. Break it down to a reproducible case that we can build, attach the .bld file here, and we'll take a look at it. And also post the info from Help | About | Install Info. Thanks.

chaoconnor
04-07-2004, 11:56 AM
will do:
Help Info -
Visual Build Professional 5.3
Registered to: Aramark (1-computer license)
Windows Version: 5.1.2600.1.0
Install path: C:\Program Files\VisBuildPro
cmax20u.dll version 2.1.0.21
SftTree_IX86_U_45.dll version 4.5a
unins000.exe version 51.13.0.0
VisBuildBld.dll version 5.3.0.0
VisBuildCmd.exe version 5.3.0.1
VisBuildCore.dll version 5.3.0.1
VisBuildDotNET.dll version 5.3.0.0
VisBuildExt.dll version 5.3.0.1
VisBuildLog.dll version 5.3.0.1
VisBuildMisc.dll version 5.3.0.1
VisBuildMS.dll version 5.3.0.1
VisBuildNet.dll version 5.3.0.1
VisBuildPro.exe version 5.3.0.1
VisBuildSvr.dll version 5.3.0.1

Thanks for your help!

kinook
04-07-2004, 12:16 PM
The project won't build here. The 'Create RawAll.sql File' step fails because SQL_FILES is an undefined macro; it's also referencing a file nameddbnewarcs1.fnGetDedn_Rate.UDF which I don't have.

But try changing

[vbld_FSO.OpenTextFile("%SQL_FILES%\%NEXT_FILE%").ReadAll]

in that step to

[vbld_GetFileContents("%SQL_FILES%\%NEXT_FILE%")]

kinook
04-07-2004, 12:26 PM
And if the step still fails, when it fails, open the step properties dialog, separately select each macro referenced in the step (i.e., %DBLOGIN%, etc.) move the mouse away from the edit field and back again; if an error is displayed in the tooltip, that macro value is likely the problem. Click the Insert Macro button, locate the macro in question to see its unexpanded macro value, and the problem should be apparent.

chaoconnor
04-07-2004, 01:54 PM
The [vbld_GetFileContents("%SQL_FILES%\%NEXT_FILE%")] seems to have done the trick. Thank you very much!