Newbie problem

new topic     » topic index » view thread      » older message » newer message

Sorry to be so uninformed. I want to create a file of 65536 fixed length 
records, 8 bytes each. These will be selectively displayed at various 
locations on the screen, modified and rewritten. From what I have read, 
I thought the following would accomplish my goal. (The initial contents 
of the file are simply the number of the corresponding record.)

node_array = {}
for i=1 to 65536 do
   node_array = append(node_array, sprintf("%08d",i))    
end for
fn = open("nodes.dat", "wb")

<snip>
This inserts commas and sequence brackets into the string. That is not 
what I wanted or intended, but would be acceptable if I could get it to 
print out 8 characters at a time. I thought the following should display 
the third word, but instead, it displays only one character.

fp=seek(fn,0)
s = get(fn)
node_array = s[2]
trace(2)
printf(1,"%8s",node_array[3])

What am I missing?

Newbie
Allen

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu