欢迎图片

Changes for page Lua Script

Last modified by Devin Chen on 2025/11/10 16:04

From version 3.1
edited by xingzhi lin
on 2025/09/24 10:17
Change comment: There is no comment for this version
To version 6.1
edited by xingzhi lin
on 2025/10/31 10:04
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -580,7 +580,7 @@
580 580  
581 581  == [[we_bas_getstring>>||anchor="HAddressclass"]] ==
582 582  
583 -Prototype: we_bas_getstring(address, len)
583 +Prototype: we_bas_getstring(address, len [, type, element4, element5, element6])
584 584  
585 585  Function: Read string
586 586  
... ... @@ -588,7 +588,38 @@
588 588  
589 589  * address(string):address
590 590  * len(number):length,Unit: byte
591 +* type(number):type,type=1 is write-through
592 +* element4:element
591 591  
594 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe
595 +|(% style="width:203px" %)0|(% style="width:967px" %)Default
596 +|(% style="width:203px" %)1|(% style="width:967px" %)Forced prohibition of the use of the high-order function
597 +|(% style="width:203px" %)2|(% style="width:967px" %)Enable high and low character swapping
598 +|(% style="width:203px" %)3|(% style="width:967px" %)Enable high and low byte swapping
599 +|(% style="width:203px" %)4|(% style="width:967px" %)Gbk text, normal setting
600 +|(% style="width:203px" %)5|(% style="width:967px" %)Gbk text, the first byte is the string length
601 +|(% style="width:203px" %)6|(% style="width:967px" %)Endian-reversed type1: 12345678 -> 87654321
602 +|(% style="width:203px" %)7|(% style="width:967px" %)Endian-reversed type2: 12345678 -> 78563412
603 +|(% style="width:203px" %)8|(% style="width:967px" %)Endian-reversed type3: 12345678 -> 56781234
604 +|(% style="width:203px" %)9|(% style="width:967px" %)Endian-reversed type4: 12345678 -> 65872143
605 +|(% style="width:203px" %)10|(% style="width:967px" %)Endian-reversed type5: 12345678 -> 43218765
606 +|(% style="width:203px" %)11|(% style="width:967px" %)Characters are stored in one word
607 +|(% style="width:203px" %)12|(% style="width:967px" %)Unicode text
608 +
609 +* element5:element
610 +
611 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe
612 +|(% style="width:203px" %)0|(% style="width:967px" %)Default
613 +|(% style="width:203px" %)4|(% style="width:967px" %)Gbk text, normal setting
614 +|(% style="width:203px" %)5|(% style="width:967px" %)Gbk text, the first byte is the string length
615 +|(% style="width:203px" %)12|(% style="width:967px" %)Unicode text
616 +
617 +* element6:element
618 +
619 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe
620 +|(% style="width:203px" %)0|(% style="width:967px" %)Default
621 +|(% style="width:203px" %)11|(% style="width:967px" %)Characters are stored in one word
622 +
592 592  Return:
593 593  
594 594  * Success: the designated length of the string
... ... @@ -597,12 +597,12 @@
597 597  Example:
598 598  
599 599  {{code language="Lua"}}
600 -print(we_bas_getstring("@W_HDW0", 10))
631 +print(we_bas_getstring("@W_HDW0", 10,0,0,0,0))
601 601  {{/code}}
602 602  
603 603  == [[we_bas_setstring>>||anchor="HAddressclass"]] ==
604 604  
605 -Prototype: we_bas_setstring(address, str [, len])
636 +Prototype: we_bas_setstring(address, str [, len, type, element4, element5, element6])
606 606  
607 607  Function: Write string
608 608  
... ... @@ -611,7 +611,37 @@
611 611  * address(string):address
612 612  * str(string):string
613 613  * len(number):length, if not set, it will be the bytes of the string
645 +* element4:element
614 614  
647 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe
648 +|(% style="width:203px" %)0|(% style="width:967px" %)Default
649 +|(% style="width:203px" %)1|(% style="width:967px" %)Forced prohibition of the use of the high-order function
650 +|(% style="width:203px" %)2|(% style="width:967px" %)Enable high and low character swapping
651 +|(% style="width:203px" %)3|(% style="width:967px" %)Enable high and low byte swapping
652 +|(% style="width:203px" %)4|(% style="width:967px" %)Gbk text, normal setting
653 +|(% style="width:203px" %)5|(% style="width:967px" %)Gbk text, the first byte is the string length
654 +|(% style="width:203px" %)6|(% style="width:967px" %)Endian-reversed type1: 12345678 -> 87654321
655 +|(% style="width:203px" %)7|(% style="width:967px" %)Endian-reversed type2: 12345678 -> 78563412
656 +|(% style="width:203px" %)8|(% style="width:967px" %)Endian-reversed type3: 12345678 -> 56781234
657 +|(% style="width:203px" %)9|(% style="width:967px" %)Endian-reversed type4: 12345678 -> 65872143
658 +|(% style="width:203px" %)10|(% style="width:967px" %)Endian-reversed type5: 12345678 -> 43218765
659 +|(% style="width:203px" %)11|(% style="width:967px" %)Characters are stored in one word
660 +|(% style="width:203px" %)12|(% style="width:967px" %)Unicode text
661 +
662 +* element5:element
663 +
664 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe
665 +|(% style="width:203px" %)0|(% style="width:967px" %)Default
666 +|(% style="width:203px" %)4|(% style="width:967px" %)Gbk text, normal setting
667 +|(% style="width:203px" %)5|(% style="width:967px" %)Gbk text, the first byte is the string length
668 +|(% style="width:203px" %)12|(% style="width:967px" %)Unicode text
669 +
670 +* element6:element
671 +
672 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe
673 +|(% style="width:203px" %)0|(% style="width:967px" %)Default
674 +|(% style="width:203px" %)11|(% style="width:967px" %)Characters are stored in one word
675 +
615 615  Return:
616 616  
617 617  * Success: true
... ... @@ -621,7 +621,7 @@
621 621  
622 622  {{code language="Lua"}}
623 623  local str = "Hello"
624 -we_bas_setstring("@W_HDW0", str)
685 +we_bas_setstring("@W_HDW0", str, 10, 0, 0, 0, 0)
625 625  {{/code}}
626 626  
627 627  == [[we_bas_bmov>>||anchor="HAddressclass"]] ==