Discussion:
send commands dec
(too old to reply)
Smart Software
2008-06-09 15:09:58 UTC
Permalink
i have to make a file with next values

how can i write these commands= 27 + 112 + 00 + 50 + 50

i saw something like chr(27), chr(112)etc.

but chr is not a borland function

can someone tell me how to do this

Thanks
Bruce Salzman
2008-06-09 16:47:51 UTC
Permalink
Post by Smart Software
i have to make a file with next values
how can i write these commands= 27 + 112 + 00 + 50 + 50
i saw something like chr(27), chr(112)etc.
but chr is not a borland function
can someone tell me how to do this
ofstream f("filename", ios::binary);
f.put(27);
f.put(112);
f.put(00);
f.put(50);
f.put(50);
--
Bruce
Chris Uzdavinis (TeamB)
2008-06-09 18:15:38 UTC
Permalink
Post by Smart Software
i have to make a file with next values
What do you mean by "next" values? N+1?
Post by Smart Software
how can i write these commands= 27 + 112 + 00 + 50 + 50
Are you wanting to write the string

"commands= 27 + 112 + 00 + 50 + 50" into a file? Or just
"27 + 112 + 00 + 50 + 50"

Or the evaluation of that expression

239

Or what?
Post by Smart Software
i saw something like chr(27), chr(112)etc.
I've seen a chr() function in Basic, which gave you the character from
the corresponding ASCII value.
Post by Smart Software
but chr is not a borland function
can someone tell me how to do this
You need to be *much* clearer in what you're trying to do. For
example, say what you would expect the bytes to look like in the
output file you're trying to write. Explain what you hope to
accomplish with function calls (like chr()), etc.
--
Chris (TeamB);
Loading...