which is the most clean process?
Thanks.
Code: Select all
Private Const
myString = "Hello World!"
Public Function MyFunction(pMyStringAddr as Word) as Boolean
...
End Function
Dim Res as Boolean
Res = MyFunction(@myString)
...
Moderators: David Barker, Jerry Messina
Code: Select all
Private Const
myString = "Hello World!"
Public Function MyFunction(pMyStringAddr as Word) as Boolean
...
End Function
Dim Res as Boolean
Res = MyFunction(@myString)
...
Code: Select all
private const
myString = ("Hello World!")
public inline function TBLRD_POSTINC() as TABLAT
asm
TBLRD*+
end asm
end function
public function MyFunction(pMyStringAddr as TABLEPTR) as boolean
dim b as byte
repeat
b = TBLRD_POSTINC()
until (b = 0)
result = true
end function
Myfunction(addressof(mystring))
Code: Select all
Private Inline Function TBLRD_POSTINC() As TABLAT
Asm
TBLRD*+
End Asm
End Function
Private Inline Function TBLRD_PREINC() As TABLAT
Asm
+TBLRD*
End Asm
End Function
Private Inline Function TBLRD_VALUE() As TABLAT
Asm
TBLRD*
End Asm
End Function
Public Function cLength(pAddr As TABLEPTR) As Word
Result = 0
While TBLRD_POSTINC()<>0
Inc(Result)
End While
End Function
Public Function MyFunction(pCStrAddr As ????) As Boolean
Dim sLen As Word
sLen = cLength(pCStrAddr)
...
Code: Select all
Public Function cLength(pAddr As word) As Word
Result = 0
TABLEPTR = pAddr
While TBLRD_POSTINC()<>0
Inc(Result)
End While
End Function
Public Function MyFunction(pCStrAddr As word) As Boolean
Dim sLen As Word
sLen = cLength(pCStrAddr)
TABLEPTR = pCStrAddr
...