Coding

 Reply to this postStart new topic

String Limit on 0AD3?

The DeLuca
post Apr 25 2013, 09:56 AM
Post #1


The New Guy!

Posts: 11
From: Missouri, US
Joined: 27-March 12



Is there a string limit on this? I have one string with 16 characters and it works fine. I have another with 17 and it just won't work. For some reason this is my weak point when it comes to coding.


--------------------
Go to the top of the page
 
+Quote Post
AlexTMjugador
post Apr 26 2013, 02:26 PM
Post #2


The New Guy!

Posts: 9
Joined: 20-December 12



It deppends of the string type to store the result into. X@v strings have a limit of 16 characters. X@s string have a limit of 4 characters.

If you're trying to make something like "languages", take a look at the power of .fxt and that opcode thumbsup.gif
Go to the top of the page
 
+Quote Post
fastman92
post Apr 26 2013, 06:21 PM
Post #3


Trained Member

Posts: 77
Joined: 25-October 10



QUOTE (AlexTMjugador @ Apr 26 2013, 03:26 PM) *
It deppends of the string type to store the result into. X@v strings have a limit of 16 characters. X@s string have a limit of 4 characters.

If you're trying to make something like "languages", take a look at the power of .fxt and that opcode thumbsup.gif

Someone who knows no more than the OP shouldn't reply either.

@s variables consist of 8 bytes and therefore they're able to store up to 7 characters as summing that is NULL terminated.
@v variables consist of 16 bytes and therefore they're able to store up to 15 characters as summing that is NULL terminated.
Go to the top of the page
 
+Quote Post
The DeLuca
post Apr 27 2013, 07:21 AM
Post #4


The New Guy!

Posts: 11
From: Missouri, US
Joined: 27-March 12



So how can I increase the characters it can have? I hate this allocating byte aspect lol


--------------------
Go to the top of the page
 
+Quote Post
fastman92
post Apr 27 2013, 08:51 AM
Post #5


Trained Member

Posts: 77
Joined: 25-October 10



You can do this:
CODE
:myStringSpace
hex
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   // 16 bytes
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   // 16 bytes
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   // 16 bytes
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   // 16 bytes
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   // 16 bytes
end


Somewhere in the code, you'll have to get a pointer to this label:
CODE
0AC6: get_label_pointer @myStringSpace store_to 0@

Or you can use getLabelOffset CLEO SCM function that you can find somewhere (use Google).
Go to the top of the page
 
+Quote Post
aliceddendy
post Sep 21 2013, 07:59 AM
Post #6


The New Guy!

Posts: 2
Joined: 20-September 13



Just what I needed... Thanks!
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: