CLEO Help Long strings

CLEO related
Status
Not open for further replies.

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
Trying to make longer strings to hold more text but it's so annoying, wasted an hour with no results. Alloc not working, can I get some help?
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
supahdupahnubah said:
iVilux said:
supahdupahnubah said:
You're providing no numbers lol, for how much longer do you want to make it? etc etc

More than 16, obviously... Around a 100.

Then memory allocation should work for you like a charm lol.. Like opcode wrote above

0@ works perfectly, but I use it for other functions. Neither 2@ nor 2@v work. 2@ crashes and 2@v only stores 16.


Now I see the problem might be with 0AD3/0AD4 not making long enough strings, anyone knows anything about it?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
iVilux said:
0@ works perfectly, but I use it for other functions. Neither 2@ nor 2@v work. 2@ crashes and 2@v only stores 16.

I guess you also need to allocate memory for strings inside function when you pass it
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
supahdupahnubah said:
iVilux said:
0@ works perfectly, but I use it for other functions. Neither 2@ nor 2@v work. 2@ crashes and 2@v only stores 16.

I guess you also need to allocate memory for strings inside function when you pass it

A long time ago I heard that 0@ stores memory differently or can store more, is this true? Or are they all the same?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
iVilux said:
A long time ago I heard that 0@ stores memory differently or can store more, is this true? Or are they all the same?

They should be all same iirc, basically a variable is a certain amount of allocated memory, so there shouldn't be any limitation on how much big it might be (except for 32\64bit limits and limits of your RAM), so you can even store whole Trump's speech inside RAM and handle it however you want, it's just the way you use IDE i.e. Sanny Builder and his opcodes
There's also might be game limitation because cleo works with the game engine (and it's god damn old and buggy), but still, I don't think storing at least 100 chars string might be a problem
This worked good for me
Code:
alloc 2@ 256
format 2@ "one two three four five six seven eight nine ten eleven twelve thirteen fourteen"
while true
wait 0
0AF8: samp add_message_to_chat "%s" 120007 2@
wait 1000
end
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
You should post an example of what doesn't work for you.
The limit for a string in the SB IDE is 255, meaning a string between quotation marks can't be longer than 255 symbols/chars.
0AD4 can only extract strings to @v vars, so that means you can only extract strings that are limited to 16 chars. There is an alternative written by legend2360 -> HERE, it's in russian(google translate it) or maybe @supahdupahnubah can do a proper translation.
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
springfield said:
There is an alternative written by legend2360 -> HERE, it's in russian(google translate it) or maybe @supahdupahnubah can do a proper translation.

I can even make a post about this, but is it useful? People actually do sscan for 16+ char strings?
 
Status
Not open for further replies.
Top