oxygen basic compiler - documentation.help · oxygen basic (o2h) is a just-in-time compiler...
TRANSCRIPT
![Page 1: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/1.jpg)
OxygenBasicCompiler
Copyright©CharlesEVPegge,2010-2018
![Page 2: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/2.jpg)
IntroductionOxygenBasic(o2H)isaJust-In-Timecompilerassembler,deployedinasingleDLLthattakessourcecodestringsandreturnsexecutablebinary.ItisanextensionoftheO2assembler.Thisimplementationcanbeembeddedinanyapplicationtoprovidehighperformanceprogrammability.Thecompilercanalsogenerateconventionalexecutablesanddynamiclinklibraries(DLL).
OxygensupportsObjectOrientedProgrammingwithmultipleinheritanceandalsosingleinheritancemodes,moresuitedtoCOM.InadditiontothisO2HsupportsUser-definedoperatorsandoperatorsetsforusewithcomplexnumbers,matrices,vectors,setsandotherspecialisedforms.Itcanalsocompile&executestringsofsourcecodeatruntimewithitsbuiltincompile()function,openingnewpossibilitiesforfunctionalprogramming.
Thebuiltinfunctionsetissmall.butcontainsthenecessarytoolstobuildclass/functionlibrariestoanyscale.
InadditiontounderstandingBasicintheQBasicgenre,OxygencanreadsufficientCsyntaxtodealwithmostCheadersdirectly,eliminatingtheneedtotranslatethemintoBasic.
Copyright©CharlesPegge,2010
![Page 3: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/3.jpg)
typesvoid,sbyte,ubyte,byte,string,string2,wstring,bstring,gstr_,bstr,bstring2,char,wchar,cstr_,asciiz,zstring,zstring2,asciiz2,short,wide,long,int,integer,float,single,double,extended,quad,word,dword,ulong,uint,qword,any,sys,boolean,bool,
USE: tospecifythetypesofvariablesandcreatethemEXAMPLE:
intx
dimasintx
dimxasint
varintx
![Page 4: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/4.jpg)
dimsyntaxdim,
REMARKS: Cstyleinstantiationsisasimpleralternativetousing'Dim'.
RELATED: globallocalstatic
'--------------
'DIMVARIATIONS
'==============
'----------------
'POSTDEFINETYPE
'================
dimi,j,kaslong
'---------------
'PREDEFINETYPE
'===============
dimaslongi,j,k
'-----------
'MIXEDTYPES
'===========
dimaslongi,j,k,asstrings,t
'----------
'MULTILINE
'==========
dimaslongi,j,k,
asstrings,t
dimaslong,
i,
j,
k
'--------------
![Page 5: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/5.jpg)
'INITIALVALUES
'==============
dimaslong,
i=1,
j=2,
k=42
'-------------------------
'SPREADLINESANDCOMMENTS
'=========================
dimaslong,
i=1,'thesecanbespreadovermanylines
'--------
j=2,'withinterveningcomments
'--------
k=42'
'--------------------
'MULTIPLEASSIGNMENTS
'====================
dimaslonga(10)=>(2,4,6,8,10,12,42,99)
print"Answer:"stra(7)
'-----------------
'SYNTAXVARIATIONS
'=================
dimlonga(10)=>(2,4,6,8,10,12,42,99)
dimlonga[10]=>(2,4,6,8,10,12,42,99)
longa[10]=>(2,4,6,8,10,12,42,99)
longa[10]<=(2,4,6,8,10,12,42,99)
longa[10]={2,4,6,8,10,12,42,99}
longa[]={2,4,6,8,10,12,42,99}
longa={2,4,6,8,10,12,42,99}
longa=
{
2,4,6,8,10,12,42,99
}
![Page 6: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/6.jpg)
'------------------
'POINTEREDVARIABLE
'==================
dimstrings="ABCDEFGHIJ"
dimbytebatstrptrs
dimbytebyrefb:@b=strptrs
bytebatstrptrs
byte*b=strptrs
'printb[7]'71G
'--------------------
'USINGDYNAMICMEMORY
'====================
dimfloatfatgetmemory1024*4:f={1.5,2.5,3.5}
'printf[2]
freememory@f'releaseallocatedmemory
'---------------------------
'DIMS:GLOBAL,STATIC,LOCAL
'===========================
globalintg=1'visibletorestofprogramfollowingthisstatement
functionf(pasint)asint
staticints=0'permanentstorage
localintl=100'temporarystorage
s+=10
returnp+l+s+g
endfunction
printf(1000)'1111
printf(1000)'1121
'--------------
'LIMITINGSCOPE
'==============
dimlonga=16
![Page 7: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/7.jpg)
scope
dimlonga=1
'printa'1
...
endscope
'printa'16
![Page 8: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/8.jpg)
inhstructurestype,
USE: specifycompundstructureforavariableRELATED: structtypedef
'--------------
'COMPOUNDTYPES
'==============
typecolor32
rasbyte
gasbyte
basbyte
aasbyte
=
rgbaaslong'UNION
endtype
'-------------
'DERIVEDTYPE:
'=============
typecolortext
txtasstring
cascolor32
endtype
dimtascolortext
t.txt=`Colorcode`
t.c.r=8
t.c.b=16
t.c.g=32
t.c.a=64
printt.txthext.c.rgba
![Page 9: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/9.jpg)
'print"STRUCTURE:
'"structureofcolor32
'-----------------
'SYNTAXVARIATIONS
'=================
typecolor32
byter
byteg
byteb
bytea
=
longrgba'UNION
endtype
typecolor32
byter,g,b,a
=
longrgba'UNION
endtype
typecolor32byter,g,b,a=longrgba
typecolortextstringtxt,color32c
structcolor32{
byter,g,b,a
=
longrgba
}
typedefstruct_color32{
byter,g,b,a
=
longrgba
}color32,*pcolor32
typedefstruct_color32{
union{
struct{
byter,g,b,a
}
longrgba
![Page 10: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/10.jpg)
}
}color32,*pcolor32
'#recordofcolor32
'#recordof_color32
'#recordofcolortext
![Page 11: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/11.jpg)
includesonce,
ACTION: ensuresthatafileisincludedinthesourcecodeoneonly.EXAMPLE:
#includeonce"../../MinWin.inc"
RELATED: include#includeincludepath
![Page 12: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/12.jpg)
equates$,%,
REMARKS: $and%areequivalent
RELATED: def#defmacro#define
'$filename"t.exe"
'usesrtl64
'---------------
'EQUATES:$or%
'===============
'strictlyspeakingthesearesingle-linemacros
%a=1
%b=2
%c3
%c3
%c=3
$d4
$d"four"
%d"four"
%=eb*c'precalcuateevalue'6
'#recordofe
%f8
%%f7'defaultvalue7(unlesspreviouslydefined)
%sp""
%cm","
'$%prefixesandsuffixesareignored
print""acmbcmccmdcmecmf'1,2,3,four,6,8
'print%acm%bcm%ccm%dcm%ecmf
'INCLUDINGARGUMENTS
![Page 13: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/13.jpg)
'argumentsarerepresentedby%1..%9
%display"valueof%1:"%1
printdisplayd
![Page 14: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/14.jpg)
arraysarrays,
REMARKS: Onlysingledimensionedarraysaredirectlysupported
RELATED: dim
'%filename"t.exe"
'usesrtl64
'-------------
'STATICARRAYS
'=============
dimaslonga(10)={2,4,6,8,10,12}
a(10)=a(1)+a(4)
printa(10)
'--------------
'DYNAMICARRAYS
'==============
dimaslongaatgetmemory(10*sizeof(long)):a={2,4,6,8,10,12}
...
freememory@a
dimaslonga(10)={2,4,6,8,10,12}
'--------
'OVERLAYS
'========
dimasstrings="ABCDEFGHIJ"
dimasbytebatstrptr(s)
printstr(b[3])":"chr(b[3])
'-----------------------
'MULTIDIMENSIONALARRAYS
'=======================
macroa(x,y)av(y*1024+x)
dimintav[1024*1024]
![Page 15: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/15.jpg)
a(100,200)=42
printa(100,200);42
'----------
'INDEXBASE
'==========
'
diminta[100]={10,20,30,40}
indexbase1'default:firstelementisindexedas1
'printa[2]'20
indexbase0
printa[2]'30
'-------------
'PSEUDOARRAYS
'=============
dimav[100]
functiona(inti,v)'setter
i*=2
av[i]=v
endfunction
functiona(inti)asint'getter
i*=2
returnav[i]
endfunction
a(7)=42'thisisinterpretedasa(7,42)
'printa(7)
![Page 16: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/16.jpg)
blocksblock,scope,skip,o2,(,
RELATED: proceduresmacros
'------
'MACROS
'======
macrocube(v)
v*v*v
endmacro
#definecube(v)v*v*v
defcube%1*%1*%1
%cube%1*%1*%1
$cube%1*%1*%1
'printcube3
'MACROMEMBERS
'=============
macromultiple(v)
macro.two(v)
v*v
endmacro
macro.three(v)
v*v*v
endmacro
macro.four(v)
v*v*v*v
endmacro
endmacro
printmultiple.four3
![Page 17: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/17.jpg)
![Page 18: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/18.jpg)
macrosmacro,#define,def,deff,%,$,
RELATED:macrofunctionsmacrooperatorsprocedures
![Page 19: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/19.jpg)
proceduresfunction,sub,method,gosub,
RELATED:macro
'----------
'PROCEDURES
'==========
'SUBROUTINES
floatv
gotoncube
cube:'subroutine
'printv*v*v
ret
ncube:
v=3:gosubcube
'SUBSANDFUNCTIONS
'==================
subcube(fasfloat,gasfloat)
g=f*f*f
endsub
dimfloata
cube2,a
'printa
functioncube(fasfloat)asfloat
function=f*f*f
endfunction
functioncube(fasfloat)asfloat
returnf*f*f
endfunction
'printcube2
'METHODS(INCLASSES)
'====================
classmultipliers
![Page 20: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/20.jpg)
methodcube(fasfloat)asfloat
returnf*f*f
endmethod
endclass
dimmultipliersm
'printm.cube4
'ALTERNATIVESYNTAX
'==================
'USEOF{..}
'===========
functioncube(fasfloat)asfloat{returnf*f*f}
functioncube(fasfloat)asfloat{
returnf*f*f
}
floatcube(fasfloat){
returnf*f*f
}
floatcube(floatf){
returnf*f*f
}
'printcube2
'PASSINGPARAMETERSBYREFERENCE
'===============================
dimasfloatf()={1,2,3,4,5}
functioncubes(fasfloat,byvalnasint)'defaultbyref
indexbase1
inti
fori=1ton
v=f[i]
printv*v*v
next
endfunction
functioncubes(float*f,intn)
![Page 21: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/21.jpg)
indexbase1
floatv
inti
fori=1ton
v=f[i]
printv*v*v
next
endfunction
'cubesf(2),3
'cubesf,countof(f)
'OPTIONALPARAMETERS
'===================
functioncubes(fasfloat,optionalbyvalnasint)
ifn=0thenn=1
indexbase1
floatv
inti
fori=1ton
v=f[i]
printv*v*v
next
endfunction
'cubesf(3)
'cubesf(3),1
'cubesfloat{1,2,3,4},countof'PASSINGLITERALDATASET
'DEFAULTPARAMETERS
'==================
functioncubes(float*f,intn=2)
indexbase1
floatv
inti
fori=1ton
v=f[i]
printv*v*v
next
endfunction
'cubesf(3)
'cubesf(3),2
![Page 22: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/22.jpg)
'ELLIPSIS...
'============
functioncuber(intn,...)
indexbase0
floatv
inti
fori=1ton
v=(int)param[i]
printv*v*v
next
endfunction
'cuber3,2,3,4
![Page 23: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/23.jpg)
conditionalsif,then,elseif,else,endif,
RELATED: selectionloops
'------------
'CONDITIONALS
'============
strings
inta=1,b=2
'SINGLELINEFORMAT
ifa>bthens="A>B"elses="A<=B"
'prints
'MULTI-LINEFORMAT
ifa>bthen
s="A>B"
elseifa=bthen
s="A=B"
else
s="A<B"
endif
'-----------------
'SYNTAXVARIATIONS
'=================
if(a>b){s="A>B"}elseif(a=b){s="A=B"}else{s="A<B"}
ifa>b{s="A>B"}elseifa=b{s="A=B"}else{s="A<B"}
ifa>b{
s="A>B"
}elseifa=b{
s="A=B"
}else{
s="A<B"
}
![Page 24: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/24.jpg)
print"A=1B=2
"s
![Page 25: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/25.jpg)
loopsdo,while,exit,continue,wend,enddo,
RELATED: iterationconditionals
'-----
'LOOPS
'=====
dima,b,c,daslong,sasstring
'SIMPLELOOPS
'------------
a=4
'
b=0
do
b+=1
ifb>athenexitdo
enddo'orenddo
b=0
do
b+=1
ifb>athenexitdo
loop
'-----------------
'CONDITIONALFORMS
'=================
b=0
whileb<=a
b+=1
endwhile'orendwhile
b=0
whileb<=a
b+=1
wend
b=0
whileb<=a{b+=1}
![Page 26: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/26.jpg)
b=0
do{b+=1}whileb<a
b=0
do{b+=1}untilb>=a
b=0
do
b+=1
loopwhileb<a
b=0
do
b+=1
loopuntilb>=a
b=0
do
b+=1
ifb<athencontinuedo
ifb<athenrepeatdo
ifb>=athenexitdo
ifb>=athenbreak
loop
b=0
do
b+=1
continuewhileb<a'if/when/while
continueuntilb>=a
repeatuntilb>=a
redountilb>=a
redountilnotb<a
exitwhenb>=a'if/when
exitwhennotb<a
breakwhenb>=a'if/when
enddo
print"ok"
![Page 27: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/27.jpg)
iterationfor,to,step,next,
RELATED: loops
'---------
'ITERATION
'=========
dima,b,c,d,iaslong
dimsasstring="QWERTY"
'checksumexample
b=0
fori=1tolen(s)
b+=asc(s,i)
next
b=0
fori=1tolen(s)step1
b+=asc(s,i)
next
b=0
fori=len(s)to1step-1
b+=asc(s,i)
next
'-----------------
'SYNTAXVARIATIONS
'=================
b=0
fori=1tolen(s)step1{
a=asc(s,i)
b+=a
}
b=0
fori=1,len(s),1{
a=asc(s,i)
b+=a
![Page 28: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/28.jpg)
}
b=0
for(i=1,i<=len(s),i++){
a=asc(s,i)
b+=a
}
#semicolonseparator
b=0
for(i=1;i<=len(s);i++){
a=asc(s,i)
b+=a
}
#semicoloncomment
b=0
for(i=1,i<=len(s),i++){
a=asc(s,i)
b+=a
}
defqu"'"
print"Checksumfor"qusqu"="b
![Page 29: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/29.jpg)
selectionselect,case,case,endselect,
RELATED: conditionals
'------
'SELECT
'======
dimaaslong,sasstring
a=3
'COMPACTFORM
'------------
selecta'selectcasea
case1:s="A=1"
case2:s="A=2"
case3:s="A=3"
caseelse:s="A>3"
endselect'endsel
'GENERALFORM
'------------
selecta
case1
s="A=1"
case2
s="A=2"
case3
s="A=3"
caseelse
s="A>3"
endselect
'------------------
'SYNTAXVARIATIONS
![Page 30: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/30.jpg)
'=================
selecta{
case1
s="A=1"
case2
s="A=2"
case3
s="A=3"
caseelse
s="A>3"
}
switcha{
case1
s="A=1"
break
case2
s="A=2"
break
case3
s="A=3"
break
caseelse
s="A>3"
break
}
'----------
'EXTENSIONS
'==========
selecta
case1
s="A=1"
case2
s="A=2"
case3
s="A=3"
case4,5,6
'
![Page 31: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/31.jpg)
case7to9
'
case10to<20
'
caseelse
s="A>3"
endselect
prints
![Page 32: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/32.jpg)
structurestype,
RELATED: classesclass
'--------------
'COMPOUNDTYPES
'==============
typecolor32
rasbyte
gasbyte
basbyte
aasbyte
=
rgbaaslong'UNION
endtype
'-------------
'DERIVEDTYPE:
'=============
typecolortext
txtasstring
cascolor32
endtype
dimtascolortext
t.txt=`Colorcode`
t.c.r=8
t.c.b=16
t.c.g=32
t.c.a=64
printt.txthext.c.rgba
'print"STRUCTURE:
'"structureofcolor32
![Page 33: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/33.jpg)
'-----------------
'SYNTAXVARIATIONS
'=================
typecolor32
byter
byteg
byteb
bytea
=
longrgba'UNION
endtype
typecolor32
byter,g,b,a
=
longrgba'UNION
endtype
typecolor32byter,g,b,a=longrgba
typecolortextstringtxt,color32c
structcolor32{
byter,g,b,a
=
longrgba
}
typedefstruct_color32{
byter,g,b,a
=
longrgba
}color32,*pcolor32
typedefstruct_color32{
union{
struct{
byter,g,b,a
}
longrgba
}
}color32,*pcolor32
![Page 34: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/34.jpg)
'#recordofcolor32
'#recordof_color32
'#recordofcolortext
![Page 35: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/35.jpg)
classesclass,objects,oop,has,of,from,inherits,virtual,pure,com,new,del,
RELATED: structurestype
'-------
'CLASSES
'=======
'METHODS(INCLASSES)
'====================
classmultipliers
methodcube(fasfloat)asfloat
returnf*f*f
endmethod
endclass
dimmultipliersm
'printm.cube4
'ALTERNATIVESYNTAX
'==================
classmultipliers{
methodcube(fasfloat)asfloat{
returnf*f*f
}
}
dimmultipliersm
printm.cube4
![Page 36: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/36.jpg)
operatorsand,or,xor,=,:=,+,-,*,/,\,^,+=,-=,*=,/=,==,!=,<>,<,>,<=,>,>=,<=,and=,or=,xor=",&,|,&=,|=,&&,||,^^,&&=,||=,^^=,<<,>>,<<,>>>,
ACTION: changesthestateofanaccumulatorUSE: formulatingexpressions,inconjunctionwithoperandsEXAMPLE:
a*b+c/4
REMARKS: universalfeatureofmathsandprogramminglanguages
RELATED: types
![Page 37: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/37.jpg)
callingstdcall,cdecl,ms64,pascal,
ACTION: determineshowparametersarepassedonthestack,whenmakingacall
![Page 38: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/38.jpg)
voidUSE: specifyanulltypeEXAMPLE:
'Variables:
void*pv=getmemory(100*sizeoffloat)
...
freememorypv
'
'Infunctionheaders:
functionfoo(byrefvasvoid)asvoidptr
void*foo(void*v)
'Proceduresnotreturningavalue:
voidfoo()
'
REMARKS: Voidcannotbeuseddirectly.
RELATED: sysanytypes
![Page 39: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/39.jpg)
sbyteUSE: specifyasignedbytetype(8bitswide)EXAMPLE:
sbytex=-10
REMARKS: limitedtovaluesrangingfrom-128to127/0x80to0x7F
RELATED: types
![Page 40: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/40.jpg)
ubyteUSE: specifyabytetype(8bitswide)EXAMPLE:
ubytesemicolon=59
REMARKS: limitedtovalues0..255/0x00to0xFF
RELATED: types
![Page 41: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/41.jpg)
byteUSE: specifyabytetype(8bitswide)EXAMPLE:
bytecolon=58
REMARKS: limitedtovalues0..255/0x00to0xFF
RELATED: types
![Page 42: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/42.jpg)
stringACTION: returnsastringofcharactersUSE: string=string(length,character)EXAMPLE:
string=string(4,"a")
RESULT:s="aaaa"
RELATED: spacenulsasc
![Page 43: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/43.jpg)
string2USE: specifyastringtypewith16-bitcharacters,supportingunicodeEXAMPLE:
wstringsw
getfile"greek.txt",sw
REMARKS: stringsareautomaticallydestroyedwhenoutofscope.
RELATED: unictypes
![Page 44: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/44.jpg)
wstringUSE: specifyastringtypewith16-bitcharacters,supportingunicodeEXAMPLE:
wstringsw
getfile"greek.txt",sw
REMARKS: stringsareautomaticallydestroyedwhenoutofscope.
RELATED: unictypes
![Page 45: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/45.jpg)
bstringUSE: specifyabstringtypewith8-bitcharactersEXAMPLE:
bstrings="name:"
...
freess
REMARKS: bstringsmustbefreedbeforegoingoutofscope.
RELATED: bstring2types
![Page 46: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/46.jpg)
gstr_
![Page 47: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/47.jpg)
bstrUSE: specifyabstringtypewith8-bitcharactersEXAMPLE:
bstrs="name:"
...
freess
REMARKS: bstringsmustbefreedbeforegoingoutofscope.
RELATED: bstring2types
![Page 48: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/48.jpg)
bstring2USE: specifyabstringtypewith16-bitcharacters,supportingunicodeEXAMPLE:
bstring2sw
getfile"greek.txt",sw
...
freessw
REMARKS: bstringsmustbefreedbeforegoingoutofscope.
RELATED: bstringtypes
![Page 49: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/49.jpg)
charUSE: specifyastringofasciicharacters(8bitswide)EXAMPLE:
charw="world"
charbuf[1024]
buf=w
print"hello"+buf
REMARKS: similartoCchar,butisnotconflatedwithbytewhichisanumerictype
RELATED: wchartypes
![Page 50: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/50.jpg)
wcharUSE: specifyastringofwidecharacters(16bitswide)EXAMPLE:
wcharw="world"
wcharbuf[1024]
buf=w
printbuf
RELATED: chartypes
![Page 51: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/51.jpg)
cstr_
![Page 52: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/52.jpg)
asciizUSE: specifyastringofasciicharacters(8bitswide)EXAMPLE:
asciizw="world"
asciizbuf[1024]
buf=w
print"hello"+buf
REMARKS: similartoCchar,butisnotconflatedwithbytewhichisanumerictype
RELATED: wchartypes
![Page 53: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/53.jpg)
zstringUSE: specifyastringofasciicharacters(8bitswide)EXAMPLE:
zstringw="world"
zstringbuf[1024]
buf=w
print"hello"+buf
REMARKS: similartoCchar,butisnotconflatedwithbytewhichisanumerictype
RELATED: wchartypes
![Page 54: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/54.jpg)
zstring2USE: specifyastringofwidecharacters(16bitswide)EXAMPLE:
zstring2w="world"
zstring2buf[1024]
buf=w
printbuf
RELATED: chartypes
![Page 55: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/55.jpg)
asciiz2USE: specifyastringofwidecharacters(16bitswide)EXAMPLE:
asciiz2w="world"
asciiz2buf[1024]
buf=w
printbuf
RELATED: chartypes
![Page 56: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/56.jpg)
shortUSE: specifyashortinteger(16bitswide).Alsousedinconjunction
withothertypestohalvethebitwidthEXAMPLE:
shorta
shortintb
shortshortc'ansbyte
RELATED: longtypes
![Page 57: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/57.jpg)
wideUSE: specifyawidecharacterstring(16bitswide).Alsousedin
conjunctionwithothertypestodoublethebitwidthEXAMPLE:
wides
widecharsw
widefloatfw'adoubleprecisionfloat
RELATED: shorttypes
![Page 58: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/58.jpg)
longUSE: specifyalonginteger(32bitswide).Alsousedinconjunction
withothertypestodoublethebitwidthEXAMPLE:
longi
RELATED: shorttypes
![Page 59: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/59.jpg)
intUSE: specifyalongsignedinteger(32bitswide)EXAMPLE:
inti=0x7fffffff
RELATED: dwordtypes
![Page 60: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/60.jpg)
integerUSE: specifyalongsignedinteger(32bitswide)EXAMPLE:
integeri=0x7fffffff
RELATED: dwordtypes
![Page 61: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/61.jpg)
floatUSE: specifyafloatingpointvariable(32bitswide)EXAMPLE:
floatf=1/100
REMARKS: sameassingle
RELATED: singledoubleextendedtypes
![Page 62: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/62.jpg)
singleUSE: specifyafloatingpointvariable(32bitswide)EXAMPLE:
singlef=1/100
REMARKS: sameasfloat
RELATED: floatdoubleextendedtypes
![Page 63: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/63.jpg)
doubleUSE: specifyadoubleprecisionfloatingpointvariable(64bitswide)EXAMPLE:
doublef=1/3
RELATED: singlefloatextendedtypes
![Page 64: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/64.jpg)
extendedUSE: specifyanextendedprecisionfloatingpointvariable(80bitswide)EXAMPLE:
extendede=1/3
REMARKS: thistypeholdsthefullprecisionofthepentiumfloatinpointprocessor(FPU)
RELATED: singlefloatdoubletypes
![Page 65: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/65.jpg)
quadUSE: specifyadoubleprecisionsignedinteger(64bitswide)EXAMPLE:
quadq
REMARKS: Ina64bitsystem,theseareprocesseddirectlyontheCPU.Ina32bitsystem,quadsarepassedtotheFPUforprocessing
RELATED: qwordintshortsbytetypes
![Page 66: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/66.jpg)
wordUSE: specifyashortunsignedinteger(16bitswide)EXAMPLE:
wordw=0xA000
RELATED: shortintdwordtypes
![Page 67: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/67.jpg)
dwordUSE: specifyalongunsignedinteger(32bitswide)EXAMPLE:
dwordui=0xA0000000
RELATED: wordlongintquadtypes
![Page 68: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/68.jpg)
ulongUSE: specifyalongunsignedinteger(32bitswide)EXAMPLE:
ulongu=0xA0000000
REMARKS: sameasuint
RELATED: uintwordtypes
![Page 69: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/69.jpg)
uintUSE: specifyalongunsignedinteger(32bitswide)EXAMPLE:
uintu=0xA0000000
REMARKS: sameasdwordandulong
RELATED: dwordwordbytetypes
![Page 70: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/70.jpg)
qwordUSE: specifya64bitoperandinassemblycodeEXAMPLE:
fldqwordd
REMARKS: Onlyusedinassemblycode,notBasic.
RELATED: integerquadtypes
![Page 71: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/71.jpg)
anyUSE: specifyaparameterofuncertaintype,nominallyasignedinteger
ofsystemwidth(32/64bitswide)EXAMPLE:
functionf(any*a){...}
REMARKS: Parameterofanytypemaybepassedby-reference.LikeCvoid*.
RELATED: systypes
![Page 72: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/72.jpg)
sysUSE: specifyasignedintegerofsystemwidth(32/64bitswide)EXAMPLE:
sysi=42
REMARKS: thistypeisalwayswideenoughtoholdapointer.
RELATED: anyintquadtypes
![Page 73: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/73.jpg)
booleanUSE: specifyavariabletoholdBooleantrue/falsestatesEXAMPLE:
booleant=true
ifnottthen...
REMARKS: NotionallyaBooleantype,butinreality.itisansbyte(8bitsignedinteger
RELATED: boolbyteintanytypesbooleantypes
![Page 74: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/74.jpg)
boolUSE: specifyavariabletoholdBooleantrue/falsestatesEXAMPLE:
boolt=true
ifnottthen...
REMARKS: NotionallyaBooleantype,butinreality.itisa32bitsignedinteger,asinC
RELATED: anytypesbooleaninttypes
![Page 75: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/75.jpg)
dimACTION: defineasetofvariablesUSE: createvariablesandarraysofvariableswithoptionalinitialvaluesEXAMPLE:
dimasstrings="HelloWorld"
RELATED: redimletvar
![Page 76: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/76.jpg)
localACTION: definealocalsetofvariablesEXAMPLE:
localstrings
RELATED: dimstatic
![Page 77: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/77.jpg)
staticACTION: defineastaticsetofvariables,(persistantbutinvisibleoutsidthe
block)EXAMPLE:
staticstrings
RELATED: dimlocal
![Page 78: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/78.jpg)
typeACTION: defineacompoundvariabletypeEXAMPLE:
'typergbacolor
redasbyte
greenasbyte
blueasbyte
alphaasbyte
endtype
RELATED: typedefstructclass
![Page 79: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/79.jpg)
structACTION: defineacompoundvariabletype(CSyntax)EXAMPLE:
structrgbacolor
{
redasbyte
greenasbyte
blueasbyte
alphaasbyte
}
RELATED: typetypedefclass
![Page 80: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/80.jpg)
typedefACTION: defineasetoftypes(Csyntax)USE: createtypedefinitionsforcreatingothertypesEXAMPLE:
'typedefDouble*pDouble
RELATED: typestructclassunionenum
![Page 81: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/81.jpg)
includeACTION: includesourcecodefromanotherfileUSE: usedforincludingheaderfilesandotherunitsofsourcecodeEXAMPLE:
#include"rtl32.inc"
REMARKS: includeand#includearethesame
RELATED: includepathembedfile
![Page 82: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/82.jpg)
#includeACTION: includesourcecodefromanotherfileUSE: usedforincludingheaderfilesandotherunitsofsourcecodeEXAMPLE:
#include"rtl32.inc"
REMARKS: includeand#includearethesame
RELATED: includepathembedfile
![Page 83: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/83.jpg)
includepathACTION: defineafilepathforsourcefilesspecifiedbyinclude.RELATED: includelibrarypath
![Page 84: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/84.jpg)
$ACTION: defineanequate(whichcanbeusedasconstants)RELATED: equatesmacros#define.#def.def
![Page 85: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/85.jpg)
%ACTION: defineanequate(whichcanbeusedasconstants)RELATED: equatesmacros#define.#def.def
![Page 86: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/86.jpg)
defACTION: definealowlevelmacroEXAMPLE:
''DEFINEMACRO:
REMARKS: defand#defarethesame
RELATED: macro#definedeff
![Page 87: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/87.jpg)
#defACTION: definealowlevelmacroEXAMPLE:
''DEFINEMACRO:
REMARKS: defand#defarethesame
RELATED: macro#definedeff
![Page 88: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/88.jpg)
macroACTION: defineahighlevelmacroUSE: manyuses.Oftenapseudofunctionforproducinginlinecode
insteadofacall
'------
'MACROS
'======
macrocube(v)
v*v*v
endmacro
#definecube(v)v*v*v
defcube%1*%1*%1
%cube%1*%1*%1
$cube%1*%1*%1
'printcube3
'MACROMEMBERS
'=============
macromultiple(v)
macro.two(v)
v*v
endmacro
macro.three(v)
v*v*v
endmacro
macro.four(v)
v*v*v*v
endmacro
endmacro
printmultiple.four3
![Page 89: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/89.jpg)
RELATED:macros#define#defdefdeff
![Page 90: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/90.jpg)
#defineACTION: defineamacro(Csyntax)USE: CpreprocessorstatementsEXAMPLE:
#defineX32
RELATED: macrosmacrodef#ifdef#ifndef
![Page 91: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/91.jpg)
blockACTION: startablockRELATED: blocksscopeexitrepeatdowhileifselect
![Page 92: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/92.jpg)
scopeACTION: startascopeUSE: createablockwherevariablesandfunctionsmaybelocally
definedEXAMPLE:
:
sysi=4
scope
sysi=8
'print"innerscopei="i
endscope
'-----------------
'EQUIVALENTSYNTAX
'=================
scope
{
sysi=8
'print"innerscopei="i
}
(
sysi=8
'print"innerscopei="i
)
print"outerscopei="i'i=4
REMARKS: whenthescopeendsanydefinitionscreatedwithinthescopewillbeforgotten.
RELATED: blocksblocknamespace
![Page 93: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/93.jpg)
o2ACTION: startablockofo2machinecodenotationUSE: insertinginlinemachinecodeandotherbinarydata.directuseof
o2language(usedbytheo2linker)EXAMPLE:
o2b800010000'machinecodeformoveax,256
RELATED: blocks
![Page 94: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/94.jpg)
deffACTION: createanassemblycodemacrofortheFPU(metatype-17)USE: tocreatefloatingpointmathsfunctionsEXAMPLE:
deffsinefsin
REMARKS: DeffmacrosmakeuseoftheFPU.Allfloatfunctionsaredefinedthisway.Thesearenon-recursivemacrosandtakenomacroarguments.TheexpressionparserisFPU-awareandtakescareofpassingparametersontotheFPUstack.
RELATED: macrosdef#definemacrosincos
![Page 95: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/95.jpg)
macrofunctionsUSE: invokemulti-linemacroswithinexpressions
'USINGMACROFUNCTIONS
'2DARRAYWITHBOUNDARYCLIPPING
indexbase0
intpix[800*600]
'
'SINGLE-LINEMACROFUNCTION
'macropix2d(x,y)pix(y*800+x)
'
'MULTI-LINEMACRORETURNINGAUNIQUEVARIABLE
'
macropix2dint*(v,x,y,vv)
=============================
'vpixelpointersupportingread/write
'xhorizontalcoordinate
'yverticalcoodinate
'vvsinkpixel
ifx>=0andx<800andy>=0andy<600
@v=@pix(y*800+x)
else
intvv=0xffffffff'valuewhenoutofbounds
@v=@vv
endif
endmacro
'
'TEST
pix2d(1,20)=0xaabbccdd
printhexpix2d(1,20)
printhexpix2d(800,10)
REMARKS: implementsin-linefunctions
RELATED: macrosmacrooperators
![Page 96: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/96.jpg)
macrooperatorsUSE: encodeoperatorsetsfordifferenttypes(UDTs)
'---------------
'MACROOPERATORS
'===============
'PARTIALDEMO
typevector3f
floatx,y,z
endtype
macrovector3f_op
macro."save"(a,acc)
a.x=acc.x
a.y=acc.y
a.z=acc.z
endmacro
macro."load"(acc,a)
acc.x=a.x
acc.y=a.y
acc.z=a.z
endmacro
macro."neg"(acc,a)
acc.x=-a.x
acc.y=-a.y
acc.z=-a.z
endmacro
macro."+"(acc,a)
acc.x+=a.x
acc.y+=a.y
acc.z+=a.z
endmacro
macro."-"(acc,a)
acc.x-=a.x
acc.y-=a.y
acc.z-=a.z
endmacro
macro."*"(acc,a)
acc.x*=a.x
acc.y*=a.y
acc.z*=a.z
endmacro
![Page 97: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/97.jpg)
macro."/"(acc,a)
acc.x/=a.x
acc.y/=a.y
acc.z/=a.z
endmacro
'
macro."str"string(out,a)'COREFUNCTIONS
out=str(a.x)+","+str(a.y)+","+str(a.z)
endmacro
'
endmacro
'TESTS
'=====
'#recordof"r.txt"vector3f_op
dimvector3fA={1,2,3}
dimvector3fB={10,20,30}
dimvector3fC={10,100,1000}
printstr(A)
printstr(A+B)
printstr(C*(A+B))
REMARKS: implementingoperatorsforcompundtypes:vectors,complexnumbers,matrices,etc.
RELATED: macrosmacrofunctions
![Page 98: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/98.jpg)
functionACTION: defineafunctionEXAMPLE:
functiontriple(iasint)asint
returni*3
endfunction
RELATED: proceduressubmethod
![Page 99: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/99.jpg)
subACTION: defineasub.(likeafunctionbutnotreturningavalue)EXAMPLE:
subtriple(iasint,jasint)
j=i*3
endsub
RELATED: proceduresfunctionmethod
![Page 100: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/100.jpg)
methodACTION: defineamethod.(afunctionorsubforobjects)EXAMPLE:
methodtriple(iasint)asint
returni*3
endmethod
RELATED: proceduresfunctionsub
![Page 101: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/101.jpg)
gosubACTION: callalabelledsubroutineUSE: invokelocalsubroutinesinsideaprocedure
'%filename"t.exe"
'usesrtl64
functionf()
inta=42
intb
'gosubg
gosubgwhena>0
printb
return
'
g:
b=a/2
ret
'
endfunction
f
RELATED: procedurescallgoto
![Page 102: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/102.jpg)
ifACTION: startaconditionalblockwithatestUSE: conditionalexecutionEXAMPLE:
ifa<bthena=b
RELATED: conditionalsthenelseelseifendifwhile
![Page 103: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/103.jpg)
thenACTION: startstheconditionalblockwherethepriortestismet.USE: conditionalexecutionEXAMPLE:
ifa>bthenprinta
RELATED: conditionalsifelseifendif
![Page 104: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/104.jpg)
elseifACTION: makeanalternativetestifthepreviousconditionwasnotmet.USE: conditionalexecutionRELATED: conditionalsifelseendif
![Page 105: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/105.jpg)
elseACTION: startsthealternativeblockwherenoneofthepriorconditionsare
metUSE: conditionalexecutionEXAMPLE:
ifa>bthenprintaelseprintb
RELATED: conditionalsifelseifendif
![Page 106: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/106.jpg)
endifendifACTION: endtheconditionalblockUSE: conditionalexecutionEXAMPLE:
ifa>bthen
a=b
endif
RELATED: conditionalsifthenelseifelseendif
![Page 107: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/107.jpg)
doACTION: startablockforrepetition(looping)EXAMPLE:
a=0
do
'...
a+=1:ifa=4thenexitdo
enddo
RESULT:a=4'4loops
RELATED: loopswhilecontinueexitenddoloop
![Page 108: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/108.jpg)
whileACTION: startablockforconditionalrepetitionEXAMPLE:
a=0
whilea<4
a+=1
wend
RESULT:a=4'4loops
REMARKS: whileidacombinationofdoandif¬.
RELATED: loopsdocontinueexitwendenddo
![Page 109: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/109.jpg)
exitACTION: exitadowhilefor(...)blockimmediatelyUSE: leavealoop,usuallyafteraconditionhasbeenmetEXAMPLE:
a=0:b=1
do
a+=1
ifa>4thenexitdo
b+=b
enddo
RESULT:a=5:b=16
REMARKS: Alsousedtoexitlow-levelnestingblocks.
RELATED: loopsdowhilecontinuerepeat
![Page 110: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/110.jpg)
continueACTION: gobacktothebeginningofado,whileorforblockUSE: to"shortcircuit"aloopREMARKS: continuedoandcontinuewhilewillloopbacktothe
nearestdoorwhile¬atthesamenestinglevel.
RELATED: loopsdowhileforbreakexitwendenddorepeat
![Page 111: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/111.jpg)
wendendwhile,loopACTION: endawhileblockUSE: see:whileRELATED: loopsdowhilecontinueexit
![Page 112: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/112.jpg)
enddoenddo,loopACTION: endadorepeatingblockUSE: see:doRELATED: loopswhiledoloopcontinueexit
![Page 113: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/113.jpg)
forACTION: startaniterationblockRELATED: iterationtostepnext
![Page 114: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/114.jpg)
toACTION: specifylimitofaniterationRELATED: iterationforstepnext
![Page 115: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/115.jpg)
stepACTION: specifyincrementofaniterationUSE: foriterator=starttoendstepstepincrementEXAMPLE:
fori=1to10step2:...:next
RESULT:iincreeasesby2witheachcycle:13579
RELATED: iterationfortonext
![Page 116: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/116.jpg)
nextACTION: enditerationblockRELATED: iterationfortostep
![Page 117: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/117.jpg)
selectACTION: StartaCaseblock(Cstyle)RELATED: selectioncaseendselend
![Page 118: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/118.jpg)
caseACTION: specifyacasetomatchfollowedbyactionstoperformRELATED: selectionselectendselend
![Page 119: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/119.jpg)
classACTION: defineaclass(strucureandmethodsforobjects)EXAMPLE:
''DEFINECLASS
'
classrgbacolor
redasbyte
greenasbyte
blueasbyte
alphaasbyte
'
methodin(sysr,sysg,sysb,sysa)
red=r:green=g:blue=b:alpha=a
endmethod
'
endclass
RELATED: classestypetypedefstruct
![Page 120: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/120.jpg)
hasEXAMPLE:
classperson
hasmind
REMARKS: 'has'isusedwhentheclassisderivedfrommorethanasingleparentalclass.ie:multipleinheritance.'has'maybeomitted.Itissufficienttoprovidetheclass/typenamewithoutthisqualifier.
RELATED: offromextendsclassclasses
![Page 121: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/121.jpg)
ofREMARKS: 'of',and'from'andextendsareequivalent.They
indicatederivationfromasingleparentalclass.COMinterfacesussingleinheritance
RELATED: hasclassclasses
![Page 122: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/122.jpg)
fromREMARKS: 'of',and'from'andextendsareequivalent.They
indicatederivationfromasingleparentalclass.COMinterfacesussingleinheritance
RELATED: hasclassclasses
![Page 123: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/123.jpg)
virtualREMARKS: objectsofvirtualclassesareusuallycreatedbysome
kindofserverorclassfactory.Theclientonlyreceivesareference(pointer)totheobjectfromtheserverandonlyknowshowtoinvokeitsmethods.Itassumesnoknowledgeofitsinnerworkings.
RELATED: comexternalexportclassexterncomclass
![Page 124: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/124.jpg)
comREMARKS: COMisaprotocolusedbyMicrosofttoprovideObjectinterfaces.
ClasseswiththisattributeareconsideredVirtual.
RELATED: virtualexternalexportclassofinheritsexternvirtualclass
![Page 125: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/125.jpg)
newACTION: createadynamicobjectandcallitsconstructormethod.USE: tocreateandinitialisepersistentobjectsEXAMPLE:
newshapecuboid1,1,1
RELATED: classesdelredimdim
![Page 126: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/126.jpg)
delACTION: Calladynamicobject'sdestructormethodanddisallocateits
memoryblock.USE: todeletedynamicobjectsEXAMPLE:
delcuboid
REMARKS: 'del'mayalsobeusedtodeletethecontentofindividualstringsandbstrings.Stringsaresettonull;thecontentsarereleasedandremovedfromthegarbagecollector'slists.
RELATED: classesnew
![Page 127: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/127.jpg)
and&REMARKS: bitwiseoperator
RELATED: andorxoroperators
![Page 128: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/128.jpg)
or|REMARKS: bitwiseoperator
RELATED: andor=xoroperators
![Page 129: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/129.jpg)
xorREMARKS: bitwiseoperator
RELATED: andorxor=operators
![Page 130: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/130.jpg)
*ACTION: returntheintegervaluelocatedbytheaddresscontainedinthevariableUSE: readingwritingdata,usingpointersEXAMPLE:
inta=42
print@a'addressofa
sysb'sys'ensuresanintegerlargeenoughtoholdapointer
b=@a'assinaddressofatob
print*b'42
REMARKS: UnlikeC,pointerresolutionisnormallyhandledimplictly.
RELATED: @?strptraddr
![Page 131: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/131.jpg)
and=&=REMARKS: bitwiseassignoperator
RELATED: andorxoroperators
![Page 132: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/132.jpg)
or=|=REMARKS: bitwiseassignoperator
RELATED: andorxoroperators
![Page 133: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/133.jpg)
&&REMARKS: logicaloperator
RELATED: &&||^^operators
![Page 134: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/134.jpg)
||REMARKS: logicaloperator
RELATED: &&||^^operators
![Page 135: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/135.jpg)
^^REMARKS: logicaloperator
RELATED: &&||^^operators
![Page 136: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/136.jpg)
&&=REMARKS: logicalassignoperator
RELATED: &&||^^operators
![Page 137: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/137.jpg)
||=REMARKS: logicalassignoperator
RELATED: &&||^^operators
![Page 138: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/138.jpg)
^^=REMARKS: logicalassignoperator
RELATED: &&||^^operators
![Page 139: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/139.jpg)
stdcallACTION: determineshowparametersarepassedonthestackUSE: declaringexternalfunctionsEXAMPLE:
!Sleeplib"kernel32.dll"stdcall(intmsec)
REMARKS: thisisthedefaultcallingconventionon32bitWindowsplatforms.
RELATED: callingcdeclms64pascal
![Page 140: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/140.jpg)
cdeclACTION: determineshowparametersarepassedonthestackUSE: declaringexternalfunctions,andvariadicfunctionsREMARKS: thisisacommoncallingconventionon32bitplatforms.Thestack
iscleanedupafterthecallbythecaller.
RELATED: callingcdeclms64pascalcallback
![Page 141: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/141.jpg)
ms64ACTION: determineshowparametersarepassedonthestackUSE: declaringexternalfunctions,andvariadicfunctionsREMARKS: thisisthedefaultWindowscallingconventionon64bitplatforms.
Thefirstfourparametersarepassedinregisters.Thestackiscleanedupafterthecallbythecaller.
RELATED: callingstdcallcdeclpascal
![Page 142: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/142.jpg)
pascalACTION: determineshowparametersarepassedonthestackUSE: declaringexternalfunctionsEXAMPLE:
!Sleeplib"kernel32.dll"stdcall(intmsec)
REMARKS: thisisalegacycallingconventionon32bitplatforms.
RELATED: callingstdcallcdeclms64
![Page 143: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/143.jpg)
spaceACTION: returnsastringofspacesUSE: string=spacelengthEXAMPLE:
s=space10
RESULT:s=""'10spaces(ascii32)
REMARKS: forwidestringsusestring(n,wchr32)instead
RELATED: nulsstringltrimrtrim
![Page 144: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/144.jpg)
nulsACTION: returnstheaddressofastringofnullcharactersgiventhelength.USE: string=nulslengthEXAMPLE:
s=nuls1000
RESULT:sisastringof1000nullcharacters
REMARKS: forwidestringsusestring(n,wchr0)instead
RELATED: spacestringnewsfreesgetmemory
![Page 145: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/145.jpg)
ascACTION: returnsasciiencodingofacharacterinastringUSE: AsciiCode=asc(String,CharacterPosition)EXAMPLE:
a=asc("ABCDEF",2)
RESULT:a=66'character='B'
RELATED: unicchrvallenstr
![Page 146: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/146.jpg)
unicACTION: returnsencodingofacharacterinawidestringUSE: uni=unic(String,CharacterPosition)EXAMPLE:
a=unic("ABCDEF",2)
RESULT:a=0x0042'character='B'
RELATED: ascwchrchrvallenstr
![Page 147: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/147.jpg)
redimACTION: createorresizeadynamicarray,preservingcontentswithinrangeUSE: extendorreduceanarraysizeatrun-timeEXAMPLE:
redimstrings(n)
REMARKS: toflushanarray'scontents,redimitwith0elementsfirst.Butavoiddoingthiswitharraysofstrings;theorphanedstringsarenotgarbage-collecteduntiltheendoftheprogram,andwillaccumulateoneachiterationwheretheredimreducesthenumberofelements.
RELATED: dimnew
![Page 148: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/148.jpg)
letACTION: definesavariableorobjectUSE: createanewvariableorindirectobjectEXAMPLE:
lets="thisisastring"
printtypeofs'result:'string'
REMARKS: Similartousing'dim'butthetypeisinferredfromtheassignedvalue.
RELATED: dimvar
![Page 149: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/149.jpg)
varACTION: defineasetofvariablesUSE: low-leveldimensioningofvariablesEXAMPLE:
varstrings,t,u(64),v
REMARKS: varisnormallyonlyusedinternally.itaccepts*forindirectvariablesand"at"forvariablemapping.Arraysarealsosupported.
RELATED: dim
![Page 150: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/150.jpg)
unionACTION: defineaunion(Csyntax)USE: allowsdifferentvariablestooccupythesamespace.EXAMPLE:
unionutype
{
byteb
shortw
longi
}
RESULT:v.b=42:v.w=42:v.i=42
REMARKS: aunionmayalsobenestedinsideatype.
RELATED: typedeftypestructclassenum
![Page 151: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/151.jpg)
enumACTION: createanenumerationUSE: assignanumericidentitytoaname
'------------
'ENUMERATIONS
'============
'SIMPLEENUMERATION
'==================
enumManyThings
shoes
ships
sealing_wax
cabbages
kings
endenum
defshow"%1:"%1
printshowcabbages
'ENUMERATIONFROMABASEVALUE
'=============================
enumManyThings
shoes=11
ships
sealing_wax
cabbages
kings
endenum
printshowships
'BITWISEENUMERATION
'===================
'1248163264...
enumbitManyThings
shoes
![Page 152: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/152.jpg)
ships
sealing_wax
cabbages
kings
endenum
'ENUMERATIONUSAGE
'=================
'DimasManyThingsmt
ManyThingsmt
mt=cabbages
printmt
REMARKS: Csyntaxissupportedforthisconstruct.Alsoenumbitassignsvalues1,2,4,8,16..insteadof0,1,2,3,4..
RELATED: typedefenum#define(%)
![Page 153: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/153.jpg)
embedfileACTION: specifiyafiletobeembeddedinthedatasectionUSE: storedatafileinaprogram,andgetapointertoit.EXAMPLE:
sysdat:embedfile"data.txt",dat
REMARKS: Textorbinaryfilesmaybeembeddedwiththiscommand.Thedataisread-only.Eitherasysorabstringvariablemaybeusedtoreferencethedata.Anupperlimitof255filescanbeembedded.
RELATED: includestrptrgetfile
![Page 154: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/154.jpg)
librarypathACTION: defineafilepathforDLLfilesUSE: tellsthecomputerwheretofindDynamicLinkLibrariesrequired
toruntheprogram.(SystemDLLsdonotrequirethis.)RELATED: libraryexternincludepath
![Page 155: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/155.jpg)
#ifdefACTION: includecodeifsymbolalreadydefinedUSE: toallowblocksofcodetobeincludedoromittedatcompiletimeEXAMPLE:
#ifdefMSWIN
#include"windows.inc"
#endif
RELATED: #if#elseif#endif
![Page 156: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/156.jpg)
#ifndefACTION: includecodeifsymbolalreadydefinedUSE: toallowblocksofcodetobeincludedoromittedatcompiletimeEXAMPLE:
#ifdefMSWIN
#include"windows.inc"
#endif
RELATED: #if#elseif#endif
![Page 157: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/157.jpg)
namespaceACTION: startanamspaceUSE: createaregionwheresymbolslocallydefinedEXAMPLE:
'
inti=1
'
namespaceaa
inti=10
namespacebb
inti=20
endnamespace
'
printi+aa::i+bb::i'31
'
namespacebb
printi'20
endnamespace
RELATED: scope
![Page 158: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/158.jpg)
sinACTION: returnsthesineofavaluegiveninradiansUSE: Sine=sin(Radians)EXAMPLE:
v=sin(pi/6)
RESULT:v=0.5
RELATED: asincostan
![Page 159: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/159.jpg)
cosACTION: returnscosinevalue(ratioofx/r)givenangleinradiansUSE: Cosine=cos(radians)EXAMPLE:
c=cos(pi/3)
RESULT:c=0.5
RELATED: sintan
![Page 160: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/160.jpg)
gotoACTION: jumptoaspecifiedlabelinthecodeEXAMPLE:
functioncube(fasfloat)asfloat{returnf*f*f}
RELATED: jmpgosub
![Page 161: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/161.jpg)
endACTION: markstheendofacodeblockUSE: terminatingvariousblockstructuresEXAMPLE:
ifa>bthen
b=a
endif
REMARKS: Anisolated'end'terminatestheprogram.
RELATED: blockscopeifdowhileselectfunctionsubmethodclassmacrodef
![Page 162: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/162.jpg)
loopenddo,enddoACTION: endadorepeatingblockUSE: see:doRELATED: loopsdocontinueexit
![Page 163: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/163.jpg)
breakACTION: exitaswitchblockordo/whileblockRELATED: caseswitchwhiledocontinue
![Page 164: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/164.jpg)
endselendselectACTION: endtheselectblockRELATED: selectionselectcase
![Page 165: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/165.jpg)
extendsREMARKS: 'of',and'from'andextendsareequivalent.They
indicatederivationfromasingleparentalclass.COMinterfacesussingleinheritance
RELATED: hasclassclasses
![Page 166: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/166.jpg)
externalREMARKS: functionswiththeexternalattributeexpecttobecalledfrom
proceduresexternaltoOxygen.Additionalregistermanagementisenlistedtosupportexternalcalls.
RELATED: externcomexportcallbackcomvirtualfunctionsubmethod
![Page 167: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/167.jpg)
exportREMARKS: procedureswiththisattributearevisibletoexternalcallers
whentheyarecompiledaspartofaDLL(DynamicLinkLibrary)
RELATED: externalfunctionsubextern
![Page 168: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/168.jpg)
externACTION: associatedeclaredprocedureswithacallingconventionand/ordllnameEXAMPLE:
externstdcalllib"kernel32.dll"
declarefunctionQueryPerformanceCounter(lpPerformanceCountasquad)assys
declarefunctionQueryPerformanceFrequency(lpPerformanceFrequencyasquad)assys
endextern
REMARKS: notetherisnoneedtouseanAliasinthesedeclarationsifyougivetheexactnameoftheproceduresintheiroriginalcase.
RELATED: liblibrarycalling
![Page 169: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/169.jpg)
xor=REMARKS: bitwiseassignoperator
RELATED: andorxoroperators
![Page 170: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/170.jpg)
@ACTION: returntheaddressofavariableUSE: readingwritingdataofvariablesandarraysofvariables,by
referenceEXAMPLE:
inta=42
print@a'addressofa
int*b'indirect(pointer)variable
@b=@a'coupledbyaddress
printb'42
REMARKS: UnlikeC,pointerresolutionishandledimplictly.Sothe@operatorisrequiredformanipulatingpointers.Itissimilartothe&operatorinC.
RELATED: *?strptraddr
![Page 171: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/171.jpg)
?ACTION: returntheintegervaluecontainedinthevariableUSE: castingvariablesasintegersEXAMPLE:
floatf=100
printhex(?f)'displaythehexadecimalformoffloatf
RELATED: cast*@strptraddr
![Page 172: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/172.jpg)
strptrACTION: returnastringpointerUSE: obtainbaseaddressofstringcontentsEXAMPLE:
strings="Hello"
sysa=strptrs
RELATED: typecodeofaddr
![Page 173: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/173.jpg)
addrACTION: resolveaddressofavariable(assembler)USE: loadaddressofavariabletoaregisterEXAMPLE:
sysa
addrecx,a
RELATED: @*?strptr
![Page 174: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/174.jpg)
ltrimACTION: returnsstringwithwhitespaceonthelefttrimmedoffUSE: string=rtrim(string)EXAMPLE:
s=ltrim"abc"
RESULT:s="abc"
RELATED: rtrimspacestrlcaseucase
![Page 175: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/175.jpg)
rtrimACTION: returnsstringwithwhitespaceontherighttrimmedoffUSE: string=rtrim(string)EXAMPLE:
s=rtrim"abc"
RESULT:s="abc"
RELATED: ltrimspacestrlcaseucase
![Page 176: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/176.jpg)
newsACTION: allocatesabstringofnullcharactersgiventhelengthinbytesUSE: bstring=newslengthEXAMPLE:
b=news1000
'...
freesb
RESULT:bcontainsaddressofastringof1000nulcharacters.Thenthestingisfreed
REMARKS: OxygenstringsareautomaticallyfreedbutBstringsmustbeexplicitlyfreedwhennolongerneeded.
RELATED: freesnulsspacebstringgetmemory
![Page 177: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/177.jpg)
freesACTION: deallocatesabstringUSE: freesbstringfreememoryEXAMPLE:
b=news1000
'...
freesb
RESULT:bcontainsaddressofastringof1000nulcharacters.Thenthestingisfreed
REMARKS: OxygenstringsareautomaticallyfreedbutBstringsmustbeexplicitlyfreedwhennolongerneeded.
RELATED: newsnulsfreememorygetmemory
![Page 178: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/178.jpg)
getmemoryACTION: allocateblockofmemoryandreturnitsbaseaddressUSE: address=getmemorybytesEXAMPLE:
m=getmemory8000
RELATED: freememorynewsfrees
![Page 179: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/179.jpg)
chrACTION: returnsstringof1characterofasciiencoding(0..255)USE: string=chr(AsciiValue)EXAMPLE:
s=chr(65)
RESULT:scontains"A"
RELATED: wchrascunicstring
![Page 180: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/180.jpg)
valACTION: returnsnumericvalueofstringUSE: value=valstringEXAMPLE:
v=val"2.5"
RESULT:v=2.5
RELATED: trhexasc
![Page 181: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/181.jpg)
lenACTION: returnslengthofstringincharatersUSE: length=len(string)EXAMPLE:
v=len("Hello")
RESULT:v=5
REMARKS: charactersmaybeoneortwobytes(widecharacters)
RELATED: stringspacemidsizeof
![Page 182: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/182.jpg)
strACTION: returnsstringrepresentationofnumberUSE: String=str(value)EXAMPLE:
s=str(-1.23456)'result:-1.23456
s=str(-1.23456,3)'result:-1.235
REMARKS: roundingisautomaticallyappliedbeforedecimalplacesaretruncated.
RELATED: hexval
![Page 183: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/183.jpg)
wchrACTION: returnswidestringofa2bytecharacter(encoding0..65535/
0xffff)USE: widestring=wchr(WideCharValue)EXAMPLE:
wstringws=wchr(65)
RESULT:wscontainsunicodecharacter0x0041
RELATED: unicascstring
![Page 184: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/184.jpg)
getfileACTION: copiesfilecontenttoastringUSE: String=getfileFileName:getfileFileName,StringEXAMPLE:
strings:getfile"t.txt",s
RESULT:scontainscontentof"t.txt"
RELATED: putfileprint
![Page 185: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/185.jpg)
libraryACTION: specifythenameofaDLLlibrarytoassociatewithasetof
proceduredeclarationsEXAMPLE:
lib"kernel32.dll"
RELATED: declare
![Page 186: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/186.jpg)
#ifACTION: includeblockofcodeifconditionsaremetRELATED: #else#elseif#endif
![Page 187: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/187.jpg)
#elseifACTION: includeblockofcodeifthesealternativeconditionsaremetRELATED: #if#else#endif#fi
![Page 188: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/188.jpg)
#endifACTION: endofconditionalcodeinclusionblockRELATED: #if#elseif
![Page 189: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/189.jpg)
asinACTION: returnsangleinradiansgiventheratioy/radiusUSE: angle=asin(YRRatio)EXAMPLE:
a=asin(0.5)
RESULT:a=pi/6
RELATED: sinacosatnatan
![Page 190: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/190.jpg)
tanACTION: returnsthetangentofavaluegiveninradiansUSE: tangent=tan(radians)EXAMPLE:
t=tan(a)
RESULT:t=ratioy/x
RELATED: atanatnsincos
![Page 191: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/191.jpg)
switchACTION: StartaCaseblock(Cstyle)RELATED: selectioncaseendselend
![Page 192: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/192.jpg)
libREMARKS: libmaybespecifiedintheDeclarestatementoritmaybe
specifiedinanexternstatement,referringtoanentiregroupofdeclarations.
RELATED: librarydeclareexternaliaslinkat
![Page 193: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/193.jpg)
castACTION: changeorspecifythetypeofavariabletemporarily,inanexpressionEXAMPLE:
floatf=100
printhex(cast(int)f)'displaythehexadecimalformoffloatf
printhex((int)f)'thesamewithoutusingthe'cast'word
RELATED: convert?union
![Page 194: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/194.jpg)
typecodeofACTION: returntypecodenumberofvariablesandliterals.USE: obtaindatafordiagnosticsorreflectiveprogrammingRELATED: typeofrecordofsizeofoffsetofspanofprototypeof#recordof
![Page 195: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/195.jpg)
lcaseACTION: returnslowercaseofstringUSE: string=lcase(string)EXAMPLE:
s=lcase"ABCDEF"
RESULT:s="abcdef"
RELATED: ucaseltrimrtrimasc
![Page 196: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/196.jpg)
ucaseACTION: returnsuppercaseofstringUSE: string=ucase(string)EXAMPLE:
s=ucase"abcdef"
RESULT:s="ABCDEF"
RELATED: lcaseltrimrtrimasc
![Page 197: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/197.jpg)
freememoryACTION: freepreviouslyallocatedmemoryblockUSE: freememoryaddressEXAMPLE:
freememorym
RELATED: getmemorynewsfrees
![Page 198: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/198.jpg)
hexACTION: returnshexadecimalstringrepresentationofintegerpartofnumberUSE: hexString=hex(value)EXAMPLE:
printhex(14.4)'result'E'
printhex(14.4,4)'result'000E'
RELATED: strval
![Page 199: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/199.jpg)
sizeofACTION: returnlengthofvariableelement(inbytes)USE: nbytes=sizeofvariableEXAMPLE:
n=sizeofa
RELATED: offsetofspanoftypeoftypecodeof
![Page 200: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/200.jpg)
putfileACTION: savesastringtoafileUSE: putfileFileName,StringEXAMPLE:
putfile"t.txt","Hello"
RESULT:Afilenamed"t.xt"iscreatedoroverwrittencontaining"Hello"
RELATED: getfileprint
![Page 201: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/201.jpg)
printACTION: DisplaysstringsandnumbersUSE: printString:printNumberEXAMPLE:
print"ABC":print123:print"ABC:"123"DEF:"456
RESULT:ABC
123
ABC:123DEF:456
REMARKS: stringscanbecombinedwithnumbersassysasthefirstelementisastring
RELATED: valstrhexputfilegetfile
![Page 202: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/202.jpg)
declareACTION: declareaprocedurewithitsprototype(maybeexternalordeclared
inadvance)EXAMPLE:
declarefun(floata,b,c,d)asfloat
declarefunctionfun(floata,b,c,d)asfloat
REMARKS: ThereisawiderangeofoptionsforDeclarestatements.Pleaselookattheexamplesandheaderfiles.
RELATED: !librarylibaliasdim
![Page 203: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/203.jpg)
#elseACTION: alternativeblockofcodetoincludeifpriorconditionsarenotmet.RELATED: #if#elseif#endif
![Page 204: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/204.jpg)
acosACTION: returnsangleinradiansgiventheratiox/radiusUSE: angle=acos(YRRatio)EXAMPLE:
a=acos(0.5)
RESULT:a=pi/3
RELATED: cosasinatnatan
![Page 205: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/205.jpg)
atnACTION: returnsangleinradiansgivenratioy/xUSE: angle=atn(YXRatio)EXAMPLE:
a=atn(1)*4
RESULT:a=pi
RELATED: atanasinacostan
![Page 206: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/206.jpg)
atanACTION: returnsangleinradiansgiventhevaluesofyandxUSE: angle=atan(y,x)EXAMPLE:
a=atan(0.5,sqr(0.75))
RESULT:a=pi/6
RELATED: atnasinacostan
![Page 207: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/207.jpg)
aliasREMARKS: iftheprocedurenameisanexactcasematchthenitisnot
necessarytospecifyanAlias.
RELATED: librarydeclareexternallibrarydeclareexternal
![Page 208: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/208.jpg)
convertACTION: explicitlyconvertthetypeofanexpression.USE: passvalues,intherequiredtype,toanunprototypedfunctionEXAMPLE:
floatf=2.5
sleep(convertint(f*1000))
RELATED: cast
![Page 209: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/209.jpg)
typeofACTION: returnnameofthevariabletypeUSE: name=typeofvariableEXAMPLE:
dimaslongv:s=typeofv
RESULT:s="long"
RELATED: typecodeofsizeofoffsetofspanofrecordof
![Page 210: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/210.jpg)
recordofACTION: returnrecordofcompound(UDT)variableUSE: obtaindatafordiagnosticsorreflectiveprogrammingEXAMPLE:
typevtlongv,doubled
dimasvtv:r=recordofv
RESULT:r="
v041A0,long
d441A0,double
"
REMARKS: use#recordoftodisplaytherecordduringcompilation.
RELATED: #recordofprototypeofsizeofoffsetofspanoftypeoftypecodeof#recordof
![Page 211: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/211.jpg)
offsetofACTION: returnoffsetofvariablefromindexregisterUSE: nbytes=offsetofvariableEXAMPLE:
n=offsetofa
RELATED: sizeofspanoftypeoftypecodeofrecordof
![Page 212: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/212.jpg)
spanofACTION: returnspanofarrayvariabledimensionUSE: nbytes=spanofvariabledimensionEXAMPLE:
dimaslongv(10):n=spanofv
RESULT:n=10
RELATED: sizeofoffsetoftypeoftypecodeofrecordof
![Page 213: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/213.jpg)
prototypeofACTION: returnprototype(s)offunctions,subsandhighlevelmacrosUSE: obtaindatafordiagnosticsorreflectiveprogrammingRELATED: recordofsizeofoffsetofspanoftypeoftypecoedof#recordof
![Page 214: Oxygen Basic Compiler - documentation.help · Oxygen Basic (o2H) is a Just-In-Time compiler assembler, deployed in a single DLL that takes source code strings and returns executable](https://reader030.vdocuments.us/reader030/viewer/2022040119/5e5162792504f9339c7faaf3/html5/thumbnails/214.jpg)
#recordofACTION: returninternalrecordofadeclaredentity.USE: tocheckstatusatcompiletime.EXAMPLE:
#recordofMyStructure
REMARKS: thiscommandwasintroducedtoaiddebuggingatcompiletimeareoftenhardtotrace.
RELATED: #blockdepth