3.1 version

User avatar
Dutchman
Posts: 851
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: 3.1 version

Post by Dutchman »

Command OPTION BASE will accept expressions:
Is that also possible for labels?
I want to RESTORE to data in external files, included via brackets {…}.
The external files begin with a label before the DATA.
It would be much easier if these could be adressed via a Label$(x),
otherwise I have it to code it 'hard' on places where I could need it dependent on certain conditions

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: 3.1 version

Post by Mr. Kibernetik »

I am afraid, I did not get your idea. Can you please explain it more?

User avatar
Dutchman
Posts: 851
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: 3.1 version

Post by Dutchman »

I am working on a program to map city-coordinates on a Mercator-projection map.
It should become a game on topography :D
I have a lot of files with DATA lines containing City-name, and its coordinates and size
e.g. The file 'major cities Russia.txt' starts with

citiesRussia:
DATA 300 ' number of cities
' city latitude longitude size
DATA "Moskva",55.750,37.620,11102300
DATA "Sankt-peterburg",59.930,30.320,4079400
……

There are also files for 'World' with a lot of small countries, a file 'USA' etc.
I would like to collect all the labels in an array e.g.
Label$(1)="citiesRussia"
Then I can program :
RESTORE TO Label$(n)

instead of what I am programming now:
ON n GOTO russia,usa,france,…
russia:
RESTORE TO citiesRussia
GOTO ReadData
usa:
RESTORE TO citiesUSA
GOTO ReadData
france:
RESTORE TO citiesFrance
GOTO ReadData
……
……
ReadData:
READ cities ' number of cities
FOR i=1 to cities
FOR j=1 TO 4
READ city$(i,j)
……
……

So a label-variable would make it a lot easier.

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: 3.1 version

Post by Mr. Kibernetik »

Ok, I understand.
Thank you for your suggestion!

User avatar
Dutchman
Posts: 851
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: 3.1 version

Post by Dutchman »

It would also be very helpful if there was a function 'LABEL_EXIST(label$)'
Then it is possible to check wether a file e.g. a language file, is included or not.
example:

Code: Select all

IF LABEL_EXIST("German") THEN
  RESTORE TO German
ELSE
  RESTORE TO English
ENDIF
E.g in the topography-program which I described, the start-up speed becomes a lot faster if non-used include-files are omitted.
Now I have also to adapt the program on places where the associated labels are used or make special constructions.

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: 3.1 version

Post by Mr. Kibernetik »

Ok, good.

Also probably new file command to append one file to another will be great to run dynamically-created programs.

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: 3.1 version

Post by Mr. Kibernetik »

About RESTORE.
What about syntax like this:

ON x RESTORE TO label1, label2,...

User avatar
Dutchman
Posts: 851
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: 3.1 version

Post by Dutchman »

Great! I look forward to it and prepare my code for that.
Thanks.

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: 3.1 version

Post by Mr. Kibernetik »

New feature called "sprites" will be introduced:

Sprites are separate graphics layers which do not depend upon main graphics window. They are displayed above it and have their own position, rotation, transparency and other parameters. Like any object in smart BASIC, each sprite must have its own unique name. Before using a sprite, it must be created at first with commands SPRITE BEGIN/SPRITE END, SPRITE LOAD or SPRITE SCAN. Sprite visibility on the screen is defined by commands SPRITE SHOW and SPRITE HIDE.
By default, sprites display order depends on order of their creation, but it may be changed using command SPRITE ORDER.
It is recommended to use PNG image files to load and save sprite images, because this file format supports image transparency.

SPRITE n$ ALPHA x
sets transparency of sprite with name [n$] to value [x]. Valid values are from 0 to 1.

SPRITE n$ AT x,y SCALE s ANGLE a
places sprite with name [n$] at coordinates [x] and [y], sets its scale to value [s] and rotates it to angle [a]. Scaling and rotation are performed relatively the center of the sprite. By default scale is 1 and angle is 0. Parameters SCALE and ANGLE are optional, their order is arbitrary. OPTION ANGLE command affects this command.

SPRITE n$ BEGIN w,h
switches graphics screen to sprite drawing mode for sprite with name [n$], and sets its size to [w] points in width and [h] points in height. Usual graphics commands operate in this mode, but they draw current sprite only instead of drawing in common graphics window. In this mode common graphics window is not visible. Sprite drawing must be finished with command SPRITE END, which closes sprite graphics window and switches to common graphics mode.

SPRITE n$ DELETE
deletes sprite with name [n$].

SPRITE n$ END
finishes drawing of sprite with name [n$] and switches drawing mode to common graphics screen. This command must be executed to finish sprite creation, started by command SPRITE BEGIN.

SPRITE n$ HIDE
hides sprite with name [n$] off the screen.

SPRITE n$ LOAD f$
creates sprite with name [n$] from the contents of image file [f$]. Valid image types are: JPG, PNG, BMP, GIF, TIF, ICO, CUR, XBM.

SPRITE n$ ORDER k
sets screen depth display order for sprite with name [n$]. By default order indices start with 0. Sprite with higher order index is displayed above the sprite with lower order index. OPTION BASE command affects this command.

SPRITE n$ RESIZE w,h
changes physical size of sprite with name [n$] to [w] points wide and [h] points high.

SPRITE n$ SAVE f$
saves sprite with name [n$] to image file [f$]. Valid image file types are: JPG, PNG. If file extension is not set then PNG file type is used.

SPRITE n$ SCAN x,y, w,h
creates sprite with name [n$] from the part of common graphics screen, which is located at coordinates [x], [y], having width [w] and height [h].

SPRITE n$ SHOW
shows sprite with name [n$] on the screen.

SPRITE n$ STAMP
leaves a stamp of sprite with name [n$] on the common graphics screen using all current parameters of the sprite. It is not necessary for sprite to be visible on the screen when using this command.

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: 3.1 version

Post by Mr. Kibernetik »

Bug of non-working UNDO on iOS 6 and higher will be corrected.

Color text highlighting will become available for iOS 5.

Post Reply