I am getting close!! I got it to run on the iphone simulator. Instead of the actual Turtle program, I just had a one-line BASIC program:
PRINT "My name is Elliot."
The simulator produced an error message on the phone face:
Syntax error
PRINT "My name is Elliot."
OK
So what now?
Adding smart BASIC to Xcode Tutorial
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Adding smart BASIC to Xcode Tutorial
Please create a separate topic in "Other topics" section if your question goes out of the scope of this SDK topic.Elliot wrote:I am getting close!! I got it to run on the iphone simulator. Instead of the actual Turtle program, I just had a one-line BASIC program:
PRINT "My name is Elliot."
The simulator produced an error message on the phone face:
Syntax error
PRINT "My name is Elliot."
OK
So what now?
You must be sure that this file runs on your device without errors.
Re: Adding smart BASIC to Xcode Tutorial
I am not sure what you mean. Of course this one-line basic program runs on my iPhone using smartBASIC. What "device" do you mean? Isn't the error message generated on my iphone simulator coming from your BASIC interpreter?
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Adding smart BASIC to Xcode Tutorial
How did you transfer this one-line program from your iPhone (aka device) to your Xcode project on Mac?
Re: Adding smart BASIC to Xcode Tutorial
Used your smartBASIC Dropbox option, so it was uploaded to my Dropbox and downloaded into Download files on the Mac. Finally, copied and pasted into Samples folder.
Re: Adding smart BASIC to Xcode Tutorial
I left out one minor thing: I had to change the extension of the file from .txt to .xxt before I sent it to Dropbox: dropbox does not allow txt file transmissions (I think). I renamed it after putting it on the Mac.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Adding smart BASIC to Xcode Tutorial
So, if it is the same file (extension change does not matter) then it is very strange. Because it should not give syntax error on Simulator if it works fine on your device.Elliot wrote:I left out one minor thing: I had to change the extension of the file from .txt to .xxt before I sent it to Dropbox: dropbox does not allow txt file transmissions (I think). I renamed it after putting it on the Mac.
Re: Adding smart BASIC to Xcode Tutorial
Should I try writing a simple BASIC program, creating it in the Mac text editor and put that into Turtle.txt?
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Adding smart BASIC to Xcode Tutorial
If you can create simple text file then why not.
But safe way is to transfer working file from device to the Mac.
What about turtle.txt then you can use any file name. Also you can try this program from the forum.
But safe way is to transfer working file from device to the Mac.
What about turtle.txt then you can use any file name. Also you can try this program from the forum.
Re: Adding smart BASIC to Xcode Tutorial
I think I am getting close to the problem. On the Mac, I copied the real Turtle program from your website tutorial link, then pasted it into a newly created file I called RealTurtle.txt (using Mac TextEdit) and saved it in the download area. I then copied and pasted the file into the Samples folder (and changed the AppDelegate.m file appropriately) . This time I got the error message: Nothing to execute.
I think something is happening in the Mac text editor. I have selected "Make Plain Text" from the Textedit menu. It saved it as Unicode(UTF-8). Should it have been Unicode (UTF-16) or something else? It seems that the text file is not being recognized as such.
I think something is happening in the Mac text editor. I have selected "Make Plain Text" from the Textedit menu. It saved it as Unicode(UTF-8). Should it have been Unicode (UTF-16) or something else? It seems that the text file is not being recognized as such.