-
Jul 15th, 2015, 12:43 PM
#1
Thread Starter
Frenzied Member
Μ2000 version 8 coming soon
A new version, 8th coming soon.
I have some little things to do, but for 99% language improved. Great updates in three major points: Speed enhance (about 2 times faster), Popup menu in editor now is a new dialog, with zoom function (as all dialogs in M2000), and the better one..now the language has Classes.
Another strong point is the adaptation of old basic commands and style of programming with the object oriented programming; So in one environment we can run this:
Code:
>Edit Run
100 Rem this is my first program
110 Def FNa(x)=x**2+100 : Def beta(x)=x*10+30
120 Input "Your name:", A$
130 Print "Thank you ";A$, FNa(4), beta(5)
>Run
Your name:_
We can use statements (commands) REM, LET, NEW, PRINT, INPUT, IF THEN, FOR NEXT, CLS, CLEAR, DEF FN, SUB, GOSUB, GOTO, RETURN, OPEN, CLOSE, WRITE, LINE INPUT, DATA, READ, ON GOTO, ON GOSUB, SAVE, LOAD.
In any module or function we can place Subs. All variables from module/function can be alteres from a sub ecxept the local ones. In sub Alfabeta locals art X,Y,L. We can use recurrsion in those subs. Any new variable, array or module or function inside sub deleted after the end of sub execution. We can use EXIT SUB. Subroutines are searched from bottom of the code, with no case sensitive search, and we can pass by reference anything (in version 8 we can passs functions too) using &.
Code:
L=50: K=100 :Gosub Alfa(10,30) \\ gosub needed to call a sub
Print L, K \\ 50 and 101
SUB AlfaBeta(X, Y)
Local L=30
K++
Print X**2+Y
END SUB
Also we can use soubrutines without the isolation of a SUB. We can call that light subroutines by name (label) or by line number, without passing parameters. In these examples X must exist else we get an error. We can go to a subrutine from anywhere in a module. In version 8 we handle labels and line numbers beyond the physical boundaries of a block of code (blocks using brackets { } )
Labels are searched from top with case sensitive search.
Code:
Gosub 1000 : exit
1000 Print X : Return
Code:
Gosub AlfaBeta
AlfaBeta: \\ see the colon at the end of AlfaBeta
Print X: Return
The real big leap in M2000 is the adaptation of the copy aproach. This means that we can copy arrays, we can copy groups, we can return in functions arrays. But the bigger leap is the use of float groups, and these are objects. So we have classes as functions that return float groups. A float group can be grounded make it as a variable in a module or we can save it in an element in an array. In either case we still can reach anything inside, like variables, arrays, modules, functions. A function in a group can use variables and arrays of that group as static variables and arrays. We can change entirely an array in a group with another array. We can make free stule arrays with any group in any element (groups can be expanded any time, with more variables, arrays, modules, functions, groups as subgroups), or we can make class type, which mean that we can make arrays with groups with commons functions and arrays. In that last type we can expand any group with more variables and arrays but only for temporary use, we can place new modules anf functions.
So groups in M2000 are like cells in DNA and not object. They have a starting point, as a starting state, and can be expanded later. This is not the same as in objects in other languages because the expansion doing in real time, as the code executed and not as a descriptive manner just to have a link of code before we execute it. As cells we can delete a member, only we can change it. So maybe we have an array in a group, and in that array we have many other groups (float groups).
So how we can get values, or call functions or modules to a group in an array in a group? This is something that VB6 should be haved but only M2000 have. In vb6 we use WITH - WITH END but it isn't suitable for mutiple objects. Another think is the use of SET...we can set variables to objects to have a look on them. First in M2000 we copy groups in any state, ground state or float state (in an array element). Reference we can setup only for ground groups (ground groups exist by name in modules, float groups are nameless but we know where in an array exist). In M2000 we can use members of a group in any mode, and in any level of groups...a function in a group in a group in a group...can be called without setting objects or ground groups. All the work is doing by the interpreter.
Here we make a class alfa, we make an array of 100 items and in item 5 we "merge" an alfa class with different construction (we place 50 in X). We call functions Beta in two float groups in elements 3 and 5 and each function use element static variable X to produce the return value.
Code:
Class Alfa {
x=10
Module Alfa { If Match("N") then Read .x }
Function Beta {
read temp
=temp**2+.x
}
}
Dim A(100)=Alfa(30)
A(5)=Alfa(50)
Print A(3).Beta(20), A(5).Beta(20)
430 450
We can use a For Block (more better from a WITH in Vb6). With for we make a temporary ground group and in the end the group updated. The same happen in the one command mode but with for we speed up the things. We can use THIS to send a reference to the ground group, if we like to do a reference pass to a float group (interpreter use a hidden auto name, so we have to use THIS).
We can nest FORs and we can put many groups in each For
Code:
Form 60,25 \\ make a 60 characters by 25 lines, use auto line space.
Class alfaclass { b=10 }
Dim A(10)=alfaclass()
\\ third group's variables/arrays/functions/modules have 3 dots in that For.
For A(2),A(3),A(4) {
.b+=10 : ..b++ : ...b*=10 : k=.b+..b+...b
Print k
Print .b, ..b, ...b
}
A(1).b=2
Print A(A(1).b).b, A(3).b, A(4).b
Code available here:
This is the unfinished Language Definition (Version 8) in english
George
-
Jul 19th, 2015, 02:02 AM
#2
Thread Starter
Frenzied Member
Advance Example (version 8, for revision 9)
I make an example of using threads while inputing with various commands like INPUT and Edit.doc. So while we input something background threads running. One of them read targets on screen so through targets we can move, minimize or stop (here we go to next step) the window. M2000 can make a window smaller than screen and can do nice things, like moving, hiding etc.
- Basic style Input for input a number (terminal style chars)
- Field Input - Work the INS key (terminal style chars)
- One line transparent textbox, cut, copy, paste, drag/drop, no menu
- Multi line textbox with menu
- Multi line for documents with transparent background
I use the new SUBs to make some threads with AFTER. A thread from AFTER command run once after a period of time. So we have to place input commands in a thread.
Code:
MODULE A {Thread.plan sequential
dim label$(6)
label$(1)="Basic style Input for input a number", "Field Input - Work the INS key","One line transparent textbox, cut, copy, paste, drag/drop, no menu","Multi line textbox with menu","Multi line for documents with transparent background"
Read Example
\\Example=random(1, 5)
Escape Off
Global STATE=0
module global mayexit {
threads erase
wait 10
targets new
input end
Cursor 0,5 : Print Over : Print Part "End.."
Cls #72ff77, 7 \\split screen from 7 (8th line)
}
Hide \\ prepare window
Window 10,0 \\ center full size 10pt letters
\\Window random(9,14) , scale.x*.7, scale.y*.7; \\centered - random font size
Window 14, scale.x*.7, scale.y*.7; \\centered - font size 14 pt
Cls 15,0 \\white bacground - no split screen
Gradient 0,15 \\ two colors gradient
Move 0,0
Fill scale.x,scale.y/height-25,1,6,0 \\Gradient fill to window caption
Pen #FF7766
\\ Targets are from earlier versions - but works fine
\\ This is the windows caption. We change only a variable.
\\ Targets works with globals.
Target A,"STATE++",WIDTH-2,1,,,5,"M2000 THREAD-INPUT-HANDLE WINDOW"
Print @(width-2,0);
Pen 0
Let IamOut=False
\\ This is a second target, the X in the right corner
\\ when we click on it system call mayexit global module
Target b, {Title "M2000 Example",0} ,1,1,6,,5,"_"
Print @(width-1,0);
Target C, "mayexit" ,1,1,6,,5,"X"
Pen 15
Print @(0,1); \\ like Cursor
Report " Press some numbers keys and then the return key. Exit by clicking the X in the right up corner. You can move the window. There is another exit the Ctrl+C - or Break. Ctrl+C in some examples used for copy"
aa$=Field$("",10) \\ for second example - change gosub
Pen 0
Refresh 40
threads erase
Thread { scan 0.01 : thread this interval 10 \\ repeat interval
Cursor 0,4 : Print Over : Print Part ~(0),"waiting..." , kk
} as LL : Thread LL interval 10
scroll split 1
Thread { \\ this thread used for moving the window
Cursor 0,5 : Print Over "MOVING"
Motion.W Motion.XW-MX+MOUSE.X,Motion.YW-MY+MOUSE.Y
If Mouse=0 Then {
STATE<=0: Thread this hold : Cursor 0,5 : Print Over "Hold": REFRESH
}
} As Moveme
Thread moveme hold \\ not started yet
Thread moveme interval 100 \\ we set an interval
Let kk=0, MayStart=True
main.task 10 {
kk++
If MayStart Then {
A$=Inkey$
If A$<>"" Then {
Cursor 0,5 : Print Over : Print Part Label$(Example)
MayStart~: keyboard A$
select case Example
case 1
gosub OpenField()
case 2
gosub OpenField1()
case 3
gosub OpenField2()
case 4
gosub OpenField3()
else
gosub OpenField4()
end select
}
}
If iamout Then iamout~: Cursor 0,5 : Print Over : Print Part "You press escape..."
If STATE=1 Then {
Cursor 0,5 : Print Over : Print "start move"
MX=Mouse.X:MY=Mouse.Y \\ setup now position
Thread moveme restart \\here we restart thread
STATE++ \\ and we closed this if
}
}
Cls
\\cursor 0, row-1
\\pen 15 { Report 2, "Just press enter or F1 to see the code" }
\\fkey 1, "Edit a"
\\keyboard "A"
sub OpenField()
after 10 { \\ this is an automatic thread, for one time, after 10 miliseconds
again:
Cursor 10,10
for i=1 to 4 : Print Over : Pen 15 { Print under } : next i
Cursor 10,10
A=0
try ok { Input "Number:", A } \\ we can use INPUT in a thread.
If ok Then { Cursor 0,6 : Print Over "Field:";A } else goto again
MayStart=True
}
end sub
sub OpenField1() \\this is an alternative by using Field
after 10 {
Field 10,10,10 AS aa$
If Field=99 Then {
IamOut=True : aa$=""
Field New \\ clear feedback from Field statement.
A$=Inkey$
} else Cursor 0,6 : Print Over "Field:";aa$ : aa$=""
MayStart=True
}
End Sub
sub OpenField2()
after 10 {
Cursor 10,10
aa$=inkey$
if aa$<" " then aa$=""
input ! aa$, 10 len=30
If Field=99 then { mayexit } else Cursor 0,6 : Print Over "Field:";aa$ : aa$=""
Field New
MayStart=True
}
End Sub
sub OpenField3()
after 10 {
Cursor 10,10
clear aa$
aa$=inkey$
if asc(aa$)<32 then aa$=""
input ! aa$, 20, 8
document aa$ \\ upgrade to document
Cursor 0,6 : Print Over "Field:";paragraph$(aa$,1) : aa$=""
MayStart=True
}
End Sub
sub OpenField4()
after 10 {
Cursor 10,10
clear aa$
Document bb$="" \\ this is a new variable, but not for SUB, sub ends before this thread run.
bb$=inkey$
if asc(bb$)<32 then clear bb$
scroll split 10
pen 1 {
Edit.Doc bb$, 1,,pen
}
Cursor 0,6 : Print Over "Field:";paragraph$(bb$,1)
clear bb$
MayStart=True
}
End Sub
}
MODULE B {FOR I=1 TO 5
A I
NEXT I
}
Last edited by georgekar; Jul 20th, 2015 at 03:25 AM.
-
Jul 23rd, 2015, 04:14 PM
#3
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Last revision 12.
The 8th version of language is finished. I have only to complete the language definition, and include more commands to help file. I wait until help file have all commands and then I make an installation program. But to install the language is easy and can be done any time. Only two files needed to run M2000 with help (using Help command): M2000.exe and Help2000.mdb. We can place in any folder. Also we can use ca.crt as root certificate so the execute file can be run as a trusty one. All libraries included in all windows, Windows XP is the minimum system to run)
After first run write Settings to open Settings dialog. Choose font and basic colors, plus line space.
Use edit AnameForModule to start edit a program. Press escape and run the module by using the name AnameForModule. Or you can do a Test AnameForModule
-
Jul 23rd, 2015, 04:25 PM
#4
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
This is an example from a Microsoft tutorial for Delegates. Here I use function by reference, so a group made of class booktype can get a reference of any suitable function and pass a reference of this (the group itself) plus a variable for a walk through all elements in group. One of the function we pass is a part of another group and has the ability to run in "host" group but with access to own group common variables (to store the total number). So this function not only is a function but is like a separate process, with own memory.
Code:
class booktype {
local countme=0
dim t$(), a$(), p(), pb()
module AddBook {
newdim =.countme+1
dim .t$(newdim), .a$(newdim), .p(newdim), .pb(newdim)
read .t$(.countme), .a$(.countme), .p(.countme), .pb(.countme)
.countme++
}
module ProcessPaperbackBooks {
read &AnyFunction()
if .countme<1 then exit
for i=0 to .countme-1 {
if .pb(i) then call AnyFunction(&this, i)
}
}
}
function PrintTitle {
read &AnyBook, i : Report format$(" {0}", AnyBook.t$(i) )
}
class PriceTotaller {
local items, total
function processBook { read &AnyBook, i : for this {.items++ : for Anybook {.total+=..p(i) } }}
module zero { .total<=0 : .items<=0 }
function AveragePrice { if .items>0 then =.total/.items }
}
bookDB=booktype()
PriceTotaller1=PriceTotaller()
report "First Book DB"
for bookDB {
.AddBook"The C Programming Language", "Brian W. Kernighan and Dennis M. Ritchie", 19.95, true
.AddBook"The Unicode Standard 2.0", "The Unicode Consortium", 39.95, true
.AddBook"The MS-DOS Encyclopedia", "Ray Duncan", 129.95, false
.AddBook"Dogbert's Clues for the Clueless", "Scott Adams", 12.00, true
.ProcessPaperbackBooks &PriceTotaller1.processBook()
report "Average Paperback Book Price: $" + str$(PriceTotaller1.AveragePrice(),"#.##")
.ProcessPaperbackBooks &PrintTitle()
}
report "Second Book DB"
PriceTotaller2=PriceTotaller()
SecondbookDB=booktype()
for SecondbookDB {
.AddBook "Any Big Big and Big Tilte", "Any Author", 3.45, true
.ProcessPaperbackBooks &PriceTotaller2.processBook()
report "Average Paperback Book Price: $" + str$(PriceTotaller2.AveragePrice(),"#.##")
.ProcessPaperbackBooks &PrintTitle()
}
Last edited by georgekar; Jul 23rd, 2015 at 04:31 PM.
-
Jul 28th, 2015, 04:46 AM
#5
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Revision 15.
I would like to have a caret on the main form to stop flashing when I change focus to other form in application or to other application. So this revision do exactly that plus better handling for process time sharing, tuned using windows task manager. So now in an Input or a field command (these have no control but uses a part of a vb picturebox) we get zero time for application. I check that with threads also, using example at post #2
-
Jul 31st, 2015, 06:34 PM
#6
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Current revision 20
Now TAN(89.999) show result;
Also I fix a problem with WIDE RANDOM files.
Writing the Language Definition I test the code also.
-
Aug 3rd, 2015, 04:14 PM
#7
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Current Revision 24
I found a bug in gosub...return (after 1000 we get an ESC from an automatic safety guard..inside m2000, I have miss to decrement the levels in gosub to label - gosub to subs works fine).
Also I add in Thread { } as L
this: Thread { } as L interval 100
Previous we have to do that: Thread { } as L : Thread L interval 100
So now we can do that with one use of L (old way stay as is, also there is Thread This Interval 100 to reprogram the interval inside thread, when thread is out of pool).
Finally I found the best way to not use compatibility mode, see here http://www.vbforums.com/showthread.p...atibility-mode
If anyone want to run M2000.exe can get it from dropbox, download the zip file with source and extract M2000.exe and Help2000.Mdb. No installation needed, no need for any dll (except those from OS, ADO and VB6 runtime).
For opening in Vb6 (Enterprise edition), need to set a Greek font (to see the greek commands side by english), and needed a reference to a Idispatch.tlb (is in zip file). Subclassing for mouse wheel scroll is stoped in IDE. Threads run perfectly in IDE, because I use an external "executer". See TaskMaster.cls (this class I found before years, and now I can't find the source again..but I change it a lot especially the timing system). If anyone knows which is the first writer of TaskMaster.cls let me know to write in Language Definition. See in sign under.
Last edited by georgekar; Aug 4th, 2015 at 02:47 AM.
-
Aug 5th, 2015, 11:14 AM
#8
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Current Version 25
I put a Wait 0 in Refresh (without parameter) and now no problem happen...in any case (as I know until now)
This is a video to show the result of a test in Windows 7 in a VirtualBox in Ubuntu Studio, with Kdenlive to take a screen video 1280x1024 15 frames...The task here was to take a look in Resource Monitor.to see if any M2000.exe going red, non response, for any notable period of time. Also I saw how we can minimize the forms, because there is no button, except in Wind2 example where I have a target with underscore where we can click and minimize the window. Also we can minimize by using the "minimize all" button right in the taskbar. The problem now is not happen, no noticeable red letters in resource monitor. I put two M2000.exe to run with threads also.
It is 8 minute and 11 seconds...take a look.
-
Aug 5th, 2015, 01:37 PM
#9
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Current revision 26
25 has a serious bug (I hide a line of code and forget to unhide) and an Input from console stopped if no thread run (inside M2000) and form lost focus. Now is ok (the code was there....).
I am writing the Language Definition..Help2000.Mdb have no all commands, there are more to append. Last append Thread.Plan
-
Aug 10th, 2015, 10:20 AM
#10
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Current revision 27
in format$() we can place {n:m} where n is parameter from 0 and m are the decimal to round for numbers. We can include more times a parameter in string and with different round value
Print format$("One={0}, Two={0:2}", 1.56789), "οκ"
Print "One=";1.56789;", Two=";str$(1.56789,"#.##"), "οκ"
One=1.56789, Two=1.57 ok
One=1.56789, Two=1.57 ok
For scientific numbers we need special care for str$
Print str$(1.56789e33,"#.##e-###")
or print as number
Print val(str$(1.56789e33,"#.##e-###"))
But in Format$() it is change automatic.
print format$("A={0:2} eV", 1.56789e33)
Also I do a fix to $()
Print $("@@-@@-@@"), 12, 1234, 123456, $("")
- -12 -12-34 12-34-56
We can place a vb format string in every print until we change it.
command Print Part can be used to temporary make changes to columns and format$
All print output can be done to all layers and printer.
Printer 12 { \\ we can define the basic font size in pt
\\ we can use Page to change page, or Page 1 to change to a portrait page, Page 0 to change to a landscape
}
M2000 save properties for each printer
Printer ! \\ we open printer properties
A$=properties$ \\ we can save properties to a string
Properties A$ \\ we can reload properties
Printer ? \\ we can choose printer
We can choose printer by code
Printer 12, "Send To OneNote 2007 (Ne00" \\need port name also
All graphics commands can be used to printer. We just use commands inside a Printer {} block.
-
Aug 10th, 2015, 05:11 PM
#11
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Current Version 28
As I wrote Language Definition I run all examples, so I found the continue command in a For isn't do what I want (and in version 7 do). In version 8 we can jump from nested for with GOTO by using a new algorithm so now I fix it to do what supposed to do with Continue.
for i = 1 to 1000 {
if i> 10 then exit
print i 'print until 10
}
print i ' 11
for i = 1 to 1000 {
if i> 10 then continue
print i ' print until 10
}
print i ' 1001
In version 8 we have "old" FOR NEXT too. Continue can't used there (no block used). So You can do that
for i=1 to 1000
if i>10 then next i : goto 1000
print i
next i
1000 print i
-
Aug 14th, 2015, 05:48 PM
#12
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Current Revision 29
Some minor fixes to comply with help file (for On Gosub and On Goto)
Also revision for Language Definition 1.10
(I put all Flow controls in appendix A, help2000.mdb updated also)
Code:
form 80
cls #ffaa22
pen 1
refresh 40
Profiler
for i =1 to 1000 {
move 6000,6000
draw to random(12000), random(10000)
refresh
}
X=Timecount
cls
Profiler
for i =1 to 1000 {
move 6000,6000
draw to random(12000), random(10000)
wait
}
X1=Timecount
cls
refresh 10000
Profiler
for i =1 to 1000 {
move 6000,6000
draw to random(12000), random(10000)
}
refresh
X2=Timecount
a$= format$("Time with refresh {0:2}, time with wait {1:2}, time with no refresh {2:2}",X,X1, X2)
clipboard a$
pen 15 {print a$}
refresh 40
Output:
Time with refresh 3866.38, time with wait 15620.62, time with no refresh 669.17
We see thet using Wait (call Doevents internal) in every draw we get a big delay
-
Aug 17th, 2015, 06:45 AM
#13
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
revision 30
New function Filelen() return file length in bytes
Code:
form 80,32
dim a$(4) : a$(0)="UTF-16LE","UTF-16BE","UTF-8","ANSI"
Print over $(6),"Example of saving and append text in four types"
for i=0 to 3
clear testthis$
document testthis$ = {1st line
2nd line
3rd line
}
testthis$={4th line
}
print under "Save one time and append one time more:" : print
\\ 10 chars left indent - we have to reset it after
print @(10), : report testthis$ : print @(0), \\ return cusror to far left
save.doc testthis$, "alfa1.txt", i \\ we use user dir
append.doc testthis$, "alfa1.txt", i
print part format$({Length for file "{0}" in bytes {1} type {2}, total characters {3}}, "alfa1.txt", filelen("alfa1.txt"), a$(i), doc.len(testthis$)*2)
\\ edit "alfa1.txt"
next i
print under
-
Aug 17th, 2015, 09:40 AM
#14
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Revision 31,
revision 30 has a fault in EDIT command, when open a new module editor has previous text. Now is ok.
Also added a new Paragraph() function to give a real paragraph number from index number.
Code:
document alfa$={
Ενα ΕΝΑ one Óne óne
}
insert 1 alfa$={some paragraphs insert at start
abcdefg
}
report alfa$
find alfa$, "óne"
read find_pos
if find_pos>0 then {
read par_order, par_pos
print paragraph$(alfa$, par_order, par_pos)
a= paragraph(alfa$, par_order)
print a \\ 3 is the real paragraph index of par_order.
print paragraph.index(alfa$, a), par_order, DOC.PAR(alfa$) \\ doc.par() return number of paragraphs.
print paragraph(alfa$, 1000) \\ not exist -1
}
-
Aug 17th, 2015, 03:51 PM
#15
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Current revision 33.
Eliminate the bug in Edit command.
-
Aug 18th, 2015, 04:36 PM
#16
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Current Revision 34
I found Private Declare Sub DisableProcessWindowsGhosting Lib "user32" ()
to handle the Ghosting. I am not sure if this is always good, if anyone has an idea about it please write here.
Also minor fixes
This is from HELP ALL command.I rearrange commands and groups. Some commands have no help text, and there are commands that are no show here.
Code:
[GENERAL]
INTERPRETER
ABOUT, CLEAR, CLIPBOARD, DOS, EDIT, END, ERROR, ESCAPE, FAST, FKEY, HELP, KEYBOARD, LIST, LOAD, NEW, PIPE, RECURSION.LIMIT, REMOVE, SAVE, SLOW, START, TEST, USE, VERSION, WIN, WRITER
MODULE'S COMMANDS
\#, FUNCTION, INLINE, MODULE, MODULES, SUB, THREAD, THREADS
FLOW CONTROL
AFTER, BREAK, CALL, CASE, CONTINUE, DO, ELSE, ELSE.IF, EVERY, EXIT, FOR, GOSUB, GOTO, IF, LOOP, MAIN.TASK, ON, PROFILER, REPEAT, RESTART, SELECT, THEN, THREAD.PLAN, TRY, UNTIL, WAIT, WHILE
STACK
DATA, DROP, FLUSH, OVER, PUSH, READ, SHIFT, SHIFTBACK, STACK
DEFINITIONS
CLASS, DECLARE, DEF, DIM, DOCUMENT, GLOBAL, GROUP, LET, LONG, SET, STOCK, SWAP
DOCUMENTS
APPEND.DOC, EDIT.DOC, FIND, INSERT, LOAD.DOC, MERGE.DOC, OVERWRITE, SAVE.DOC, SORT, WORDS
FILE OPERATIONS
BITMAPS, CLOSE, DRAWINGS, FILES, GET, LINE INPUT, MOVIES, NAME, OPEN, PUT, SEEK, SOUNDS, WRITE
SCREEN FORM
BACK, BACKGROUND, BOLD, CHARSET, CLS, CURSOR, DESKTOP, DOUBLE, FIELD, FONT, FORM, FRAME, GRADIENT, GREEK, HIDE, HOLD, ICON, ITALIC, LATIN, LAYER, LEGEND, LOCALE, MARK, MODE, MOTION, MOTION.W, NORMAL, PEN, REFRESH, RELEASE, REPORT, SCROLL, SHOW, WINDOW
SCREEN & FILES
INPUT, PRINT
OPERATORS IN PRINT
$(, @(
TARGET & MENU
CHANGE, MENU, SCAN, TARGET, TARGETS
DRAWING 2D
CIRCLE, COLOR, CURVE, DRAW, FILL, FLOODFILL, MOVE, POLYGON, STEP, WIDTH
BITMAPS
COPY, IMAGE, PLAYER, SPRITE
DATABASES
APPEND, BASE, COMPRESS, DB.PROVIDER, DB.USER, DELETE, EXECUTE, ORDER, RETRIEVE, RETURN, SEARCH, STRUCTURE, TABLE, VIEW
SOUNDS AND MOVIES
BEEP, CHOOSE.ORGAN, MOVIE, MEDIA, MUSIC, PLAY, SCORE, SOUND, SPEECH, TONE, TUNE, VOLUME
MOUSE
JOYPAD, MOUSE.ICON
BROWSER
BROWSER, TEXT, HTML
COMMON DIALOGS
CHOOSE.COLOR, CHOOSE.FONT, DIR, OPEN.FILE, OPEN.IMAGE, SAVE.AS, SETTINGS, TITLE
ARITHMETIC FUNCTIONS
ABS(, ARRAY(, ASC(, ASK(, CDATE(, CHRCODE(, COLLIDE(, COLOR(, COMPARE(, COS(, CTIME(, DATE(, DIMENSION(, DOC.LEN(, EOF(, EVAL(, EXIST(, EXIST.DIR(, FUNCTION(, IMAGE.X(, IMAGE.X.PIXELS(, IMAGE.Y(, IMAGE.Y.PIXELS(, INSTR(, INT(, JOYPAD(, JOYPAD.ANALOG.X(, JOYPAD.ANALOG.Y(, JOYPAD.DIRECTION(, LEN(, LN(, LOG(, MDB(, MIN(, NOT, NOT_2, POINT(, RANDOM(, RECORDS(, SIN(, SIZE.X(, SIZE.Y(, SQRT(, STACKITEM(, TAN(, TIME(, VAL(, VALID(, WRITABLE(
STRING FUNCTIONS
ARRAY$(, ASK$(, BMP$(, CHR$(, CHRCODE$(, DATE$(, DRIVE$(, DRW$(, ENVELOPE$(, FIELD$(, FILE$(, FILE.APP$(, FILE.NAME$(, FILE.PATH$(, FILE.TITLE$(, FILE.TYPE$(, FILTER$(, FORMAT$(, FUNCTION$(, HEX$(, HIDE$(, INPUT$(, JPG$(, LCASE$(, LEFT$(, MAX.DATA$(, MEMBER$(, MEMBER.TYPE$(, MENU$(, MID$(, MIN.DATA$(, PATH$(, PIPENAME$(, QUOTE$(, REPLACE$(, RIGHT$(, SHORTDIR$(, SHOW$(, SND$(, SPEECH$(, STACKITEM$(, STR$(, STRING$(, TIME$(, TRIM$(, UCASE$(
VARS READ ONLY
ABOUT$, APPDIR$, BROWSER$, CLIPBOARD$, CLIPBOARD.IMAGE$, COLORS, COMMAND$, COMPUTER$, CONTROL$, DIR$, DURATION, EMPTY, ERROR$, FIELD_as variable, FONTNAME$, GRABFRAME$, HEIGHT, INKEY$, ISLET, ISNUM, KEY$, LAN$, LETTER$, MEMORY, MENU.VISIBLE, MENU_as variable, MENUITEMS, MODE_variable, MODULE$, MOTION.WY, MOTION.X, MOTION.XW, MOTION.Y, MOTION.YW, MOUSE, MOUSE.X, MOUSE.Y, MOUSEA.X, MOUSEA.Y, MOVIE.COUNTER, MOVIE.DEVICE$, MOVIE.ERROR$, MOVIE.STATUS$, MOVIE_as variable, MUSIC.COUNTER, NOW, NUMBER, OS$, PARAMETERS$, PEN_variable, PLATFORM$, POINT, POS, POS.X, POS.Y, PRINTERNAME$, PROPERTIES$, REPORTLINES, ROW, SCALE.X, SCALE.Y, SPRITE$, STACK.SIZE, TAB, TEMPNAME$, TEMPORARY$, THREADS$, TICK, TIMECOUNT, TODAY, TWIPSX, TWIPSY, USER.NAME$, VOLUME_as variable, WIDTH_as variable, X.TWIPS, Y.TWIPS
CONSTANTS
ASCENDING, BINARY, BOOLEAN, BYTE, CURRENCY, DATEFIELD, DESCENDING, DOUBLE_as constant, FALSE, FORMATING _ANY TYPE, FORMATING_DATE AND TIME, FORMATING_NUMBERS, FORMATING_STRINGS, INTEGER, LONG_TYPE, MEMO, PI, SINGLE, TEXT_as constant, TRUE, VERSION_as constant
PRINTINGS
PAGE, PRINTER, PRINTING, PROPERTIES
-
Aug 21st, 2015, 06:43 PM
#17
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Revision 39
I put away gdiplus (I use this only for saving jpg). Now I have a jpg encoder in Vb6...I found it and works perfect. For quality >50 I use SetSamplingFrequencies 1, 1, 1, 1, 1, 1 like camera and for <=50 SetSamplingFrequencies 2, 2, 1, 1, 1, 1 , we get more soft image and lower size.
From my experiments, using m2000 to fire 10 m2000.exe with jpg saving using gdiplus I found that some times some programms hangs after export image at the terminate event. I do a search and this happen mostly in windows 7 and 8, but not in Xp. So I remove gdiplus and place encoder by John Korejwa and do my tests and always get results and programs termination ok. Maybe some other Revision of gdiplus can do nice job but this is to much for me to wait when something can be fix. And finally I don't want "fast" encoder but something to work and produce nice jpg.
This is one of my tests...
File Test.gsb
Code:
MODULE A {SHOW
REFRESH
set fast !
refresh 5000
profiler
for i=1 to 100000 {
}
print timecount
set fast
refresh 10
A$=KEY$
}
A : END
file scr.gsb
Code:
MODULE A {
SHOW
MODULE KKK \\fake name so a in test can be run
KEYBOARD " "
TRY {
LOAD TEST
}
cls
move 0,0
clear a$, b$
if match("S") then { read b$ } else b$="alfaalfa.jpg"
print "copy to dib"
copy scale.x, scale.y to a$
print "enter wait"
print "export image"
REFRESH
if command$<>"" then { COPY leftpart$(file.name$(command$),".")+"_"+b$} else copy "all"
image a$ export b$, 90
wait 10
TRY {
print part format$({File "{0}" size {1:2} kbytes},b$,filelen(b$)/1024)
}
print under "ok"
}
A: END
File Load10
Code:
MODULE A {for i=1 to 10 {
use scr format$("alfa{0}.jpg", i)
}
}
These files must be in user dir, with command Win Dir$ we open explorer showing user dir
we place these three text files (utf-8 using by default but can be any notepad type) with gsb file extension.
We load Load10 and write a and press Enter
Ten times module a execute M2000.exe opening scr.gsb and place to stack a file to save
In scr.gsb first a load external code, test.gsb/ and press by code space to finish it (bypassing the keyboard routines). In test.gsb I set mode to "Fast !" means no escape key is monitoring..code run full ahead, and make a loop for 100000 times. Setting refresh to 5000 means that we make "auto refresh" to happen at 5 seconds after except we make own refresh or reseting the counter again. But loop is run fast and continue to second stage the saving of entire screen (inside m2000 environment) using Copy command and then we use Image ...export command to export to jpg.
So 10 programs start a loop, and in windows 8 we see that "non response" displayed in task manager. Because I found the right command to stop ghosting, the loops finally ends and all ten programs export two files (one bitmap and one jpg) and all finsished. Using GdiPlus always I get one or two hanging exe at the terminate stage (all files export ok). Some time I get a hang at the export, so I found files as jpg but with no data.
A module kkk command change namespace and this neeaded because we load code with same name in a module "a". In a module a we can execute a if we "Call" it using call. Changing name as it run in a module, only change name on the process object not the code. When we load Test we make a KKK.A module from KKK process so we can execute a. In subs list there is A and KKK.A and when process KKK ends the KKK.A cleared.from list. We don't want easy recursion in modules, M2000 is for pupils mainly (we can do that using Call A in a A module, using internally the function's mechanism for recursion)
M2000 is open source...you can read the code...look in the sign below
-
Aug 23rd, 2015, 04:37 PM
#18
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Revision 40
A solution for IDE error in vb6 in Windows 8 64bit on the M2000 code, so now can open in IDE and run without problem. (As I know).
Also i remove Flavor Pentium Pro from compilation stage.
-
Sep 3rd, 2015, 06:38 PM
#19
Thread Starter
Frenzied Member
Re: Μ2000 version 8 coming soon
Revision 41
Now M2000 msgbox and other forms are totaly dpi independent .Before was only the user control dpi independent. So now ico in msgbox are rendered ok, height are ok, and form zooming ok too - dialog forms in m2000 are zoomabled, means that a resize didn't add space but perform zoom, we can add space only in x direction in specific forms)
Also I have an expanded Language definition...(but not finished yet).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|