memory.tpl

来自「在手机操作系统symbina上使用的一个脚本扩展语言的代码实现,可以参考用于自己」· TPL 代码 · 共 39 行

TPL
39
字号
INCLUDE "sstore.oxh"

PROC main:
	LOCAL storeId%, streamId&, error%
	LOCAL string$(255), length%
	string$ = "String in memory store"

	storeId% = SsCreateStore%:("djstore", KStoreMemory%, 0, 0, 0, 10)
	print "SsCreateStore", storeId%

	streamId& = SsCreateStream&:(storeId%)
	print "SsCreateStream", streamId&

	error% = SsWriteInt%:(storeId%, streamId&, LEN(string$))
	print "SsWriteInt", error%

	error% = SsWriteString%:(storeId%, streamId&, string$, LEN(string$))
	print "SsWriteString", error%

	error% = SsCloseStream%:(storeId%, streamId&)
	print "SsCloseStream", error%
	
	error% = SsOpenStream%:(storeId%, streamId&, KStreamTypeRead%)
	print "SsOpenStream", error%
		
	length% = SsReadInt%:(storeId%, streamId&)
	print "SsReadInt", length%
	
	string$ = SsReadString$:(storeId%, streamid&, length%)
	print "SsReadString", string$

	error% = SsCloseStream%:(storeId%, streamId&)
	print "SsCloseStream", error%

	error% = SsCloseStore%:(storeId%)
	print "SsCloseStore", error%

	get
ENDP

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?