Microsoft KB Archive/155087

= PRB: Script Error: Expected "End" but Found Unknown Token =

Article ID: 155087

Article Last Modified on 12/14/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0b for Macintosh

-



This article was previously published under Q155087



SYMPTOMS
When a RUNSCRIPT command is issued in FoxPro, the following error message is returned:

Script error: Expected "End" but found unknown token



CAUSE
The script was created in the FoxPro file editor that places carriage returns and line feed characters at the end of each line.



WORKAROUND
Use SimpleText editor or Script Editor to create script. Or, in FoxPro, do one of the following to eliminate the line feed characters at the end of each line:

 From the Tools menu, select Options, and then select the edit tab. Clear the Save with Line Feeds checkbox. Use the FoxTools.CFM FxStripLF function. For more information about using this function, please see the following article in the Microsoft Knowledge Base:

109481 How to Strip Linefeeds from Exported (.TXT) Files





STATUS
This behavior is by design.



Steps to Reproduce Behavior
  Open a file by typing the following in the Command window: MODIFY FILE Run_My_Sript   Enter the following in the File window: ON RUN(fldname) DISPLAY DIALOG fldname -- company name sent from FoxPro displays RETURN fldname  -- send company name back to FoxPro END RUN </li> Save the above as run_my_script in the vfp\samples\data subdirectory.</li>  Create the following FoxPro program in the vfp\samples\data subdirectory: SET DEFAULT TO SYS(2004) + ":samples:data" USE "customer.dbf" RUNSCRIPT "run_my_script" ; to X with customer.company ? X    && company name is returned  to X from Script </li> Save and run the above program.</li></ol>

<div class="references_section">