File size: 1,246 Bytes
806d4b5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
/*$DA is the data widget.
-TRM flag is for var
width fields with a terminator
character.
+RD refreshes the data.
+UD updates the val when you edit it.
-P Means it is a string var, basically.
,32 sets the tag string width.
See Data Tag Width.
,RT=I16 means the val is 2 bytes.
See DocDataFmt() and DocDataScan().
*/
I16 i=0;
U8 buf[8];
U0 UpdateGlblTask(I64)
{
while (TRUE) {
i++;
Sleep(1);
}
}
U0 DataDemo()
{
CDocEntry *doc_e;
//This is the command line document.
CDoc *doc=DocPut;
//We do this to prevent access to
//doc_e->data before it is set.
Bool unlock=DocLock(doc);
//You might set the DOCF_FORM flag.
// doc->flags|=DOCF_FORM
//if you wish.
Spawn(&UpdateGlblTask,NULL,"Update Glbl",,Fs);
"Enter editor overstrike mode\n"
"and you can modify the val.\n"
"However, changes happen immediately,\n"
"so it's tricky.\n\n";
//Use <CTRL-l> for the $DA...$ format.
doc_e=DocPrint(doc,"$DA-TRM+RD+UD,RT=I16,A=\"%%7d\"$\n");
doc_e->data=&i;
StrCpy(buf,"Terry");
doc_e=DocPrint(doc,"$DA-P+RD+UD,LEN=7,A=\"Str:%%s\"$\n");
doc_e->data=buf;
if (unlock)
DocUnlock(doc);
}
DataDemo;
//See PopUpExtents().
|