Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : MEMOREAD.ZIP
Filename : MEMOPRN.C

 
Output of file : MEMOPRN.C contained in archive : MEMOREAD.ZIP
/* MEMOPRN() */
/* This reads a memo field and a literal string passed to it and formats it */
/* for display with a "?" or @ ...SAY command. */


#include
#include
#include "extend.h"

#define NEW_LINE '\n'
#define SOFT_CR '\215'

memoprn()
{
char *memo, *pos, *literal, *pos2;
int rc;
int r,c;
int str_pos;
int _getcurs(), _setcurs();

/* get current position of cursor */
rc = _getcurs();
r = rc/256;
c = rc % 256;

if (PCOUNT >= 2 && ISCHAR(1))
{
/* get string */
literal = _parc(1);
memo = _parc(2);
pos = memo;
pos2 = literal;
str_pos = strlen(literal);

/* print each character in the literal parameter passed */
while (*pos2)
{
cprintf("%c", *pos2);
pos2++;
}
c = c + str_pos;
}
else

memo = _parc(1);
pos = memo;
_setcurs(r,c);

/* read each character from string */
while (*pos)
{
switch (*pos)
{

/* searches for soft return character converts it to a blank */
case SOFT_CR:
*pos = ' ';
cprintf("%c", *pos);
break;

/* searches for carriage return line feed character */

case NEW_LINE:
cprintf("%c", *pos);
r = r+1;
_setcurs(r,c);
break;

default:
cprintf("%c", *pos);

}

/* get next character */
pos++;

}
_retc("");

}


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : MEMOREAD.ZIP
Filename : MEMOPRN.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/