0

First off, I'm really new to java, so I apologize if this is obvious. Below is the first 6 lines of my script:

function myFunction (){

}import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

The erorr message I'm getting is this: Missing ; before statement. (line 3).

If you need more of the script to make sense of the error, please let me know.

3
  • 1
    import... are java (not javascript) statements. You are mixing 2 different programming languages. Commented May 14, 2012 at 20:13
  • So I corrected my statement about javascript... but my question still stands... any takers? Commented May 14, 2012 at 20:35
  • 1
    Your question is nonsensical as you're asking about a javascript parsing error you receive when you put java code in the javascript editor. Either change your question or update your code. So far, what you're posting is not Google Apps Script. Commented May 15, 2012 at 1:26

2 Answers 2

1

The import statements you are using are part of the Java programming language. Google Apps Script code is written in JavaScript, which has a similar name but is actually very different. From JavaScript's Wikipedia page:

JavaScript copies many names and naming conventions from Java, but the two languages are otherwise unrelated and have very different semantics.

If you want to learn how to program in JavaScript, Code Academy is a good place to start.

Sign up to request clarification or add additional context in comments.

Comments

0

Because you're trying to program in java instead of javascript maybe ?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.