Oxygen Basic
Programming => Problems & Solutions => Topic started by: chrisc on March 20, 2018, 08:09:52 PM
-
in PB we can declare pointer as
GLOBAL Sgp1 AS DWORD PTR
' and later use the pointer
Sgp1 = CODEPTR(somelabel)
LOCAL Amm AS LONG
Amm = @Sgp1[Amm]
how to do it in O2 ?
-
I manot sure for array
but simple way is :
'pointer
string a = "Oxygen"
@p = a
print p ' show Oxygen
-
This could be confusing since o2 uses the @ operator as codeptr or 'address of'
GLOBAL Sgp1 AS DWORD PTR
' and later use the pointer
Sgp1 = CODEPTR(somelabel)
LOCAL Amm AS LONG
Amm = @Sgp1[Amm]
sys Sgp1
Sgp1 =@somelabel
dim Amm AS LONG
amm=1
Amm = *(Sgp1+Amm)
print hex Amm 'result: 302
end
somelabel:
db 01 02 03 00 00
-
Thanxx to both of you and i gonna test them out on a program