Hi all,
it seems that we have to find a better solution for hyper in Basic
because hyper is a valid type in our API and in fact of this we should
extend the typeset of Basic at least to support all the simple base
types of our API.
Andreas, what do you think? What would be the best solution to support
hyper in Basic?
Juergen
Bernard Marcelly wrote:
Bonjour Paolo Mantovani
Message du 2006-06-19 02:23:
oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
oFile = oUcb.OpenFileReadWrite("file:///home/paolo/img.png")
oInputStream = createUnoService("com.sun.star.io.DataInputStream")
oInputStream.setInputStream(oFile.getInputStream())
' print oFile.getLenght 'error!!!
' oFile.seek(5) 'error!!!
oFile.seek(CreateUnoValue("hyper", 5)) 'No problem......
oInputStream.closeInput
I found a solution to this example. Tested on a 50Mbytes file.
dim oUcb as object, oFile as object, oInputStream as object
dim hx as variant, hxb as variant, p as variant
oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
oFile = oUcb.OpenFileReadWrite(convertToURL("D:\Music\Haendel235.wav"))
oInputStream = createUnoService("com.sun.star.io.DataInputStream")
oInputStream.setInputStream(oFile.getInputStream())
hx = oFile.getLength
hxb = CLng(hx) ' convert to a usable Basic type
print hxb
hxb = hxb -4879123 ' compute a related position
print hxb
oFile.seek(CreateUnoValue("hyper", hxb)
p = oFile.getPosition
print CLng(p) ' confirmation
oInputStream.closeInput
Bernard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]