The MASM Forum

Miscellaneous => The Orphanage => Topic started by: jj2007 on March 07, 2021, 03:43:21 AM

Title: Watch out for new posts
Post by: jj2007 on March 07, 2021, 03:43:21 AM
As requested by Hutch, I moved the "forum watcher" to the MasmBasic sub-forum (http://masm32.com/board/index.php?topic=9231.0). The new version uses a SysLink control. Feedback needed - I could not yet test it on Windows 10.

A little proggie that checks every two minutes if there are new posts in the forum :biggrin:
guiTimerMs=120000 ; once every two minutes; OPT_Icon Eye
guiShowW=6 ; SW_MINIMIZE
GuiParas equ "Forum watcher", xr20, w400, h400 ; xr=right aligned
include \masm32\MasmBasic\Res\MbGui.asm
  GuiControl MyEdit, "edit", font -14:FW_SEMIBOLD, bcol Black, fcol White
  SetGlobals Forum$, ForumAll$, ForumOld$, flag
  call CheckNewPosts ; once before the timer kicks in
Event Timer
  call CheckNewPosts
EndOfEvents
CheckNewPosts:
  Let Forum$=NoTag$(FileRead$("http://masm32.com/board/index.php?action=recent"))
  Let ForumAll$=""
  For_ ecx=1 To 9
Let ForumAll$=ForumAll$+Str$("\n\n%_i ",ecx)+Extract$(Forum$, "/ Re: ", "on Today at", xsExcL or xsExcR or xsLoop, 1)
  Next
  .if StringsDiffer(ForumAll$, ForumOld$) ; something changed, show it
Let ForumOld$=ForumAll$
AddWin$ hMyEdit="*** minimise this window ***"+eax
ClearLastError
invoke ShowWindow, hGui, SW_RESTORE ; pop up if minimised
  .endif
  ret
GuiEnd XP
Title: Re: Watch out for new posts
Post by: HSE on March 07, 2021, 03:52:01 AM
JJ:
I don't see your post  :biggrin:

Edit must be cleaned, I don't know how you do that:  .if StringsDiffer(Forum$, ForumOld$)

AddWin$ hMyEdit=nulo$  ; <----- ???

Let ForumOld$=Forum$
AddWin$ hMyEdit=eax+CrLf$
invoke ShowWindow, hGui, SW_RESTORE
  .endif
Title: Re: Watch out for new posts
Post by: jj2007 on March 07, 2021, 03:55:01 AM
Quote from: HSE on March 07, 2021, 03:52:01 AM
JJ:
I don't see your post  :biggrin:

I see yours:
1 Watch out for new posts
«Last post by HSE


But you are right, it has a little bug: Extract$ (https://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1156)(Forum$, "/ Re: ", "on Today at", xsExcL or xsExcR or xsLoop, 1)

That doesn't catch new posts :sad:
Title: Re: Watch out for new posts
Post by: HSE on March 07, 2021, 04:01:46 AM
 :thumbsup: now
1 Watch out for new posts
«Last post by jj2007

2 Watch out for new posts
«Last post by HSE

3 ", "

4 UASM and UltraLight
«Last post by johnsa

5 UASM and UltraLight
«Last post by mabdelouahab
Title: Re: Watch out for new posts
Post by: jj2007 on March 07, 2021, 05:09:20 AM
Ok, it's fixed: now it looks also for brand new threads - see version 2 attached to the top post.

It was a bit more complicated, as I had to dig into the html code to find the board title.
Title: Re: Watch out for new posts
Post by: HSE on March 07, 2021, 06:21:34 AM
Testing the thing

Fantastic  :thumbsup:
Title: Re: Watch out for new posts
Post by: jj2007 on March 07, 2021, 06:38:37 AM
Glad to hear it works :thumbsup:

One problem was that the download of http://masm32.com/board/index.php?action=recent is as "guest", i.e. not logged in. Apparently the old trick with embedding user name and password into the URL does not work any more (and rightly so). So you get a dumbed down version of the forum. I'd like to do the same with other forums where I am registered, but FreeBasic (https://www.freebasic.net/forum/search.php?search_id=newposts), for example, has a different software, and I have not yet discovered a way to get the most recent posts :sad:
Title: Re: Watch out for new posts
Post by: TouEnMasm on March 07, 2021, 07:19:01 PM
it isn't asm
include \masm32\MasmBasic\Res\MbGui.asm
And it seem that the show case is deicated to masm
Quote
A gallery of finished applications by experienced members. Do not fill this full of junk or experiments, it is for finished applications. targets can be either 32 or 64 bit assembler applications. Non assembler application will be moved elsewhere.
Title: Re: Watch out for new posts
Post by: jj2007 on March 07, 2021, 08:04:31 PM
Quote from: TouEnMasm on March 07, 2021, 07:19:01 PM
it isn't asm

Nonsense, as long as it gets assembled by Masm, UAsm or AsmC, it clearly is "asm".

What about your "SDK", Yves? Is it some dialect of C? Is it French?
Title: Re: Watch out for new posts
Post by: TouEnMasm on March 07, 2021, 08:18:43 PM

All languages are finally in assembly.
masmBasic stay a Basic not masm,He is different.
As allways ,You don't seem to know what is Politeness.
Title: Re: Watch out for new posts
Post by: TimoVJL on March 07, 2021, 08:33:06 PM
Quote from: TouEnMasm on March 07, 2021, 08:18:43 PM
All languages are finally in assembly.
Actually no, but gcc still use it.
https://en.wikipedia.org/wiki/Assembly_language
Title: Re: Watch out for new posts
Post by: hutch-- on March 07, 2021, 09:41:45 PM
Can we keep this squabbling out of here.  This sub forum is to showcase finished assembler code and if the source is not assembler source, it should not be here. We have folks here who write C an in JJs case his own dialect of basic but neither are for this subforum which is specifically for assembler code.

I don't want to have to move posts but this sub forum is exclusively for assembler code.
Title: Re: Watch out for new posts
Post by: jj2007 on March 07, 2021, 11:06:26 PM
Quote from: hutch-- on March 07, 2021, 09:41:45 PM
Can we keep this squabbling out of here.  This sub forum is to showcase finished assembler code and if the source is not assembler source, it should not be here. We have folks here who write C an in JJs case his own dialect of basic but neither are for this subforum which is specifically for assembler code.

I don't want to have to move posts but this sub forum is exclusively for assembler code.

MasmBasic is assembler code, 100%. If, however, you want to restrict "assembler code" to the Masm32 and Masm64 SDKs, then you would have to exclude anybody who has developed own includes. For example, Yves' recent 'security' example (http://masm32.com/board/index.php?topic=9071.0):

Quote from: jj2007 on February 04, 2021, 02:38:29 AM
Ups....
Tmp_File.asm(2) : Error A2106: Cannot open file: "sdk32.inc" [ENOENT]
Tmp_File.asm(3) : Error A2106: Cannot open file: "stdio.sdk" [ENOENT]
Tmp_File.asm(4) : Error A2106: Cannot open file: "conio.sdk" [ENOENT]
Tmp_File.asm(6) : Error A2106: Cannot open file: "accCtrl.sdk" [ENOENT]
Tmp_File.asm(7) : Error A2106: Cannot open file: "aclapi.sdk" [ENOENT]
Tmp_File.asm(43) : Error A2082: Must be in segment block

Or Yves' tiger example (http://masm32.com/board/index.php?topic=8959.0) (see macro.inc, REEL etc)
Or Yves' Glu example (http://masm32.com/board/index.php?topic=8885.0) (is REEL "asm"?)
Or fearless' TrayInfo demo (http://masm32.com/board/index.php?topic=7994.0) (RadAsm, plus his own includes - excellent btw)

Where does your crusade against impure assembler code end...? Once upon a time, you were proud to present evidence that Assembly can do more than just hello world console proggies :cool:
Title: Re: Watch out for new posts
Post by: hutch-- on March 08, 2021, 01:41:12 AM
> Where does your crusade against impure assembler code end...?

It never started but this forum has seen, FASM, GAS UASM JWASM, Bogdan's version and a host of others but they are all direct assemblers. The thin edge of the wedge is different dialects that use an assembler as their back end, GNU C with GAS as its back end just as an example. What about other dialects of basic that use an assembler as their back end ?

I set up this Showcase sub forum for assembler code, should we be supporting C and basic compilers as well ?