News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

array of strings

Started by stanks, January 16, 2012, 01:06:03 PM

Previous topic - Next topic

stanks

any example? what i am trying to do is get e.g. all files from /home to array of strings and then show all that files with stdout.put. getting folders/files is not problem, but this array is.
i was trying with _f: string [1024] (1024 elements of array), but this does not work. if i read correctly this is max. length of a string, so every time with stdout.put i get only last file found in folder.
how to do it?

thanks

dedndave

try making an array of pointers, rather than strings
each pointer is a dword size (4 bytes) - easy to index
then, put the (zero-terminated) strings in a large buffer - the address of each string is in the array

stanks


dedndave

did that help ?
or do you need some example code ?

stanks

i don't know how to do that

dedndave

ok - give me a few minutes  :P

dedndave

ok - see if this helps...

stanks

thanks but i need hla source not masm source...i am not anymore on winblowz...sorry

dedndave

oh - sorry
i don't know HLA   :'(

Sevag.K

Quote from: stanks on January 16, 2012, 01:06:03 PM
any example? what i am trying to do is get e.g. all files from /home to array of strings and then show all that files with stdout.put. getting folders/files is not problem, but this array is.
i was trying with _f: string [1024] (1024 elements of array), but this does not work. if i read correctly this is max. length of a string, so every time with stdout.put i get only last file found in folder.
how to do it?

thanks

if memory serves me, you can look up the standard library source code on the environment setup.  it scans all the environment strings into an array of strings.