Importing Files in SmartBasic SDK

User avatar
greycheek
Posts: 34
Joined: Sun Mar 15, 2015 3:14 pm
My devices: MacBook Air, Iphone 6+, Ipad 2

Re: Importing Files in SmartBasic SDK

Post by greycheek »

Did that. Now instead of "INPUT without Data . . .", I'm getting a Syntax error in the "DRAW IMAGE" command of one of the images external to the SmartBasic code.

User avatar
greycheek
Posts: 34
Joined: Sun Mar 15, 2015 3:14 pm
My devices: MacBook Air, Iphone 6+, Ipad 2

Re: Importing Files in SmartBasic SDK

Post by greycheek »

How is the SmartBasic code interpreted or compiled within Xcode?

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: Importing Files in SmartBasic SDK

Post by Mr. Kibernetik »

greycheek wrote:How is the SmartBasic code interpreted or compiled within Xcode?
Exactly the same as it is done in smart BASIC itself. Smart BASIC interperter is included to run your program.

User avatar
greycheek
Posts: 34
Joined: Sun Mar 15, 2015 3:14 pm
My devices: MacBook Air, Iphone 6+, Ipad 2

Re: Importing Files in SmartBasic SDK

Post by greycheek »

If the interpreter is included, then is there any way to monitor its code execution? That way Maybe I can track down the problems with my program code.

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: Importing Files in SmartBasic SDK

Post by Mr. Kibernetik »

Debugging is not allowed here. All tests should be performed on your device, and then program simply copied to "Samples" folder of the SDK exactly as it is on your device. In SDK similar copy of "smart BASIC" is running your already tested code.

Please note that iOS Simulator is not always equal to a real device in its execution. Especially it concerns files names - on device file system is case sensitive, on simulator - not.

User avatar
greycheek
Posts: 34
Joined: Sun Mar 15, 2015 3:14 pm
My devices: MacBook Air, Iphone 6+, Ipad 2

Re: Importing Files in SmartBasic SDK

Post by greycheek »

Fixed the problem. Apparently filenames cannot be passed as literals; they must be assigned to a string variable first, and passed that way. Also, each time the program is run through the simulator, the previous run must be deleted from the home screen of the simulator, before any code changes are reflected.

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: Importing Files in SmartBasic SDK

Post by Mr. Kibernetik »

greycheek wrote:Fixed the problem. Apparently filenames cannot be passed as literals; they must be assigned to a string variable first, and passed that way. Also, each time the program is run through the simulator, the previous run must be deleted from the home screen of the simulator, before any code changes are reflected.
This code works fine in SDK:

Code: Select all

graphics
draw image "1.jpg" at 0,0

User avatar
greycheek
Posts: 34
Joined: Sun Mar 15, 2015 3:14 pm
My devices: MacBook Air, Iphone 6+, Ipad 2

Re: Importing Files in SmartBasic SDK

Post by greycheek »

graphics
draw image "1.jpg" at 0,0

I have not been able to refetence a literal string as in the above example without generating a syntax error.

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: Importing Files in SmartBasic SDK

Post by Mr. Kibernetik »

greycheek wrote:graphics
draw image "1.jpg" at 0,0

I have not been able to refetence a literal string as in the above example without generating a syntax error.
I checked it right now, with latest SDK in Simulator of iPhone 5s.

Post Reply