Category:OxygenBasic: Difference between revisions

mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1:
{{language|express=both}}
|express=both
|site=http://www.oxygenbasic.org/}}
OxygenBasic is a compilable language in the [[BASIC]] genre supporting [[object-oriented programming]], and containing features of [[C]]. Its earliest origins was as a macro [[Assembly]] code language in 2009, but subsequently acquired all the features of a high-level language.
 
Line 12 ⟶ 14:
'''Iteration:'''
<pre>
int i
i=0
string pr
pr=""
for i=1 to 10
pr+="Line: " i chr(13) chr(,10)
next
print pr
Line 22 ⟶ 24:
'''Function:'''
<pre>
function cube(double nd) as double
return d*d*d
end function
Line 35 ⟶ 37:
string buf
'
method store(string skey,text)
buf += "chr(1) "+ skey + chr(2) + text + chr(3) + chr(13)
 
end method
'
method find(string skey) as string
sysint a,b,c
a=instr 1,buf,schr(1) + key '+ chr(2)
if a then
b=instr a,s buf, chr(132)
returnc=instr mida, buf,a,b-a chr(3)
return mid buf, b+1, c-b-1
end if
return "( "+key+ " not found )"
end method
'
Line 55 ⟶ 60:
 
MemoryBank b
b.store ("shoes","500 pairs"
b.store "ships","10 galleons"
shoes LC1
b.store "sealing wax","5 LC3lbs"
ships LC2
sealing wax LC3
cabbages LC4
kings LC5
")
 
printstring f=b.find ("ships")
</pre>
 
54

edits