Adding smart BASIC to Xcode Tutorial

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Adding smart BASIC to Xcode Tutorial

Post by Elliot »

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?

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Adding smart BASIC to Xcode Tutorial

Post by Mr. Kibernetik »

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?
Please create a separate topic in "Other topics" section if your question goes out of the scope of this SDK topic.

You must be sure that this file runs on your device without errors.

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Adding smart BASIC to Xcode Tutorial

Post by Elliot »

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?

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Adding smart BASIC to Xcode Tutorial

Post by Mr. Kibernetik »

How did you transfer this one-line program from your iPhone (aka device) to your Xcode project on Mac?

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Adding smart BASIC to Xcode Tutorial

Post by Elliot »

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.

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Adding smart BASIC to Xcode Tutorial

Post by Elliot »

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.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Adding smart BASIC to Xcode Tutorial

Post by Mr. Kibernetik »

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.
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
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Adding smart BASIC to Xcode Tutorial

Post by Elliot »

Should I try writing a simple BASIC program, creating it in the Mac text editor and put that into Turtle.txt?

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Adding smart BASIC to Xcode Tutorial

Post by Mr. Kibernetik »

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.

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Adding smart BASIC to Xcode Tutorial

Post by Elliot »

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.

Post Reply