SScanf
$>>hello
// sends hello into the pawn message buffer$>>read 100 0xAB hello#include <futurocube>
new a,b,ret
new text[40]
new rec_msg{50} //here we use packed string to save memory
main()
{
printf("type: >read {number} 0x(hex number) {string}",a)
for (;;)
{
if (GetShellMsg(rec_msg, 1)) //we are receiving as packed
{
ret = sscanf(rec_msg, "read %d 0x%x %s", a, b, text)
printf("scanned: %d\r\n", ret)
if (ret == 3)
{
printf("%d, 0x%08x, %s\r\n", a, b, text)
}
printf("first leter is '%c'\r\n", rec_msg{0});
}
Sleep()
}
}Last updated