🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #144235

Re: [Dialog] help needed with scripts

#144235
From: matija
Date: Fri, 27 Feb 2004 22:44
50 lines
3128 bytes
MLC, completely geschtonkenflapped, wrote:
> I've thought to put a sleep between the two commands, and it works well if I
> give enough time, but it makes impossible every interaction with Dialog
> until this time is elapsed.
> Can be there another solution?

     would this help somehow? note that you can have multiple references
     to an atom, so if you create it five times and delete it only once,
     it will still be kept in the atom table until you call the delete
     function four more times. also, it might be a good idea to enclose
     everything in try..finally blocks.


program atomTest;

function globalAddAtom(lpStr: pchar) : word; external 'GlobalAddAtomA@kernel32.dll stdcall';
function globalFindAtom(lpStr: pchar) : word; external 'GlobalFindAtomA@kernel32.dll stdcall';
function globalDeleteAtom(nAtom: word) : word; external 'GlobalDeleteAtom@kernel32.dll stdcall';

var atomName: pchar;
    myAtom: word;

begin
  atomName := 'MLCAtom';
  
  myAtom := globalAddAtom(atomName);
  if (myAtom <> 0) then
    begin
      writeln('');
      writeln('created atom with ID ' + inttostr(myAtom));
  
      myAtom := globalFindAtom(atomName);
      if (myAtom <> 0) then
        begin
          writeln ('found the atom! now going to delete it...')
          globalDeleteAtom(myAtom);
          writeln ('atom hopefully deleted; we would need setLastError() and getLastError() to check :/');     
          writeln('');         
        end;
        
    end; // if (myAtom <> 0) after globalAddAtom()

end.



-- 
there is a cheer. the gnomes have learned a new way to say hooray.   [-shpongle]

address is scrambled - remove the superfluous "x" marks to reply
Technical Details
Message-ID: <16n122oojxuel$.dlg@shpongle.604>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!mephistopheles.news.clara.net!news.clara.net!wagner.news.clara.net!skynet.be!fu-berlin.de!CARNet.hr!not-for-mail
References: <1mops9bm8bjs5.dlg@ID-187316.user.uni-berlin.de>

Show Full Headers
Complete Article Headers
Message-ID: <16n122oojxuel$.dlg@shpongle.604>
Subject: Re: [Dialog] help needed with scripts
Date: Fri, 27 Feb 2004 23:44:44 +0100
From: matija <xmkrnicx@xpublicx.xsrcex.hr>
References: <1mops9bm8bjs5.dlg@ID-187316.user.uni-berlin.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!mephistopheles.news.clara.net!news.clara.net!wagner.news.clara.net!skynet.be!fu-berlin.de!CARNet.hr!not-for-mail
Newsgroups: news.software.readers
Organization: 604
Lines: 50
NNTP-Posting-Host: cmung3178.cmu.carnet.hr
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: bagan.srce.hr 1077921883 16128 193.198.140.130 (27 Feb 2004 22:44:43
 GMT)
X-Complaints-To: abuse@carnet.hr
NNTP-Posting-Date: Fri, 27 Feb 2004 22:44:43 +0000 (UTC)
User-Agent: 40tude_Dialog/2.0.9.1hr (001596df.335.247)
X-Afraid-Of: spiders
X-Face: "wB!^cgWZ=;
 q%#:6lkzMWJ-O*>}<FSIu#HEqp5P2E#=mTGgQ-\^YM|Vt(j_|:*GI8?,7A9Z
 mkgCj|$f)nB@*>(B14sXotbL/"G.Z0u$]5\GcxnO4')%FUE\48H!!$rCLV.`
X-Mastered: the art of pizza making
X-Searching-For: GMT soundtrack (guy sigsworth)