ok, i've the following question: if i want to make an array of string like i normally do with dwords, how would that look like? with dwords i do the following:

blabla dd 0,0,0,0,0,0,0,0,0
so if i want to access the third number i just do something like blabla[2*4] the problem with strings is that they DON'T have the same length, but i want to access them like this dword array. the solution would be that if the string for example has the length of 20 characters, and i want the longest string to be 100 characters, the 80 characters left should be filled out with zeroes. ok, i could do something like string db "stringblabla",90 dup(0),"blablabla",95 dup(0) aso. but then i would have to count the characters in the string. and imagine a string has nearly 80 characters, and there is a total of 50 strings, i you would have to count the characters in the strings......*puh*, i don't feel like doin' it. so what would be the easiest way to do that? bye
Posted on 2001-06-17 15:55:00 by [-alloces-]
this should work, but i never tested it my_string01 db "blablabla",0 org my_string01+80 my_string02 db "more blabla strings",0 org my_string02+80 .....
Posted on 2001-06-17 16:13:00 by BogdanOntanu
alloces: You can also just store an array of pointers to the strings, it's more efficient but of course it depends on how you want to implement the array. If you can afford an alternative, I suggest you use this:

String1 db "blahblah",0
String2 db "moreblahblah",0
String3 db "anotherblahblah",0

Strings dd offset String1, offset String2, offset String3
Then you can almost access them like a dword array:

mov eax, dword ptr 
;eax now points to the string
Thomas
Posted on 2001-06-17 17:05:00 by Thomas
hey thomas, this solution is very cool! it seems easy now, that i know an easy way to do that. but it's hard to find a way like that, i think experience is very important for that...... tnx. bye
Posted on 2001-06-18 11:24:00 by [-alloces-]