1753354 Members
5030 Online
108792 Solutions
New Discussion юеВ

Create a ^@

 
SOLVED
Go to solution
Dave La Mar
Honored Contributor

Create a ^@

Now I know how to create a control D, etc.
I am stumped on creating a ^@.
This is supposedly the ascii null, hex 0.
I have a c socket program I need to send a buffer to an IBM VSE IP stack that converts the buffer to hex in the ip buffer trace.
A caret @ fools no cobol program.
Note that the buffer sent is a character array.

Any suggestions?

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
6 REPLIES 6
Rodney Hills
Honored Contributor
Solution

Re: Create a ^@

If it is a "c" program, then "\0" should work. As long as you copy the character array with functions that specify string size (rather then using \0 to end string).

HTH

-- Rod Hills
There be dragons...
Mark Greene_1
Honored Contributor

Re: Create a ^@

From your standard US keyboard, the ^@ signal is generated by the key combination of ctrl-shift-2. Is this what you are looking for?


mark
the future will be a lot like now, only later
Dave La Mar
Honored Contributor

Re: Create a ^@

Mark -
That key sequence just results in a back space for me. If I am doing something wrong, please advise.
Rod -
Would prefer the strlen, but this works fine for my testing.
Thanks a bunch.

Best regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Mark Greene_1
Honored Contributor

Re: Create a ^@

Dave,

The @ is the default backspace, so you need to change that on a global basis like this:

stty erase

Where the is a control and H key sequence; you can use the Del key or any other control sequence you want there in place of control-H.

We run the above at boot time to deactivate the @ as a backspace at the login prompt so we can include the @ in passwords.

mark
the future will be a lot like now, only later
Dave La Mar
Honored Contributor

Re: Create a ^@

Mark -
Thanks for the clarification. I have placed that in my handy tips.
Figured I missed something there as well as Rod pointing out the obvious I missed.

"Red faced, but testing completed".

Best regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Dave La Mar
Honored Contributor

Re: Create a ^@

Solution one used, but solution 2 would also have accomplished what I was intending.

dl
"I'm not dumb. I just have a command of thoroughly useless information."