HI,

Can anyone assist me with retrieving the array, I just loaded into memory?

I am not able to retrieve the array, need help retrieving it.

I would appreciate it very much,

Thx.

My Code:


Program Script_Generator;

#include( "stdlib.hhf" )

const


var
phNum: string;
sumNum: int32;
long_phNum: string;


static
phNumArray: string[300];
numHandle: dword;

begin Script_Generator;

fileio.open("NumFile.txt",fileio.r); // open file for reading
mov(eax,numHandle);
mov(1,ecx); // counter for strings

stralloc( 256 ); // allocate memory for long_phNum
mov( eax, long_phNum );

fileio.rewind( numHandle ); // begin of file


while (!fileio.eof( numHandle )) do

fileio.get( numHandle,long_phNum );

str.a_substr(long_phNum, 1, 6 ); // remove first letter from each string

mov(eax,phNumArray); // load array with strings


stdout.put( "String...",ecx,"is: ",phNumArray, nl );

inc(ecx);

endwhile;
mov(ecx,sumNum);

stdout.put( "Total strings ...",ecx, nl ); // display
Total number of strings
fileio.close(numHandle);
strfree(long_phNum);

end Script_Generator;
Posted on 2003-04-29 08:44:01 by Yao_Rules
Hi Yao_Rules,

Your program is absolutely workable.
Add "stdin.readLn();" to the end (right above "end YourProgramName;" statement) to make console window stay on the screen and enjoy :)

And one more thing to say: you begin to populate your array starting from offset 4 not 0 as wasting first 4 bytes.

Regards, GJ
Posted on 2003-04-29 13:35:46 by Green Joe